Upload Og Image
const url = 'https://example.com/maps/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/og-image/';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"data_uri":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”Request Body required
Section titled “Request Body required ”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
Example generated
{ "data_uri": "example"}Responses
Section titled “ Responses ”Successful Response
Bad request — invalid payload
object
Example
{ "type": "about:blank"}Unauthorized — missing or invalid credentials
object
Example
{ "type": "about:blank"}Forbidden — caller lacks write access
object
Example
{ "type": "about:blank"}Not found
object
Example
{ "type": "about:blank"}Conflict — resource state prevents the operation
object
Example
{ "type": "about:blank"}Validation error
object
Example
{ "type": "about:blank"}Internal server error
object
Example
{ "type": "about:blank"}