Mint access token (deprecated)
Deprecated
POST
/v1/tokens
const url = 'https://api.example.yas/v1/tokens';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"partnerId":"partner","driverId":"drv_example","vehicleId":"veh_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.example.yas/v1/tokens \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "partnerId": "partner", "driverId": "drv_example", "vehicleId": "veh_example" }'Deprecated. Use POST /v1/vehicles/tokens. The body and errors are the same.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
partnerId
required
Partner id from setup. It must match the server key.
string
driverId
required
Driver id from setup.
string
vehicleId
required
Vehicle id from setup.
string
Example
{ "partnerId": "partner", "driverId": "drv_example", "vehicleId": "veh_example"}Responses
Section titled “Responses”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
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"}