Skip to content

Mint access token

POST
/v1/vehicles/tokens
curl --request POST \
--url https://api.example.yas/v1/vehicles/tokens \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "partnerId": "partner", "driverId": "drv_example", "vehicleId": "veh_example" }'

The partner backend mints a bearer with the server key. The SDK can use that bearer for 24 hours. Mint it for the partnerId, driverId, and vehicleId from setup. POST /v1/tokens is deprecated. Use this path.

Media typeapplication/json
object
partnerId
required

Partner id from setup. It must match the server key.

string
/^[a-z0-9-]{1,64}$/
driverId
required

Driver id from setup.

string
>= 1 characters
vehicleId
required

Vehicle id from setup.

string
>= 1 characters

Example

{
"partnerId": "partner",
"driverId": "drv_example",
"vehicleId": "veh_example"
}

A bearer for tokenProvider to return.

Media typeapplication/json
object
accessToken
required
string
expiresAt
required

ISO-8601 UTC. The token lasts 24 hours.

string format: date-time
tokenType
required
string
Allowed values: Bearer

Example

{
"accessToken": "eyJexample",
"expiresAt": "2026-10-16T12:00:00.000Z",
"tokenType": "Bearer"
}
400The body is not a JSON object, `partnerId` does not match `^[a-z0-9-]{1,64}$`, or `driverId` or `vehicleId` is missing or empty. This check runs after authentication and before the partner match, so a malformed `partnerId` is 400, not 403.
Media typeapplication/json
object
error
required

Stable error code. No stack trace.

string

Example

{
"error": "invalid_body"
}
401The server key is missing or wrong.
Media typeapplication/json
object
error
required

Stable error code. No stack trace.

string

Example

{
"error": "invalid_credentials"
}
403A server key may be limited to vehicles, robots, or both. A call outside that limit is 403 `forbidden` and stores nothing. `identity_mismatch` means `partnerId` does not match the server key.
Media typeapplication/json
object
error
required

Stable error code. No stack trace.

string

Example

{
"error": "forbidden"
}