Skip to content
getgeolens.com

Create Download Token Endpoint

POST
/auth/download-token/{dataset_id}
curl --request POST \
--url https://example.com/api/auth/download-token/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \
--header 'Authorization: Bearer <token>'

Mint a short-lived download-scoped JWT for a single dataset.

IA-P0-01 / SEC-04: the existing COG download URL path requires a typ='download' JWT on the ?token= query parameter — session JWTs are rejected. This endpoint issues that token after verifying the caller has read access to the dataset.

Anonymous callers are allowed for public datasets. The returned token has typ='download', scope='dataset:{dataset_id}', and a TTL of 120s.

dataset_id
required
Dataset Id
string format: uuid

Successful Response

Media type application/json
DownloadTokenResponse
object
token
required
Token

Short-lived download-scoped JWT (typ=‘download’, TTL ≤ 120s)

string
expires_in
Expires In

Seconds until the download token expires

integer
default: 120
Example
{
"expires_in": 120
}

Bad request — invalid query parameters or payload

Unauthorized — missing or invalid credentials

Forbidden — caller lacks access to this resource

Not found

Validation error

Internal server error