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

ProblemDetail
object
detail
required
Detail
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"type": "about:blank"
}

Unauthorized — missing or invalid credentials

ProblemDetail
object
detail
required
Detail
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"type": "about:blank"
}

Forbidden — caller lacks write access

ProblemDetail
object
detail
required
Detail
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"type": "about:blank"
}

Not found

ProblemDetail
object
detail
required
Detail
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"type": "about:blank"
}

Conflict — resource state prevents the operation

ProblemDetail
object
detail
required
Detail
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"type": "about:blank"
}

Validation error

ProblemDetail
object
detail
required
Detail
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"type": "about:blank"
}

Internal server error

ProblemDetail
object
detail
required
Detail
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"type": "about:blank"
}