تخطَّ إلى المحتوى
توثيق المطورين

Mint a short-lived client-access token

POST /v1/tracking/client-tokens · Authorization: Bearer

Mint a short-lived client-access token

POST /v1/tracking/client-tokens · Authorization: Bearer

POST/v1/tracking/client-tokens

Mint a short-lived client-access token

Server-to-server only. Exchanges an organization API key (scope client_tokens:mint) for a short-lived opaque bdy_cli_* bearer authorizing READ-ONLY realtime on an explicit, immutable subject set. The plaintext token is returned exactly once.

Credential
Authorization: Bearer
Plane
https://api.bardiyamap.com
Operation id
mintClientToken

Parameters

This operation takes no parameters.

Request body

application/json · required

FieldTypeRequiredNotes
subjectsPublicSubjectRef[]noSubjects the token may act for. A token is scoped, never global.
subscription_idsstring (uuid)[]noRestrict the token to these subscriptions instead of every subscription of the subject.
ttl_secondsintegernoToken lifetime. Keep it short: the token is meant to be handed to a device and rotated.>= 1
json
{
  "subjects": [
    {
      "type": "vehicle",
      "id": "veh-1042"
    }
  ],
  "subscription_ids": [
    "sub_01HX9Z6Q3M"
  ],
  "ttl_seconds": 900
}
Minimal valid body

Request example

shell
curl -X POST "https://api.bardiyamap.com/v1/tracking/client-tokens" \
  -H "Authorization: Bearer $BARDIYA_TRACKING_KEY" \
  -H "Content-Type: application/json" \
  --data '{"subjects":[{"type":"vehicle","id":"veh-1042"}],"subscription_ids":["sub_01HX9Z6Q3M"],"ttl_seconds":900}'

Response 201 · ClientTokenMinted

FieldTypeRequiredNotes
capabilitystringyes
created_atstring (date-time)yesdate-time
expires_atstring | nullnodate-time
idstringyes
revokedbooleanno
subjectsPublicSubjectRef[]yes
token_prefixstringyes
tokenstringyesThe plaintext credential. Returned exactly once by the server.
ttl_secondsintegeryes

Errors

StatusMeaning
400Request is malformed or a parameter is out of range
401Authentication failed
403Required scope is missing
404Resource not found or is not visible to this tenant
409Conflict or idempotency error
422Validation Error
429Rate limit or quota exceeded; honour `Retry-After`
503Public transport is temporarily unavailable

Error bodies use the shared envelope documented in Errors: { "error": { "code", "message", "details", "request_id" } }.

POST /v1/tracking/client-tokens is part of the Client Tokens group. Values on this page are generated from contract version 1.1.0.