Skip to content
getgeolens.com

Create Embed Token Endpoint

POST
/maps/{map_id}/embed-tokens/
curl --request POST \
--url https://example.com/maps/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/embed-tokens/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "allowed_origins": [ "https://dashboard.example.com" ], "expires_in_days": 30, "name": "Public dashboard embed" }'

Create an embed token scoped to a map’s current layers.

The default 30-day unrestricted token is always available. Custom lifetimes and non-empty origin restrictions require advanced sharing controls.

map_id
required
Map Id
string format: uuid
Media type application/json
EmbedTokenCreate
object
allowed_origins
Any of:
Array<string>
<= 50 items
expires_in_days
Expires In Days

Token lifetime in days (1-365). The default 30-day lifetime is always available; custom lifetimes require advanced sharing controls.

integer
default: 30 >= 1 <= 365
Example
90
name
Any of:
string
>= 1 characters <= 255 characters

Successful Response

Media type application/json
EmbedTokenCreatedResponse
object
allowed_origins
Any of:
Array<string>
created_at
required
Created At
string format: date-time
expires_at
required
Expires At
string format: date-time
id
required
Id
string format: uuid
is_active
required
Is Active
boolean
last_used_at
Any of:
string format: date-time
map_id
required
Map Id
string format: uuid
name
Any of:
string
raw_token
required
Raw Token
string
scoped_dataset_ids
required
Scoped Dataset Ids
Array<string>
token_hint
required
Token Hint
string
use_count
Use Count
integer
0
Example
{
"use_count": 0
}

Bad request — invalid payload

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Unauthorized — missing or invalid credentials

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Forbidden — caller lacks write access

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Not found

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Conflict — resource state prevents the operation

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Validation error

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Too many requests — retry after the advertised interval

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}
Retry-After
integer

Seconds until the request may be retried

Internal server error

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Service unavailable — the database could not serve the request

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}