Get Token
POST
/v1/auth/token
const url = 'https://api.uavcrew.ai/v1/auth/token';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"api_key":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.uavcrew.ai/v1/auth/token \ --header 'Content-Type: application/json' \ --data '{ "api_key": "example" }'Exchange API key for JWT tokens.
Returns an access token (short-lived) and refresh token (long-lived). Use the access token in the Authorization header for API requests.
Example:
Authorization: Bearer <access_token>
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
TokenRequest
Request for JWT token using API key.
object
api_key
required
Api Key
string
Example generated
{ "api_key": "example"}Responses
Section titled “Responses”Successful Response
Media typeapplication/json
TokenResponse
JWT token response.
object
access_token
required
Access Token
string
refresh_token
required
Refresh Token
string
token_type
Token Type
string
expires_in
required
Expires In
integer
Example
{ "token_type": "bearer"}Validation Error
Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object
Example generated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example", "input": "example", "ctx": {} } ]}