Get Tile Tokens Batch
const url = 'https://example.com/api/tiles/tokens/';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"dataset_ids":["2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"]}'};
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://example.com/api/tiles/tokens/ \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "dataset_ids": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ] }'Batch-generate tile tokens for up to 50 datasets in one request.
Optimization for multi-layer maps: a 20-layer builder map previously fired 20 parallel GET /token/{id}/ requests (20 HTTP + 20 RBAC + 20 HMAC signatures). This endpoint does the same work in a single round trip with one DB query for dataset metadata (PERF-N5).
Per-dataset errors (404, 403) do not fail the batch — instead the
response maps the offending dataset_id to {"error": "..."}. Clients
should check each entry for the error key.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”Batch request for tile tokens — accepts up to 50 dataset IDs.
object
Dataset IDs to generate tokens for. Must be unique; duplicates deduplicated server-side.
Example generated
{ "dataset_ids": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ]}Responses
Section titled “ Responses ”Successful Response
Batch response mapping dataset_id (string) to token or error.
Each entry is either a VectorTileToken, a RasterTileToken, or a
{"error": "..."} object describing why the token could not be
generated (404 dataset, 403 forbidden, etc.). The batch call itself
succeeds even if individual datasets fail — clients should check each
entry for the error key.
object
object
object
object
object
Example
{ "tokens": { "additionalProperty": { "kind": "vector" } }}Validation Error
object
object
object
Example generated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example", "input": "example", "ctx": {} } ]}