Skip to content

Upload Header Media

POST
/platform/v1/templates/header-media
curl --request POST \
--url https://example.com/platform/v1/templates/header-media \
--header 'Content-Type: multipart/form-data' \
--form file=example \
--form mime_type=example

Resumable upload of a header media binary → returns header_handle.

Two body shapes (mutually exclusive — branch on Content-Type):

  • multipart/form-data — fields file + mime_type.
  • application/json — body {mime_type, source_url} (SSRF-guarded fetch).

The returned header_handle goes into components[].example .header_handle = [<handle>] of a subsequent POST /templates (or PATCH).

Errors: * unsupported MIME / oversize / SSRF blocked → 422 or 413. * APP credentials unset in env → 503. * Meta network / non-2xx → 502.

Media type multipart/form-data
Body_upload_header_media_platform_v1_templates_header_media_post
object
file
Any of:
string
mime_type
Any of:
string

Successful Response

Media type application/json
PlatformTemplateHeaderMediaUrlResponse

Response — returns ONLY the Meta-side header_handle. NEVER echoes the APP token, the URL, or any internal state.

object
header_handle
required
Header Handle
string
Example generated
{
"header_handle": "example"
}

Validation Error

Media type application/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
ctx
Context
object
input
Input
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Example generated
{
"detail": [
{
"ctx": {},
"input": "example",
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
]
}