Meta will not review an IMAGE, VIDEO or DOCUMENT header without an EXAMPLE of the media it will carry, so a media-header template cannot be created until you have one of these handles. Upload the sample here, then put the returned handle into the header component as example.header_handle: ["<handle>"] when you call POST /v1/templates. Creating a media header without it is 400, not a Meta error.
Two transports, pick one.
JSON { "format": "DOCUMENT", "source_url": "https://..." } — Paige downloads it. Only public http(s) URLs: private, loopback and link-local addresses are refused and redirects are re-checked at every hop. Add filename / mime to override what the remote server declares.
JSON { "format": "IMAGE", "data": "<base64>", "filename": "...", "mime": "..." } — inline bytes, capped at 5 MB decoded, lower than the per-format ceilings because the body is buffered whole in memory. A data: URI prefix is accepted and stripped.
Size and type are per FORMAT. IMAGE takes image/jpeg or image/png up to 5 MB; VIDEO takes video/mp4 or video/3gpp up to 16 MB; DOCUMENT takes PDF, Word, Excel, PowerPoint or plain text up to 100 MB. Oversize is 413 file_too_large and a type WhatsApp will not take is 415.
The declared mime type is not trusted. The bytes are checked against their own signature, and a file whose contents disagree with its mime is 415 — sending a video as image/png to slip past the image size cap does not work.
A handle is not a media id.media_id from POST /v1/media addresses a file Meta can SEND and is useless as a header_handle; the reverse is also true. The handle is short-lived and single-purpose: get one, create the template with it, and do not store it.
Uploads are metered by BYTES as well as by request count, against the same per-key budget POST /v1/media charges. A burst of large samples can therefore return 429 rate_limited even while you are inside the request-per-minute budget — retry after the window. A source_url download is also aborted mid-stream once it passes that budget, so a sample bigger than a whole minute of it can never be fetched.
Project API key issued in Settings → API keys. Send it as Authorization: Bearer pk_live_….
Headers
X-Paige-Project
string
Target project id, for an MCP OAuth bearer (mcp_at_…) attached to more than one project — get ids from GET /v1/projects. Matched case-insensitively.
Omit it and a READ falls back to the connection's default project; a mutation (any non-GET) on a connection with 2+ projects is rejected with 400 project_required — a write is never defaulted to a guessed project. A connection with exactly one project never needs the header.
Scopes are checked against the SELECTED project only, never a union across the connection.
For a pk_ API key the header selects nothing — one key is one project's context — but it IS validated: omit it and the key's own project is used, send it and it must name that project, otherwise the call is rejected with 403 project_not_attached (a blank value is 400 invalid_project_header, as above).
Body
application/json
Option 1
Option 2
format
enum<string>
required
The header format this sample is for. IMAGE takes JPEG/PNG up to 5 MB, VIDEO takes MP4/3GP up to 16 MB, DOCUMENT takes PDF/Office/plain text up to 100 MB. The declared type is checked against the file own magic bytes, so a mislabelled file is refused here rather than forwarded to Meta.
Available options:
IMAGE,
VIDEO,
DOCUMENT
source_url
string<uri>
required
Public http(s) URL Paige downloads the sample from. Private, loopback and link-local addresses are refused and redirects are re-checked at every hop. The download is aborted mid-stream at the smaller of this format ceiling and the API key remaining per-minute upload byte budget, so a sample larger than that budget can never be fetched.
filename
string
Overrides the filename derived from the URL.
Required string length: 1 - 255
mime
string
Overrides the Content-Type the remote server declares. Use it when the host serves the file as application/octet-stream.
Required string length: 1 - 255
Response
Success.
success
enum<boolean>
required
Available options:
true
data
object
required
Hide child attributes
data.handle
string
required
Meta's opaque upload handle. Goes straight into the HEADER component as example.header_handle: [handle].
data.format
string
required
IMAGE | VIDEO | DOCUMENT — the format the sample was validated against.
data.filename
string
required
data.mime_type
string
required
The mime type Paige verified against the bytes, not necessarily the one you declared.
data.size
number
required
Decoded size in bytes.
Was this page helpful?
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"paige","description":"Build AI-powered WhatsApp bots with interactive flows, automated conversations, and a built-in database — no backend required.","colors":{"primary":"#81D741","light":"#cfeabb","dark":"#81D741"},"logo":{"light":"https://mintcdn.com/greenpages/SGZewfX5ti1H1LmZ/logo/green-pages-logo.png?fit=max\u0026auto=format\u0026n=SGZewfX5ti1H1LmZ\u0026q=85\u0026s=9b5fbf18d11676f6513a94ed3366cb7f","dark":"https://mintcdn.com/greenpages/SGZewfX5ti1H1LmZ/logo/green-pages-logo.png?fit=max\u0026auto=format\u0026n=SGZewfX5ti1H1LmZ\u0026q=85\u0026s=9b5fbf18d11676f6513a94ed3366cb7f"},"favicon":"https://mintcdn.com/greenpages/ns32KHaAM2ByMLCm/favicon.ico?fit=max\u0026auto=format\u0026n=ns32KHaAM2ByMLCm\u0026q=85\u0026s=10f80cc37fcecd5ef561ba85c6bca8d6","api":{"params":{"expanded":"all"},"playground":{"display":"simple"},"examples":{"languages":["curl","javascript","python"]}},"navbar":{"links":[],"primary":{"type":"button","label":"Start Building","href":"https://paigeme.dev"}},"footer":{"socials":{}},"fonts":{"family":"Geist"},"icons":{"library":"lucide"},"styling":{"eyebrows":"breadcrumbs","latex":true},"contextual":{"options":["copy","view","assistant","download-spec"],"display":"header"},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"greenpages","hasAudioNarration":false,"actualSubdomain":"greenpages","customDomains":["howto.paigeme.dev"],"gitSource":{"type":"github","owner":"brendangp","repo":"paige-docs","deployBranch":"main","isPrivate":false,"contentDirectory":"","mountPath":"","label":""},"feedback":{"thumbs":true},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6b007c142f71afcbab8c3194","clientVersion":"0.0.4340","searchFilterCounts":[{"language":"default","tag":"API","count":57},{"language":"default","tag":"Endpoints","count":49},{"language":"default","tag":"Features","count":42},{"language":"default","tag":"Settings","count":12},{"language":"default","tag":"Learn","count":10},{"language":"default","tag":"Build","count":10},{"language":"default","tag":"Introduction","count":9},{"language":"default","tag":"Getting started","count":8},{"language":"default","tag":"Broadcasts","count":8},{"language":"default","tag":"Tools","count":8}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":true},"customCss":[{"filePath":"style.css","content":"/* cyrillic-ext */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFrodmgPn.woff2) format('woff2');\n unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;\n}\n/* cyrillic */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFrMdmgPn.woff2) format('woff2');\n unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;\n}\n/* symbols2 */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFg08vz7ehw.woff2) format('woff2');\n unicode-range: U+2000-2001, U+2004-2008, U+200A, U+23B8-23BD, U+2500-259F;\n}\n/* vietnamese */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFrgdmgPn.woff2) format('woff2');\n unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;\n}\n/* latin-ext */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFrkdmgPn.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFrcdmg.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n/* cyrillic-ext */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFrodmgPn.woff2) format('woff2');\n unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;\n}\n/* cyrillic */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFrMdmgPn.woff2) format('woff2');\n unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;\n}\n/* symbols2 */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFg08vz7ehw.woff2) format('woff2');\n unicode-range: U+2000-2001, U+2004-2008, U+200A, U+23B8-23BD, U+2500-259F;\n}\n/* vietnamese */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFrgdmgPn.woff2) format('woff2');\n unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;\n}\n/* latin-ext */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFrkdmgPn.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFrcdmg.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n/* cyrillic-ext */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 600;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFrodmgPn.woff2) format('woff2');\n unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;\n}\n/* cyrillic */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 600;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFrMdmgPn.woff2) format('woff2');\n unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;\n}\n/* symbols2 */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 600;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFg08vz7ehw.woff2) format('woff2');\n unicode-range: U+2000-2001, U+2004-2008, U+200A, U+23B8-23BD, U+2500-259F;\n}\n/* vietnamese */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 600;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFrgdmgPn.woff2) format('woff2');\n unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;\n}\n/* latin-ext */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 600;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFrkdmgPn.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 600;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFrcdmg.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n:root{--default-border-color: var(--gray-200)}.dark{--default-border-color: var(--gray-800)}#navbar a[href=\"/\"]:has(img.nav-logo){display:inline-flex!important;align-items:center}#navbar a[href=\"/\"]:has(img.nav-logo)::after{content:'paige';font-family:'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;color:#81D741;font-weight:500;font-size:1rem;letter-spacing:-0.01em;margin-left:0.5rem}#sidebar .nav-dropdown-trigger{border:none!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;padding-left:0.375rem}#sidebar .nav-dropdown-trigger:hover{background-color:rgb(0 0 0 / 0.04)!important}.dark #sidebar .nav-dropdown-trigger:hover{background-color:rgb(255 255 255 / 0.06)!important}#sidebar .nav-dropdown-trigger .nav-dropdown-item-icon{border:none!important;border-radius:0!important;background:transparent!important;height:auto!important;width:auto!important;padding:0!important}.nav-dropdown-content{border-radius:0!important}.nav-dropdown-content .nav-dropdown-item{border-radius:0!important}.nav-dropdown-content .nav-dropdown-item-icon{border:none!important;border-radius:0!important;background:transparent!important;height:auto!important;width:auto!important;padding:0!important}.nav-dropdown-content .nav-dropdown-item-description{display:none!important}#sidebar .nav-anchor span{font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;font-size:12px;font-weight:500;letter-spacing:-0.02em;text-transform:uppercase}"}]}
{"page":{"pagePath":"api-reference/endpoints/templates/upload-the-sample-file-a-media-header-needs","slug":"/api-reference/endpoints/templates/upload-the-sample-file-a-media-header-needs","pageMetadata":{"title":"Upload the sample file a media header needs","description":"Meta will not review an IMAGE, VIDEO or DOCUMENT header without an EXAMPLE of the media it will carry, so a media-header template cannot be created until you have one of these handles. Upload the sample here, then put the returned `handle` into the header component as `example.header_handle: [\"\u003chandle>\"]` when you call `POST /v1/templates`. Creating a media header without it is `400`, not a Meta error.\n\n**Two transports, pick one.**\n\n- JSON `{ \"format\": \"DOCUMENT\", \"source_url\": \"https://...\" }` — Paige downloads it. Only public http(s) URLs: private, loopback and link-local addresses are refused and redirects are re-checked at every hop. Add `filename` / `mime` to override what the remote server declares.\n- JSON `{ \"format\": \"IMAGE\", \"data\": \"\u003cbase64>\", \"filename\": \"...\", \"mime\": \"...\" }` — inline bytes, capped at **5 MB decoded**, lower than the per-format ceilings because the body is buffered whole in memory. A `data:` URI prefix is accepted and stripped.\n\n**Size and type are per FORMAT.** IMAGE takes `image/jpeg` or `image/png` up to 5 MB; VIDEO takes `video/mp4` or `video/3gpp` up to 16 MB; DOCUMENT takes PDF, Word, Excel, PowerPoint or plain text up to 100 MB. Oversize is `413 file_too_large` and a type WhatsApp will not take is `415`.\n\n**The declared mime type is not trusted.** The bytes are checked against their own signature, and a file whose contents disagree with its `mime` is `415` — sending a video as `image/png` to slip past the image size cap does not work.\n\n**A handle is not a media id.** `media_id` from `POST /v1/media` addresses a file Meta can SEND and is useless as a `header_handle`; the reverse is also true. The handle is short-lived and single-purpose: get one, create the template with it, and do not store it.\n\n**Uploads are metered by BYTES as well as by request count**, against the same per-key budget `POST /v1/media` charges. A burst of large samples can therefore return `429 rate_limited` even while you are inside the request-per-minute budget — retry after the window. A `source_url` download is also aborted mid-stream once it passes that budget, so a sample bigger than a whole minute of it can never be fetched.\n\n**Required scope:** `templates:manage`","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /v1/templates/header-sample","href":"/api-reference/endpoints/templates/upload-the-sample-file-a-media-header-needs","autogeneratedByOpenApi":true},"description":{"compiledSource":"\"use strict\";\nconst {Fragment: _Fragment, jsx: _jsx, jsxs: _jsxs} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n code: \"code\",\n li: \"li\",\n p: \"p\",\n strong: \"strong\",\n ul: \"ul\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_Fragment, {\n children: [_jsxs(_components.p, {\n children: [\"Meta will not review an IMAGE, VIDEO or DOCUMENT header without an EXAMPLE of the media it will carry, so a media-header template cannot be created until you have one of these handles. Upload the sample here, then put the returned \", _jsx(_components.code, {\n children: \"handle\"\n }), \" into the header component as \", _jsx(_components.code, {\n children: \"example.header_handle: [\\\"\u003chandle>\\\"]\"\n }), \" when you call \", _jsx(_components.code, {\n children: \"POST /v1/templates\"\n }), \". Creating a media header without it is \", _jsx(_components.code, {\n children: \"400\"\n }), \", not a Meta error.\"]\n }), \"\\n\", _jsx(_components.p, {\n children: _jsx(_components.strong, {\n children: \"Two transports, pick one.\"\n })\n }), \"\\n\", _jsxs(_components.ul, {\n children: [\"\\n\", _jsxs(_components.li, {\n children: [\"JSON \", _jsx(_components.code, {\n children: \"{ \\\"format\\\": \\\"DOCUMENT\\\", \\\"source_url\\\": \\\"https://...\\\" }\"\n }), \" — Paige downloads it. Only public http(s) URLs: private, loopback and link-local addresses are refused and redirects are re-checked at every hop. Add \", _jsx(_components.code, {\n children: \"filename\"\n }), \" / \", _jsx(_components.code, {\n children: \"mime\"\n }), \" to override what the remote server declares.\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [\"JSON \", _jsx(_components.code, {\n children: \"{ \\\"format\\\": \\\"IMAGE\\\", \\\"data\\\": \\\"\u003cbase64>\\\", \\\"filename\\\": \\\"...\\\", \\\"mime\\\": \\\"...\\\" }\"\n }), \" — inline bytes, capped at \", _jsx(_components.strong, {\n children: \"5 MB decoded\"\n }), \", lower than the per-format ceilings because the body is buffered whole in memory. A \", _jsx(_components.code, {\n children: \"data:\"\n }), \" URI prefix is accepted and stripped.\"]\n }), \"\\n\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [_jsx(_components.strong, {\n children: \"Size and type are per FORMAT.\"\n }), \" IMAGE takes \", _jsx(_components.code, {\n children: \"image/jpeg\"\n }), \" or \", _jsx(_components.code, {\n children: \"image/png\"\n }), \" up to 5 MB; VIDEO takes \", _jsx(_components.code, {\n children: \"video/mp4\"\n }), \" or \", _jsx(_components.code, {\n children: \"video/3gpp\"\n }), \" up to 16 MB; DOCUMENT takes PDF, Word, Excel, PowerPoint or plain text up to 100 MB. Oversize is \", _jsx(_components.code, {\n children: \"413 file_too_large\"\n }), \" and a type WhatsApp will not take is \", _jsx(_components.code, {\n children: \"415\"\n }), \".\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [_jsx(_components.strong, {\n children: \"The declared mime type is not trusted.\"\n }), \" The bytes are checked against their own signature, and a file whose contents disagree with its \", _jsx(_components.code, {\n children: \"mime\"\n }), \" is \", _jsx(_components.code, {\n children: \"415\"\n }), \" — sending a video as \", _jsx(_components.code, {\n children: \"image/png\"\n }), \" to slip past the image size cap does not work.\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [_jsx(_components.strong, {\n children: \"A handle is not a media id.\"\n }), \" \", _jsx(_components.code, {\n children: \"media_id\"\n }), \" from \", _jsx(_components.code, {\n children: \"POST /v1/media\"\n }), \" addresses a file Meta can SEND and is useless as a \", _jsx(_components.code, {\n children: \"header_handle\"\n }), \"; the reverse is also true. The handle is short-lived and single-purpose: get one, create the template with it, and do not store it.\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [_jsx(_components.strong, {\n children: \"Uploads are metered by BYTES as well as by request count\"\n }), \", against the same per-key budget \", _jsx(_components.code, {\n children: \"POST /v1/media\"\n }), \" charges. A burst of large samples can therefore return \", _jsx(_components.code, {\n children: \"429 rate_limited\"\n }), \" even while you are inside the request-per-minute budget — retry after the window. A \", _jsx(_components.code, {\n children: \"source_url\"\n }), \" download is also aborted mid-stream once it passes that budget, so a sample bigger than a whole minute of it can never be fetched.\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [_jsx(_components.strong, {\n children: \"Required scope:\"\n }), \" \", _jsx(_components.code, {\n children: \"templates:manage\"\n })]\n })]\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){return _jsx(_Fragment,{})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Upload the sample file a media header needs","description":"Meta will not review an IMAGE, VIDEO or DOCUMENT header without an EXAMPLE of the media it will carry, so a media-header template cannot be created until you have one of these handles. Upload the sample here, then put the returned `handle` into the header component as `example.header_handle: [\"\u003chandle>\"]` when you call `POST /v1/templates`. Creating a media header without it is `400`, not a Meta error.\n\n**Two transports, pick one.**\n\n- JSON `{ \"format\": \"DOCUMENT\", \"source_url\": \"https://...\" }` — Paige downloads it. Only public http(s) URLs: private, loopback and link-local addresses are refused and redirects are re-checked at every hop. Add `filename` / `mime` to override what the remote server declares.\n- JSON `{ \"format\": \"IMAGE\", \"data\": \"\u003cbase64>\", \"filename\": \"...\", \"mime\": \"...\" }` — inline bytes, capped at **5 MB decoded**, lower than the per-format ceilings because the body is buffered whole in memory. A `data:` URI prefix is accepted and stripped.\n\n**Size and type are per FORMAT.** IMAGE takes `image/jpeg` or `image/png` up to 5 MB; VIDEO takes `video/mp4` or `video/3gpp` up to 16 MB; DOCUMENT takes PDF, Word, Excel, PowerPoint or plain text up to 100 MB. Oversize is `413 file_too_large` and a type WhatsApp will not take is `415`.\n\n**The declared mime type is not trusted.** The bytes are checked against their own signature, and a file whose contents disagree with its `mime` is `415` — sending a video as `image/png` to slip past the image size cap does not work.\n\n**A handle is not a media id.** `media_id` from `POST /v1/media` addresses a file Meta can SEND and is useless as a `header_handle`; the reverse is also true. The handle is short-lived and single-purpose: get one, create the template with it, and do not store it.\n\n**Uploads are metered by BYTES as well as by request count**, against the same per-key budget `POST /v1/media` charges. A burst of large samples can therefore return `429 rate_limited` even while you are inside the request-per-minute budget — retry after the window. A `source_url` download is also aborted mid-stream once it passes that budget, so a sample bigger than a whole minute of it can never be fetched.\n\n**Required scope:** `templates:manage`","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /v1/templates/header-sample","href":"/api-reference/endpoints/templates/upload-the-sample-file-a-media-header-needs","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"operationId":"uploadTemplateHeaderSample","tags":["Templates"],"summary":"Upload the sample file a media header needs","description":"Meta will not review an IMAGE, VIDEO or DOCUMENT header without an EXAMPLE of the media it will carry, so a media-header template cannot be created until you have one of these handles. Upload the sample here, then put the returned `handle` into the header component as `example.header_handle: [\"\u003chandle>\"]` when you call `POST /v1/templates`. Creating a media header without it is `400`, not a Meta error.\n\n**Two transports, pick one.**\n\n- JSON `{ \"format\": \"DOCUMENT\", \"source_url\": \"https://...\" }` — Paige downloads it. Only public http(s) URLs: private, loopback and link-local addresses are refused and redirects are re-checked at every hop. Add `filename` / `mime` to override what the remote server declares.\n- JSON `{ \"format\": \"IMAGE\", \"data\": \"\u003cbase64>\", \"filename\": \"...\", \"mime\": \"...\" }` — inline bytes, capped at **5 MB decoded**, lower than the per-format ceilings because the body is buffered whole in memory. A `data:` URI prefix is accepted and stripped.\n\n**Size and type are per FORMAT.** IMAGE takes `image/jpeg` or `image/png` up to 5 MB; VIDEO takes `video/mp4` or `video/3gpp` up to 16 MB; DOCUMENT takes PDF, Word, Excel, PowerPoint or plain text up to 100 MB. Oversize is `413 file_too_large` and a type WhatsApp will not take is `415`.\n\n**The declared mime type is not trusted.** The bytes are checked against their own signature, and a file whose contents disagree with its `mime` is `415` — sending a video as `image/png` to slip past the image size cap does not work.\n\n**A handle is not a media id.** `media_id` from `POST /v1/media` addresses a file Meta can SEND and is useless as a `header_handle`; the reverse is also true. The handle is short-lived and single-purpose: get one, create the template with it, and do not store it.\n\n**Uploads are metered by BYTES as well as by request count**, against the same per-key budget `POST /v1/media` charges. A burst of large samples can therefore return `429 rate_limited` even while you are inside the request-per-minute budget — retry after the window. A `source_url` download is also aborted mid-stream once it passes that budget, so a sample bigger than a whole minute of it can never be fetched.\n\n**Required scope:** `templates:manage`","security":["ba39c532-5ee0-4a68-8c52-cd7b3ca30356"],"x-required-scopes":["templates:manage"],"parameters":["98b1df73-b79c-42e1-85e6-2bbf34d6ed88"],"requestBody":"18983e28-185b-4131-93bf-c6bff3f4bced","responses":{"201":"72fdf30b-f26c-4ca3-91cc-bf6d8118d100","400":"20b0d8d5-5994-4275-b68a-771a53d85795","401":"d988283c-4be1-402c-a8cb-31d3789472f1","403":"1c88784e-5fbe-47c7-b354-5d1e3d8fbe57","404":"716e26bd-99ce-448d-b0b8-aebefc058bfc","413":"67e4b83b-9585-4eb6-ba98-1a12caaaa7f7","415":"27bf8118-6400-4df0-af87-01a6a9f2bda9","429":"e9206a58-4123-4bde-8558-91b145d3df2b","500":"711c6e3e-48bb-419e-9964-82eba42f4d52","502":"e63742d0-4b17-4e33-9fde-2934e99b10ea"},"method":"post","type":"path","servers":["2f61f958-73d8-4f9e-a417-8b9b7e2662ed"],"path":"/v1/templates/header-sample","baseUrlOptions":["https://api.paigeme.dev"],"title":"Upload the sample file a media header needs","codeSamples":[],"requestExampleLanguages":["bash","javascript","python"],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{"98b1df73-b79c-42e1-85e6-2bbf34d6ed88":{"schema":{"type":"string","description":"Target project id, for an MCP OAuth bearer (`mcp_at_…`) attached to more than one project — get ids from `GET /v1/projects`. Matched case-insensitively.\n\nOmit it and a READ falls back to the connection's default project; a **mutation** (any non-GET) on a connection with 2+ projects is rejected with `400 project_required` — a write is never defaulted to a guessed project. A connection with exactly one project never needs the header.\n\nScopes are checked against the SELECTED project only, never a union across the connection.\n\nFor a `pk_` API key the header selects nothing — one key is one project's context — but it IS validated: omit it and the key's own project is used, send it and it must name that project, otherwise the call is rejected with `403 project_not_attached` (a blank value is `400 invalid_project_header`, as above).","isRequired":false,"uniqueKey":"","typeLabel":"string"},"required":false,"name":"X-Paige-Project","in":"header"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","required":["format","source_url"],"properties":{"format":{"type":"string","enum":["IMAGE","VIDEO","DOCUMENT"],"description":"The header format this sample is for. IMAGE takes JPEG/PNG up to 5 MB, VIDEO takes MP4/3GP up to 16 MB, DOCUMENT takes PDF/Office/plain text up to 100 MB. The declared type is checked against the file own magic bytes, so a mislabelled file is refused here rather than forwarded to Meta.","isRequired":true,"uniqueKey":"oneOf.0.format","typeLabel":"enum\u003cstring>"},"source_url":{"type":"string","format":"uri","description":"Public http(s) URL Paige downloads the sample from. Private, loopback and link-local addresses are refused and redirects are re-checked at every hop. The download is aborted mid-stream at the smaller of this format ceiling and the API key remaining per-minute upload byte budget, so a sample larger than that budget can never be fetched.","isRequired":true,"uniqueKey":"oneOf.0.source_url","typeLabel":"string\u003curi>"},"filename":{"type":"string","minLength":1,"maxLength":255,"description":"Overrides the filename derived from the URL.","uniqueKey":"oneOf.0.filename","typeLabel":"string"},"mime":{"type":"string","minLength":1,"maxLength":255,"description":"Overrides the Content-Type the remote server declares. Use it when the host serves the file as application/octet-stream.","uniqueKey":"oneOf.0.mime","typeLabel":"string"}},"additionalProperties":false,"uniqueKey":"oneOf.0","typeLabel":"object"},{"type":"object","required":["format","data","filename","mime"],"properties":{"format":{"type":"string","enum":["IMAGE","VIDEO","DOCUMENT"],"description":"The header format this sample is for. IMAGE takes JPEG/PNG up to 5 MB, VIDEO takes MP4/3GP up to 16 MB, DOCUMENT takes PDF/Office/plain text up to 100 MB. The declared type is checked against the file own magic bytes, so a mislabelled file is refused here rather than forwarded to Meta.","isRequired":true,"uniqueKey":"oneOf.1.format","typeLabel":"enum\u003cstring>"},"data":{"type":"string","minLength":1,"description":"The sample bytes, base64-encoded. Plain base64 or a data: URI. Capped at 5 MB DECODED, lower than the per-format ceilings because the whole body is buffered in memory. Use source_url for anything larger.","isRequired":true,"uniqueKey":"oneOf.1.data","typeLabel":"string"},"filename":{"type":"string","minLength":1,"maxLength":255,"description":"Original filename, including its extension.","isRequired":true,"uniqueKey":"oneOf.1.filename","typeLabel":"string"},"mime":{"type":"string","minLength":1,"maxLength":255,"description":"The sample mime type, e.g. image/png. Must be one WhatsApp accepts for this header format.","isRequired":true,"uniqueKey":"oneOf.1.mime","typeLabel":"string"}},"additionalProperties":false,"uniqueKey":"oneOf.1","typeLabel":"object"}],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"source_url":"\u003cstring>","filename":"\u003cstring>","mime":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"responses":{"72fdf30b-f26c-4ca3-91cc-bf6d8118d100":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"isRequired":true,"uniqueKey":"success","typeLabel":"enum\u003cboolean>"},"data":{"type":"object","properties":{"handle":{"type":"string","description":"Meta's opaque upload handle. Goes straight into the HEADER component as `example.header_handle: [handle]`.","isRequired":true,"uniqueKey":"data.handle","typeLabel":"string"},"format":{"type":"string","description":"IMAGE | VIDEO | DOCUMENT — the format the sample was validated against.","isRequired":true,"uniqueKey":"data.format","typeLabel":"string"},"filename":{"type":"string","isRequired":true,"uniqueKey":"data.filename","typeLabel":"string"},"mime_type":{"type":"string","description":"The mime type Paige verified against the bytes, not necessarily the one you declared.","isRequired":true,"uniqueKey":"data.mime_type","typeLabel":"string"},"size":{"type":"number","description":"Decoded size in bytes.","isRequired":true,"uniqueKey":"data.size","typeLabel":"number"}},"required":["handle","format","filename","mime_type","size"],"isRequired":true,"uniqueKey":"data","typeLabel":"object"}},"required":["success","data"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"success":true,"data":{"handle":"\u003cstring>","format":"\u003cstring>","filename":"\u003cstring>","mime_type":"\u003cstring>","size":123}}}},"exampleType":"generated"}},"exampleType":"generated"},"20b0d8d5-5994-4275-b68a-771a53d85795":{"description":"Validation / bad request (e.g. `invalid_request`, `invalid_cursor`, `invalid_template` for a Meta 4xx rejection of a template payload, which carries Meta's own detail as the message; note `outside_24h_window` is 409, not 400). Also `invalid_project_header` (any credential: `X-Paige-Project` was sent but blank) and, for multi-project MCP bearers, `project_required` (a mutation, or a read with no default, and no `X-Paige-Project`).","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false],"isRequired":true,"uniqueKey":"success","typeLabel":"enum\u003cboolean>"},"error":{"type":"object","properties":{"code":{"type":"string","description":"Stable, machine-readable error code.","example":"invalid_request","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","description":"Human-readable message (safe to surface).","example":"Invalid request body","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"details":{"type":"object","properties":{},"description":"Structured extras for codes that carry them — the keys depend on `code`. `quota_exceeded` carries `limit` + `resetAt`; most errors omit this field entirely.","uniqueKey":"error.details","typeLabel":"object"}},"required":["code","message"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"},"request_id":{"type":"string","description":"Per-request id, also returned as the X-Request-Id header.","isRequired":true,"uniqueKey":"request_id","typeLabel":"string"}},"required":["success","error","request_id"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"success":false,"error":{"code":"invalid_request","message":"Invalid request body","details":{}},"request_id":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"d988283c-4be1-402c-a8cb-31d3789472f1":{"description":"Missing or invalid API key (`api_key_required` / `invalid_api_key` / `invalid_token` for a revoked or expired OAuth bearer).","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false],"isRequired":true,"uniqueKey":"success","typeLabel":"enum\u003cboolean>"},"error":{"type":"object","properties":{"code":{"type":"string","description":"Stable, machine-readable error code.","example":"invalid_request","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","description":"Human-readable message (safe to surface).","example":"Invalid request body","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"details":{"type":"object","properties":{},"description":"Structured extras for codes that carry them — the keys depend on `code`. `quota_exceeded` carries `limit` + `resetAt`; most errors omit this field entirely.","uniqueKey":"error.details","typeLabel":"object"}},"required":["code","message"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"},"request_id":{"type":"string","description":"Per-request id, also returned as the X-Request-Id header.","isRequired":true,"uniqueKey":"request_id","typeLabel":"string"}},"required":["success","error","request_id"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"success":false,"error":{"code":"invalid_request","message":"Invalid request body","details":{}},"request_id":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"1c88784e-5fbe-47c7-b354-5d1e3d8fbe57":{"description":"Key lacks the required scope, project inactive, or a write targets a platform-protected file (`insufficient_scope` / `project_inactive` / `subscription_inactive` / `protected_file`). Also `project_not_attached` (the `X-Paige-Project` project is not one this credential may act on — not attached to the MCP connection, or not the `pk_` key's own project; identical response whether or not it exists) and, for MCP bearers, `no_project_access` (the connection has no projects attached).","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false],"isRequired":true,"uniqueKey":"success","typeLabel":"enum\u003cboolean>"},"error":{"type":"object","properties":{"code":{"type":"string","description":"Stable, machine-readable error code.","example":"invalid_request","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","description":"Human-readable message (safe to surface).","example":"Invalid request body","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"details":{"type":"object","properties":{},"description":"Structured extras for codes that carry them — the keys depend on `code`. `quota_exceeded` carries `limit` + `resetAt`; most errors omit this field entirely.","uniqueKey":"error.details","typeLabel":"object"}},"required":["code","message"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"},"request_id":{"type":"string","description":"Per-request id, also returned as the X-Request-Id header.","isRequired":true,"uniqueKey":"request_id","typeLabel":"string"}},"required":["success","error","request_id"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"success":false,"error":{"code":"invalid_request","message":"Invalid request body","details":{}},"request_id":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"716e26bd-99ce-448d-b0b8-aebefc058bfc":{"description":"Resource not found (`not_found` / `*_not_found`).","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false],"isRequired":true,"uniqueKey":"success","typeLabel":"enum\u003cboolean>"},"error":{"type":"object","properties":{"code":{"type":"string","description":"Stable, machine-readable error code.","example":"invalid_request","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","description":"Human-readable message (safe to surface).","example":"Invalid request body","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"details":{"type":"object","properties":{},"description":"Structured extras for codes that carry them — the keys depend on `code`. `quota_exceeded` carries `limit` + `resetAt`; most errors omit this field entirely.","uniqueKey":"error.details","typeLabel":"object"}},"required":["code","message"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"},"request_id":{"type":"string","description":"Per-request id, also returned as the X-Request-Id header.","isRequired":true,"uniqueKey":"request_id","typeLabel":"string"}},"required":["success","error","request_id"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"success":false,"error":{"code":"invalid_request","message":"Invalid request body","details":{}},"request_id":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"67e4b83b-9585-4eb6-ba98-1a12caaaa7f7":{"description":"Error.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false],"isRequired":true,"uniqueKey":"success","typeLabel":"enum\u003cboolean>"},"error":{"type":"object","properties":{"code":{"type":"string","description":"Stable, machine-readable error code.","example":"invalid_request","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","description":"Human-readable message (safe to surface).","example":"Invalid request body","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"details":{"type":"object","properties":{},"description":"Structured extras for codes that carry them — the keys depend on `code`. `quota_exceeded` carries `limit` + `resetAt`; most errors omit this field entirely.","uniqueKey":"error.details","typeLabel":"object"}},"required":["code","message"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"},"request_id":{"type":"string","description":"Per-request id, also returned as the X-Request-Id header.","isRequired":true,"uniqueKey":"request_id","typeLabel":"string"}},"required":["success","error","request_id"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"success":false,"error":{"code":"invalid_request","message":"Invalid request body","details":{}},"request_id":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"27bf8118-6400-4df0-af87-01a6a9f2bda9":{"description":"Error.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false],"isRequired":true,"uniqueKey":"success","typeLabel":"enum\u003cboolean>"},"error":{"type":"object","properties":{"code":{"type":"string","description":"Stable, machine-readable error code.","example":"invalid_request","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","description":"Human-readable message (safe to surface).","example":"Invalid request body","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"details":{"type":"object","properties":{},"description":"Structured extras for codes that carry them — the keys depend on `code`. `quota_exceeded` carries `limit` + `resetAt`; most errors omit this field entirely.","uniqueKey":"error.details","typeLabel":"object"}},"required":["code","message"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"},"request_id":{"type":"string","description":"Per-request id, also returned as the X-Request-Id header.","isRequired":true,"uniqueKey":"request_id","typeLabel":"string"}},"required":["success","error","request_id"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"success":false,"error":{"code":"invalid_request","message":"Invalid request body","details":{}},"request_id":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"e9206a58-4123-4bde-8558-91b145d3df2b":{"description":"Rate limit (`rate_limited`) or daily send quota (`quota_exceeded`) exceeded. Carries `RateLimit-*` + `Retry-After` headers.","headers":{"RateLimit-Limit":{"description":"Requests permitted in the current window.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests remaining in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the window resets.","schema":{"type":"integer"}},"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false],"isRequired":true,"uniqueKey":"success","typeLabel":"enum\u003cboolean>"},"error":{"type":"object","properties":{"code":{"type":"string","description":"Stable, machine-readable error code.","example":"invalid_request","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","description":"Human-readable message (safe to surface).","example":"Invalid request body","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"details":{"type":"object","properties":{},"description":"Structured extras for codes that carry them — the keys depend on `code`. `quota_exceeded` carries `limit` + `resetAt`; most errors omit this field entirely.","uniqueKey":"error.details","typeLabel":"object"}},"required":["code","message"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"},"request_id":{"type":"string","description":"Per-request id, also returned as the X-Request-Id header.","isRequired":true,"uniqueKey":"request_id","typeLabel":"string"}},"required":["success","error","request_id"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"success":false,"error":{"code":"invalid_request","message":"Invalid request body","details":{}},"request_id":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"711c6e3e-48bb-419e-9964-82eba42f4d52":{"description":"Unexpected server error (`server_error`).","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false],"isRequired":true,"uniqueKey":"success","typeLabel":"enum\u003cboolean>"},"error":{"type":"object","properties":{"code":{"type":"string","description":"Stable, machine-readable error code.","example":"invalid_request","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","description":"Human-readable message (safe to surface).","example":"Invalid request body","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"details":{"type":"object","properties":{},"description":"Structured extras for codes that carry them — the keys depend on `code`. `quota_exceeded` carries `limit` + `resetAt`; most errors omit this field entirely.","uniqueKey":"error.details","typeLabel":"object"}},"required":["code","message"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"},"request_id":{"type":"string","description":"Per-request id, also returned as the X-Request-Id header.","isRequired":true,"uniqueKey":"request_id","typeLabel":"string"}},"required":["success","error","request_id"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"success":false,"error":{"code":"invalid_request","message":"Invalid request body","details":{}},"request_id":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"e63742d0-4b17-4e33-9fde-2934e99b10ea":{"description":"Upstream failure — a Meta credentials rejection (`meta_auth_error`) or a failed/truncated agent run on the build + flow endpoints (`build_failed`).","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false],"isRequired":true,"uniqueKey":"success","typeLabel":"enum\u003cboolean>"},"error":{"type":"object","properties":{"code":{"type":"string","description":"Stable, machine-readable error code.","example":"invalid_request","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","description":"Human-readable message (safe to surface).","example":"Invalid request body","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"details":{"type":"object","properties":{},"description":"Structured extras for codes that carry them — the keys depend on `code`. `quota_exceeded` carries `limit` + `resetAt`; most errors omit this field entirely.","uniqueKey":"error.details","typeLabel":"object"}},"required":["code","message"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"},"request_id":{"type":"string","description":"Per-request id, also returned as the X-Request-Id header.","isRequired":true,"uniqueKey":"request_id","typeLabel":"string"}},"required":["success","error","request_id"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"success":false,"error":{"code":"invalid_request","message":"Invalid request body","details":{}},"request_id":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"ba39c532-5ee0-4a68-8c52-cd7b3ca30356":{"ApiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"Project API key issued in Settings → API keys. Send it as `Authorization: Bearer pk_live_…`.","scopes":[],"schemeName":"ApiKeyAuth"}}},"servers":{"2f61f958-73d8-4f9e-a417-8b9b7e2662ed":{"url":"https://api.paigeme.dev","description":"Production"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"Project API key issued in Settings → API keys. Send it as `Authorization: Bearer pk_live_…`.","scopes":[],"schemeName":"ApiKeyAuth"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"Project API key issued in Settings → API keys. Send it as `Authorization: Bearer pk_live_…`.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"ApiKeyAuth","name":"Authorization"}],"title":"ApiKeyAuth"}]},"originalFileLocation":"api-reference/openapi.json"},"subdomain":"greenpages","siteName":"paige","title":"Upload the sample file a media header needs - paige","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-20T16:58:04.953Z","originalFileLocation":"api-reference/endpoints/templates/upload-the-sample-file-a-media-header-needs.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Meta will not review an IMAGE, VIDEO or DOCUMENT header without an EXAMPLE of the media it will carry, so a media-header template cannot be created until you have one of these handles. Upload the sample here, then put the returned handle into the header component as example.header_handle: [\u0026quot;\u0026quot;] when you call POST /v1/templates. Creating a media header without it is 400, not a Meta error. Two transports, pick one. - JSON { \u0026quot;format\u0026quot;: \u0026quot;DOCUMENT\u0026quot;, \u0026quot;source_url\u0026quot;: \u0026quot;https://...\u0026quot; } — Paige downloads it. Only public http(s) URLs: private, loopback and link-local addresses are refused and redirects are re-checked at every hop. Add filename / mime to override what the remote server declares. - JSON { \u0026quot;format\u0026quot;: \u0026quot;IMAGE\u0026quot;, \u0026quot;data\u0026quot;: \u0026quot;\u0026quot;, \u0026quot;filename\u0026quot;: \u0026quot;...\u0026quot;, \u0026quot;mime\u0026quot;: \u0026quot;...\u0026quot; } — inline bytes, capped at 5 MB decoded, lower than the per-format ceilings because the body is buffered whole in memory. A data: URI prefix is accepted and stripped. Size and type are per FORMAT. IMAGE takes image/jpeg or image/png up to 5 MB; VIDEO takes video/mp4 or video/3gpp up to 16 MB; DOCUMENT takes PDF, Word, Excel, PowerPoint or plain text up to 100 MB. Oversize is 413 file_too_large and a type WhatsApp will not take is 415. The declared mime type is not trusted. The bytes are checked against their own signature, and a file whose contents disagree with its mime is 415 — sending a video as image/png to slip past the image size cap does not work. A handle is not a media id. media_id from POST /v1/media addresses a file Meta can SEND and is useless as a header_handle; the reverse is also true. The handle is short-lived and single-purpose: get one, create the template with it, and do not store it. Uploads are metered by BYTES as well as by request count, against the same per-key budget POST /v1/media charges. A burst of large samples can therefore return 429 rate_limited even while you are inside the request-per-minute budget — retry after the window. A source_url download is also aborted mid-stream once it passes that budget, so a sample bigger than a whole minute of it can never be fetched. Required scope: templates:manage\">\u003cmeta data-mint-head name=\"application-name\" content=\"paige\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/greenpages/x5PgeW5NAYRfgbaO/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/greenpages/x5PgeW5NAYRfgbaO/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/greenpages/x5PgeW5NAYRfgbaO/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/greenpages/x5PgeW5NAYRfgbaO/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/greenpages/x5PgeW5NAYRfgbaO/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/greenpages/x5PgeW5NAYRfgbaO/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/greenpages/x5PgeW5NAYRfgbaO/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/greenpages/x5PgeW5NAYRfgbaO/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/greenpages/x5PgeW5NAYRfgbaO/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Upload the sample file a media header needs - paige\">\u003cmeta data-mint-head property=\"og:description\" content=\"Meta will not review an IMAGE, VIDEO or DOCUMENT header without an EXAMPLE of the media it will carry, so a media-header template cannot be created until you have one of these handles. Upload the sample here, then put the returned handle into the header component as example.header_handle: [\u0026quot;\u0026quot;] when you call POST /v1/templates. Creating a media header without it is 400, not a Meta error. Two transports, pick one. - JSON { \u0026quot;format\u0026quot;: \u0026quot;DOCUMENT\u0026quot;, \u0026quot;source_url\u0026quot;: \u0026quot;https://...\u0026quot; } — Paige downloads it. Only public http(s) URLs: private, loopback and link-local addresses are refused and redirects are re-checked at every hop. Add filename / mime to override what the remote server declares. - JSON { \u0026quot;format\u0026quot;: \u0026quot;IMAGE\u0026quot;, \u0026quot;data\u0026quot;: \u0026quot;\u0026quot;, \u0026quot;filename\u0026quot;: \u0026quot;...\u0026quot;, \u0026quot;mime\u0026quot;: \u0026quot;...\u0026quot; } — inline bytes, capped at 5 MB decoded, lower than the per-format ceilings because the body is buffered whole in memory. A data: URI prefix is accepted and stripped. Size and type are per FORMAT. IMAGE takes image/jpeg or image/png up to 5 MB; VIDEO takes video/mp4 or video/3gpp up to 16 MB; DOCUMENT takes PDF, Word, Excel, PowerPoint or plain text up to 100 MB. Oversize is 413 file_too_large and a type WhatsApp will not take is 415. The declared mime type is not trusted. The bytes are checked against their own signature, and a file whose contents disagree with its mime is 415 — sending a video as image/png to slip past the image size cap does not work. A handle is not a media id. media_id from POST /v1/media addresses a file Meta can SEND and is useless as a header_handle; the reverse is also true. The handle is short-lived and single-purpose: get one, create the template with it, and do not store it. Uploads are metered by BYTES as well as by request count, against the same per-key budget POST /v1/media charges. A burst of large samples can therefore return 429 rate_limited even while you are inside the request-per-minute budget — retry after the window. A source_url download is also aborted mid-stream once it passes that budget, so a sample bigger than a whole minute of it can never be fetched. Required scope: templates:manage\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"paige\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://howto.paigeme.dev/api-reference/endpoints/templates/upload-the-sample-file-a-media-header-needs\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://greenpages.mintlify.site/_mintlify/api/og/v2?division=Templates\u0026amp;title=Upload+the+sample+file+a+media+header+needs\u0026amp;description=Meta+will+not+review+an+IMAGE%2C+VIDEO+or+DOCUMENT+header+without+an+EXAMPLE+of+the+media+it+will+carry%2C+so+a+media-header+template+cannot+be+created+until+you+ha\u0026amp;theme=c4f8b57fd839e0b00425ea76\u0026amp;signature=986c68be6ee6121feb58d8698095e1f72305c44822ef9ff7ec985a0e3329b05c\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Upload the sample file a media header needs - paige\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Meta will not review an IMAGE, VIDEO or DOCUMENT header without an EXAMPLE of the media it will carry, so a media-header template cannot be created until you have one of these handles. Upload the sample here, then put the returned handle into the header component as example.header_handle: [\u0026quot;\u0026quot;] when you call POST /v1/templates. Creating a media header without it is 400, not a Meta error. Two transports, pick one. - JSON { \u0026quot;format\u0026quot;: \u0026quot;DOCUMENT\u0026quot;, \u0026quot;source_url\u0026quot;: \u0026quot;https://...\u0026quot; } — Paige downloads it. Only public http(s) URLs: private, loopback and link-local addresses are refused and redirects are re-checked at every hop. Add filename / mime to override what the remote server declares. - JSON { \u0026quot;format\u0026quot;: \u0026quot;IMAGE\u0026quot;, \u0026quot;data\u0026quot;: \u0026quot;\u0026quot;, \u0026quot;filename\u0026quot;: \u0026quot;...\u0026quot;, \u0026quot;mime\u0026quot;: \u0026quot;...\u0026quot; } — inline bytes, capped at 5 MB decoded, lower than the per-format ceilings because the body is buffered whole in memory. A data: URI prefix is accepted and stripped. Size and type are per FORMAT. IMAGE takes image/jpeg or image/png up to 5 MB; VIDEO takes video/mp4 or video/3gpp up to 16 MB; DOCUMENT takes PDF, Word, Excel, PowerPoint or plain text up to 100 MB. Oversize is 413 file_too_large and a type WhatsApp will not take is 415. The declared mime type is not trusted. The bytes are checked against their own signature, and a file whose contents disagree with its mime is 415 — sending a video as image/png to slip past the image size cap does not work. A handle is not a media id. media_id from POST /v1/media addresses a file Meta can SEND and is useless as a header_handle; the reverse is also true. The handle is short-lived and single-purpose: get one, create the template with it, and do not store it. Uploads are metered by BYTES as well as by request count, against the same per-key budget POST /v1/media charges. A burst of large samples can therefore return 429 rate_limited even while you are inside the request-per-minute budget — retry after the window. A source_url download is also aborted mid-stream once it passes that budget, so a sample bigger than a whole minute of it can never be fetched. Required scope: templates:manage\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://greenpages.mintlify.site/_mintlify/api/og/v2?division=Templates\u0026amp;title=Upload+the+sample+file+a+media+header+needs\u0026amp;description=Meta+will+not+review+an+IMAGE%2C+VIDEO+or+DOCUMENT+header+without+an+EXAMPLE+of+the+media+it+will+carry%2C+so+a+media-header+template+cannot+be+created+until+you+ha\u0026amp;theme=c4f8b57fd839e0b00425ea76\u0026amp;signature=986c68be6ee6121feb58d8698095e1f72305c44822ef9ff7ec985a0e3329b05c\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/greenpages/x5PgeW5NAYRfgbaO/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"paige\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#81D741\">\u003clink data-mint-head rel=\"canonical\" href=\"https://howto.paigeme.dev/api-reference/endpoints/templates/upload-the-sample-file-a-media-header-needs\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/endpoints/templates/upload-the-sample-file-a-media-header-needs.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://howto.paigeme.dev/#organization\",\"name\":\"paige\",\"url\":\"https://howto.paigeme.dev\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/greenpages/SGZewfX5ti1H1LmZ/logo/green-pages-logo.png?fit=max\u0026auto=format\u0026n=SGZewfX5ti1H1LmZ\u0026q=85\u0026s=9b5fbf18d11676f6513a94ed3366cb7f\"}},{\"@type\":\"WebSite\",\"@id\":\"https://howto.paigeme.dev#website\",\"name\":\"paige\",\"url\":\"https://howto.paigeme.dev\",\"publisher\":{\"@id\":\"https://howto.paigeme.dev/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://howto.paigeme.dev/api-reference/endpoints/templates/upload-the-sample-file-a-media-header-needs#webpage\",\"url\":\"https://howto.paigeme.dev/api-reference/endpoints/templates/upload-the-sample-file-a-media-header-needs\",\"name\":\"Upload the sample file a media header needs\",\"description\":\"Meta will not review an IMAGE, VIDEO or DOCUMENT header without an EXAMPLE of the media it will carry, so a media-header template cannot be created until you have one of these handles. Upload the sample here, then put the returned handle into the header component as example.header_handle: [\\\"\\\"] when you call POST /v1/templates. Creating a media header without it is 400, not a Meta error. Two transports, pick one. - JSON { \\\"format\\\": \\\"DOCUMENT\\\", \\\"source_url\\\": \\\"https://...\\\" } — Paige downloads it. Only public http(s) URLs: private, loopback and link-local addresses are refused and redirects are re-checked at every hop. Add filename / mime to override what the remote server declares. - JSON { \\\"format\\\": \\\"IMAGE\\\", \\\"data\\\": \\\"\\\", \\\"filename\\\": \\\"...\\\", \\\"mime\\\": \\\"...\\\" } — inline bytes, capped at 5 MB decoded, lower than the per-format ceilings because the body is buffered whole in memory. A data: URI prefix is accepted and stripped. Size and type are per FORMAT. IMAGE takes image/jpeg or image/png up to 5 MB; VIDEO takes video/mp4 or video/3gpp up to 16 MB; DOCUMENT takes PDF, Word, Excel, PowerPoint or plain text up to 100 MB. Oversize is 413 file_too_large and a type WhatsApp will not take is 415. The declared mime type is not trusted. The bytes are checked against their own signature, and a file whose contents disagree with its mime is 415 — sending a video as image/png to slip past the image size cap does not work. A handle is not a media id. media_id from POST /v1/media addresses a file Meta can SEND and is useless as a header_handle; the reverse is also true. The handle is short-lived and single-purpose: get one, create the template with it, and do not store it. Uploads are metered by BYTES as well as by request count, against the same per-key budget POST /v1/media charges. A burst of large samples can therefore return 429 rate_limited even while you are inside the request-per-minute budget — retry after the window. A source_url download is also aborted mid-stream once it passes that budget, so a sample bigger than a whole minute of it can never be fetched. Required scope: templates:manage\",\"dateModified\":\"2026-11-20T16:58:04.953Z\",\"isPartOf\":{\"@id\":\"https://howto.paigeme.dev#website\"},\"breadcrumb\":{\"@id\":\"https://howto.paigeme.dev/api-reference/endpoints/templates/upload-the-sample-file-a-media-header-needs#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://howto.paigeme.dev/api-reference/endpoints/templates/upload-the-sample-file-a-media-header-needs#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Endpoints\",\"item\":\"https://howto.paigeme.dev/api-reference/endpoints/meta/the-openapi-31-spec-for-this-api-no-auth\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Templates\",\"item\":\"https://howto.paigeme.dev/api-reference/endpoints/templates/list-message-templates-+-approval-status\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Upload the sample file a media header needs\",\"item\":\"https://howto.paigeme.dev/api-reference/endpoints/templates/upload-the-sample-file-a-media-header-needs\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://howto.paigeme.dev/api-reference/endpoints/templates/upload-the-sample-file-a-media-header-needs#apireference\",\"headline\":\"Upload the sample file a media header needs\",\"name\":\"Upload the sample file a media header needs\",\"description\":\"Meta will not review an IMAGE, VIDEO or DOCUMENT header without an EXAMPLE of the media it will carry, so a media-header template cannot be created until you have one of these handles. Upload the sample here, then put the returned handle into the header component as example.header_handle: [\\\"\\\"] when you call POST /v1/templates. Creating a media header without it is 400, not a Meta error. Two transports, pick one. - JSON { \\\"format\\\": \\\"DOCUMENT\\\", \\\"source_url\\\": \\\"https://...\\\" } — Paige downloads it. Only public http(s) URLs: private, loopback and link-local addresses are refused and redirects are re-checked at every hop. Add filename / mime to override what the remote server declares. - JSON { \\\"format\\\": \\\"IMAGE\\\", \\\"data\\\": \\\"\\\", \\\"filename\\\": \\\"...\\\", \\\"mime\\\": \\\"...\\\" } — inline bytes, capped at 5 MB decoded, lower than the per-format ceilings because the body is buffered whole in memory. A data: URI prefix is accepted and stripped. Size and type are per FORMAT. IMAGE takes image/jpeg or image/png up to 5 MB; VIDEO takes video/mp4 or video/3gpp up to 16 MB; DOCUMENT takes PDF, Word, Excel, PowerPoint or plain text up to 100 MB. Oversize is 413 file_too_large and a type WhatsApp will not take is 415. The declared mime type is not trusted. The bytes are checked against their own signature, and a file whose contents disagree with its mime is 415 — sending a video as image/png to slip past the image size cap does not work. A handle is not a media id. media_id from POST /v1/media addresses a file Meta can SEND and is useless as a header_handle; the reverse is also true. The handle is short-lived and single-purpose: get one, create the template with it, and do not store it. Uploads are metered by BYTES as well as by request count, against the same per-key budget POST /v1/media charges. A burst of large samples can therefore return 429 rate_limited even while you are inside the request-per-minute budget — retry after the window. A source_url download is also aborted mid-stream once it passes that budget, so a sample bigger than a whole minute of it can never be fetched. Required scope: templates:manage\",\"url\":\"https://howto.paigeme.dev/api-reference/endpoints/templates/upload-the-sample-file-a-media-header-needs\",\"mainEntityOfPage\":{\"@id\":\"https://howto.paigeme.dev/api-reference/endpoints/templates/upload-the-sample-file-a-media-header-needs#webpage\"},\"dateModified\":\"2026-11-20T16:58:04.953Z\",\"publisher\":{\"@id\":\"https://howto.paigeme.dev/#organization\"},\"isPartOf\":{\"@id\":\"https://howto.paigeme.dev#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"paige\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"paige\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/endpoints/templates/upload-the-sample-file-a-media-header-needs.md","siteName":"paige","nav":{"global":null,"tabs":[{"tab":"Introduction","icon":"rocket","pages":[{"title":"Introduction","href":""}]},{"tab":"Learn","icon":"graduation-cap","pages":[{"title":"Learn","href":"/learn/foundations/what-is-an-llm"}]},{"tab":"Features","icon":"sparkles","pages":[{"title":"Features","href":"/agents/overview"}]},{"tab":"API","icon":"code","groups":[{"group":"Getting started","pages":[{"title":"The Paige API","sidebarTitle":"Introduction","href":"/api-reference/introduction"},{"title":"Authentication","href":"/api-reference/authentication"},{"title":"Scopes","href":"/api-reference/scopes"},{"title":"API conventions","sidebarTitle":"Conventions","href":"/api-reference/conventions"},{"title":"Errors","href":"/api-reference/errors"},{"title":"Rate limits","href":"/api-reference/rate-limits"},{"title":"Idempotency","href":"/api-reference/idempotency"},{"title":"Webhooks","href":"/api-reference/webhooks"}]},{"group":"Endpoints","pages":[{"group":"Meta","pages":[{"title":"The OpenAPI 3.1 spec for this API (no auth)","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /v1/openapi.json","href":"/api-reference/endpoints/meta/the-openapi-31-spec-for-this-api-no-auth"},{"title":"The pasteable Paige integration agent skill (no auth)","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /v1/skill.md","href":"/api-reference/endpoints/meta/the-pasteable-paige-integration-agent-skill-no-auth"},{"title":"Smoke check, echoing the resolved project and scopes","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /v1/ping","href":"/api-reference/endpoints/meta/smoke-check-echoing-the-resolved-project-and-scopes"},{"title":"The projects this credential may act on","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /v1/projects","href":"/api-reference/endpoints/meta/the-projects-this-credential-may-act-on"}]},{"group":"Messages","pages":[{"title":"Send a message (session, template, or interactive)","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /v1/messages","href":"/api-reference/endpoints/messages/send-a-message-session-template-or-interactive"},{"title":"Delivery status for one message","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /v1/messages/{id}","href":"/api-reference/endpoints/messages/delivery-status-for-one-message"},{"title":"Retrieve the media attached to a message","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /v1/messages/{id}/media","href":"/api-reference/endpoints/messages/retrieve-the-media-attached-to-a-message"}]},{"group":"Templates","pages":[{"title":"List message templates + approval status","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /v1/templates","href":"/api-reference/endpoints/templates/list-message-templates-+-approval-status"},{"title":"Create a WhatsApp message template","description":"Creates a template on the project WABA. Meta approves asynchronously — returns `status: pending`.\n\n**Required scope:** `templates:manage`","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /v1/templates","href":"/api-reference/endpoints/templates/create-a-whatsapp-message-template"},{"title":"Upload the sample file a media header needs","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /v1/templates/header-sample","href":"/api-reference/endpoints/templates/upload-the-sample-file-a-media-header-needs"},{"title":"Delete a template (all localizations, or a single language)","description":"Deletes every localization of `{name}` by default. Pass `?language=\u003ccode>` to remove just that one localization and leave the rest in place.\n\n**Required scope:** `templates:manage`","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json delete /v1/templates/{name}","href":"/api-reference/endpoints/templates/delete-a-template-all-localizations-or-a-single-language"}]},{"group":"Conversations","pages":[{"title":"List conversations (state + archive filter, keyset cursor)","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /v1/conversations","href":"/api-reference/endpoints/conversations/list-conversations-state-+-archive-filter-keyset-cursor"},{"title":"Messages in a conversation (keyset cursor)","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /v1/conversations/{id}/messages","href":"/api-reference/endpoints/conversations/messages-in-a-conversation-keyset-cursor"},{"title":"Set a conversation's state (validated against known states)","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json patch /v1/conversations/{id}","href":"/api-reference/endpoints/conversations/set-a-conversations-state-validated-against-known-states"}]},{"group":"Contacts","pages":[{"title":"All messages for a contact (phone or BSUID)","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /v1/contacts/{id}/messages","href":"/api-reference/endpoints/contacts/all-messages-for-a-contact-phone-or-bsuid"},{"title":"Update a contact name, tags or custom attributes","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json patch /v1/contacts/{id}","href":"/api-reference/endpoints/contacts/update-a-contact-name-tags-or-custom-attributes"},{"title":"Archive a contact's chat","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /v1/contacts/{id}/archive","href":"/api-reference/endpoints/contacts/archive-a-contacts-chat"},{"title":"Bring a contact's chat back from Archived","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /v1/contacts/{id}/unarchive","href":"/api-reference/endpoints/contacts/bring-a-contacts-chat-back-from-archived"}]},{"group":"Build","pages":[{"title":"List the bot code files","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /v1/files","href":"/api-reference/endpoints/build/list-the-bot-code-files"},{"title":"Read one bot code file","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /v1/files/{path}","href":"/api-reference/endpoints/build/read-one-bot-code-file"},{"title":"Create or edit a file via the code agent","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json put /v1/files/{path}","href":"/api-reference/endpoints/build/create-or-edit-a-file-via-the-code-agent"},{"title":"Author or edit bot code via the code agent","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /v1/code","href":"/api-reference/endpoints/build/author-or-edit-bot-code-via-the-code-agent"},{"title":"Confirm, reject or revise a build plan","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /v1/code/plans/{id}/decision","href":"/api-reference/endpoints/build/confirm-reject-or-revise-a-build-plan"},{"title":"Promote dev to production","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /v1/deploy","href":"/api-reference/endpoints/build/promote-dev-to-production"},{"title":"List the project's WhatsApp Flows","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /v1/flows","href":"/api-reference/endpoints/build/list-the-projects-whatsapp-flows"},{"title":"Generate a new WhatsApp Flow via the flows sub-agent","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /v1/flows","href":"/api-reference/endpoints/build/generate-a-new-whatsapp-flow-via-the-flows-sub-agent"},{"title":"Read one flow, including its JSON definition","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /v1/flows/{id}","href":"/api-reference/endpoints/build/read-one-flow-including-its-json-definition"},{"title":"Update a flow via the flows sub-agent","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json patch /v1/flows/{id}","href":"/api-reference/endpoints/build/update-a-flow-via-the-flows-sub-agent"}]},{"group":"Chat","pages":[{"title":"Send Paige a message and get its reply","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /v1/chat","href":"/api-reference/endpoints/chat/send-paige-a-message-and-get-its-reply"}]},{"group":"Broadcasts","pages":[{"title":"Create + save a reusable audience segment","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /v1/segments","href":"/api-reference/endpoints/broadcasts/create-+-save-a-reusable-audience-segment"},{"title":"Live contact count for a filter (no save)","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /v1/segments/preview","href":"/api-reference/endpoints/broadcasts/live-contact-count-for-a-filter-no-save"},{"title":"Assemble a broadcast for approval","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /v1/broadcasts","href":"/api-reference/endpoints/broadcasts/assemble-a-broadcast-for-approval"},{"title":"Broadcast status + rollup counts","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /v1/broadcasts/{id}","href":"/api-reference/endpoints/broadcasts/broadcast-status-+-rollup-counts"},{"title":"Per-recipient drill-down","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /v1/broadcasts/{id}/recipients","href":"/api-reference/endpoints/broadcasts/per-recipient-drill-down"}]},{"group":"Tables","pages":[{"title":"List the project's own database tables","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /v1/tables","href":"/api-reference/endpoints/tables/list-the-projects-own-database-tables"},{"title":"Read one table's columns, types and primary key","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /v1/tables/{table}/schema","href":"/api-reference/endpoints/tables/read-one-tables-columns-types-and-primary-key"},{"title":"Read rows from one of your tables","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /v1/tables/{table}/rows","href":"/api-reference/endpoints/tables/read-rows-from-one-of-your-tables"},{"title":"Insert rows into one of your tables","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /v1/tables/{table}/rows","href":"/api-reference/endpoints/tables/insert-rows-into-one-of-your-tables"},{"title":"Delete the rows matching a filter","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json delete /v1/tables/{table}/rows","href":"/api-reference/endpoints/tables/delete-the-rows-matching-a-filter"},{"title":"Update the rows matching a filter","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json patch /v1/tables/{table}/rows","href":"/api-reference/endpoints/tables/update-the-rows-matching-a-filter"}]},{"group":"Media","pages":[{"title":"List the project's media assets","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /v1/media","href":"/api-reference/endpoints/media/list-the-projects-media-assets"},{"title":"Upload a media asset","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /v1/media","href":"/api-reference/endpoints/media/upload-a-media-asset"},{"title":"Retrieve one media asset and a signed URL","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /v1/media/{slug}","href":"/api-reference/endpoints/media/retrieve-one-media-asset-and-a-signed-url"},{"title":"Delete a media asset","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json delete /v1/media/{slug}","href":"/api-reference/endpoints/media/delete-a-media-asset"}]},{"group":"Webhooks","pages":[{"title":"List webhook registrations (never the secret)","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /v1/webhooks","href":"/api-reference/endpoints/webhooks/list-webhook-registrations-never-the-secret"},{"title":"Register an outbound webhook","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /v1/webhooks","href":"/api-reference/endpoints/webhooks/register-an-outbound-webhook"},{"title":"Retrieve one webhook registration (never the secret)","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /v1/webhooks/{id}","href":"/api-reference/endpoints/webhooks/retrieve-one-webhook-registration-never-the-secret"},{"title":"Delete a webhook registration","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json delete /v1/webhooks/{id}","href":"/api-reference/endpoints/webhooks/delete-a-webhook-registration"},{"title":"Partial update of a webhook registration","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json patch /v1/webhooks/{id}","href":"/api-reference/endpoints/webhooks/partial-update-of-a-webhook-registration"}]}]}]},{"tab":"Integrations","icon":"plug","pages":[{"title":"Integrations","href":"/integrations"}]},{"tab":"Tips \u0026 Tricks","icon":"lightbulb","pages":[{"title":"Tips \u0026 Tricks","href":"/guides/prompting"}]},{"tab":"Changelog","icon":"history","pages":[{"title":"Changelog","href":"/changelog"}]}]},"basePath":"","title":"Upload the sample file a media header needs - paige","deploymentId":"dpl_EtLmMeZHkKGqAjV1DiX4ZXCriDj3","buildId":"dpl_EtLmMeZHkKGqAjV1DiX4ZXCriDj3","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-CWRF67qg.js","snippetPresets-BR8BoZAC.js","utils-D5WEoDBM.js","style-to-object-BY3JEAdk.js","utils-B79vXYXV.js","v4-DIgz8zy6.js","addUniqueKeysToSchema-C59iNs-S.js","conditional-requirements-CFM0id0Q.js","cloneDeep-455jK_K_.js","_Uint8Array-BEecbuUl.js","isObject-FP1Yky1u.js","ApiExamples-CFRHL52q.js","usePlaygroundInputsStore-Caip2xMX.js","shallow-BS-qcxmX.js","isEqual-CEpbaqh9.js","CodeSnippets-B-R0FAqw.js","CodeSnippet-Bkkti1IB.js","use-playground-group-access-BLvLSz8w.js","Page-UFatEFaf.js","api-description-markdown-Cny85OC3.js","DynamicMarkdown-Czhs88Hc.js","SectionHeading-B08KBUKT.js","MethodPill-D8OvWg5y.js","getPastedJson-tB5m0_yh.js","Check2Icon-CeP__a4S.js","axios-CsQoIw0U.js","Markdown-LI7DSqeK.js","AssistantPageLink-bYxdsqKl.js","dist-DXTH2WLA.js","lib-DMeTj1gb.js","lib-B8HbPgcC.js","katex-Dbtb6Wk7.js","html-void-elements-mCSPHezU.js","marked.esm-CZWythHk.js"]}