Skip to content
getgeolens.com

Upload Og Image

PUT
/maps/{map_id}/og-image/
curl --request PUT \
--url https://example.com/maps/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/og-image/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "data_uri": "example" }'

Upload a base64 OG social-card image (up to 750KB) for a map.

Accepts a data:image/ URI, decodes the base64 payload, validates the bytes are a real image (PIL verify), writes to storage under maps/og-images/{map_id}.{ext}, and persists the storage key to catalog.maps.og_image_uri.

Intended for 1200x630 JPEG captures (SHARE-08). The payload cap (750KB) is larger than the thumbnail cap (100KB) to accommodate the larger canvas export — they are separate schemas (OgImageUploadRequest vs ThumbnailUploadRequest) to avoid relaxing the locked thumbnail contract. Auth and PIL-verify rules are identical to upload_thumbnail.

map_id
required
Map Id
string format: uuid
Media type application/json
OgImageUploadRequest

JSON body for PUT /maps/{map_id}/og-image/ (SHARE-08 Path A).

Accepts a base64 data URI up to 750 KB (as a string). This generous ceiling accommodates a 1200x630 JPEG at quality 0.85, which encodes to roughly 150-400 KB raw and ~200-540 KB as a base64 string.

  • min_length=22: same floor as ThumbnailUploadRequest — rejects empty/clearly-malformed URIs without false-positives.
  • max_length=750_000: ~562 KB decoded — generous for 1200x630 JPEG. DO NOT raise ThumbnailUploadRequest.max_length to match this value; the 100KB thumbnail cap is a locked contract (Phase 254 / D-03).
object
data_uri
required
Data Uri
string
>= 22 characters <= 750000 characters
Example generated
{
"data_uri": "example"
}

Successful Response

Bad request — invalid payload

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

Not found

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

Validation error

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

Bad gateway — an upstream provider failed

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