Generates a banner image for a unit of learning, used as the unit’s cover in the
planner and library.
This endpoint takes a unit_id, not a subject and topic. It reads the
unit’s subject, topic and year_group from the database itself, so the
caller cannot vary the prompt.
The unit to generate a cover for. Must belong to the calling user — this is
one of the few endpoints that checks per-row ownership and returns 403 when
it fails.
cached tells you which of three paths served the response, and the distinction
matters because only one of them costs a generation:
Value
Meaning
"row"
The unit already pointed at a current-composition image. No work done.
"content"
Another unit with the same subject, topic and year group had already generated this exact image. Reused, no generation.
false
Nothing matched. An image was generated and uploaded.
The cache key is a SHA-256 over subject, topic and year_group — normalised
for case and whitespace — salted with a composition version. Two units with the
same three values share one stored object rather than generating twice.
Bumping the composition version invalidates every key at once. Existing units
keep serving their old banner until next viewed, then lazily regenerate in the
new composition. Old objects are left in place rather than deleted.
If the image uploads but the units row fails to update, the call still returns
200 with the URL — the image is in storage and usable, only the row is stale.
That unit will regenerate its key on next view and land on the "content" cache
path, so the failure costs a lookup rather than a second generation.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"MESO Docs","description":"API reference and integration guides for the MESO educational planning platform.","colors":{"primary":"#B64B00","light":"#FF720F","dark":"#D15600"},"logo":{"light":"https://mintcdn.com/meso-lab/4fn_Y-YWQ1gkm2sT/logo/meso-light.svg?fit=max\u0026auto=format\u0026n=4fn_Y-YWQ1gkm2sT\u0026q=85\u0026s=0f20c795a69b624ef3f0c4a575470a08","dark":"https://mintcdn.com/meso-lab/4fn_Y-YWQ1gkm2sT/logo/meso-dark.svg?fit=max\u0026auto=format\u0026n=4fn_Y-YWQ1gkm2sT\u0026q=85\u0026s=1d9fa741f7aa99dd1e47f67e8eb49463","href":"https://www.mesolab.ai"},"favicon":"https://mintcdn.com/meso-lab/4fn_Y-YWQ1gkm2sT/logo/favicon.svg?fit=max\u0026auto=format\u0026n=4fn_Y-YWQ1gkm2sT\u0026q=85\u0026s=c4320af2e933ad7e7c740b0839692bb6","navbar":{"links":[{"href":"https://www.mesolab.ai","label":"Marketing site"},{"href":"mailto:contact@mesolab.ai","label":"Support"}],"primary":{"type":"button","label":"Open MESO","href":"https://app.mesolab.ai"}},"footer":{"socials":{"linkedin":"https://www.linkedin.com/company/mesolab","x":"https://x.com/mesolab"},"links":[{"header":"Legal","items":[{"label":"Privacy","href":"https://www.mesolab.ai/privacy"},{"label":"Terms","href":"https://www.mesolab.ai/terms"},{"label":"Cookies","href":"https://www.mesolab.ai/cookies"}]}]},"search":{"prompt":"Search MESO docs"},"fonts":{"family":"Geist"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"meso-lab","hasAudioNarration":false,"actualSubdomain":"meso-lab","customDomains":["docs.mesolab.ai"],"gitSource":{"type":"github","owner":"mesolab","repo":"meso-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"latestBuiltDeploymentHistoryId":"6a8ecb641a367802b31e2e69","collectionId":"caa2c304-bfc1-4b2a-a0c5-fd9d73fe9e6d","liveDeploymentHistoryId":"6a8ecb641a367802b31e2e69","schemaVersion":"v3"},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6a8ecb641a367802b31e2e69","clientVersion":"0.0.4043","searchFilterCounts":[{"language":"default","tag":"Teachers","count":21},{"language":"default","tag":"Developers","count":20},{"language":"default","tag":"Schools \u0026 publishers","count":7},{"language":"default","tag":"Running MESO","count":7},{"language":"default","tag":"Planning","count":6},{"language":"default","tag":"Assessment","count":5},{"language":"default","tag":"Curriculum","count":5},{"language":"default","tag":"Get started","count":5},{"language":"default","tag":"Assist","count":3},{"language":"default","tag":"Content","count":3}]},"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":"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":"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":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","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":"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":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","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":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","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":"workos-signup","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":"workos-enabled","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}],"googleFontsInlined":true},"customCss":[],"page":{"pagePath":"api-reference/content/unit-hero-image","slug":"/api-reference/content/unit-hero-image","pageMetadata":{"title":"Hero image","api":"POST /unit-hero-image","description":"Generate cover imagery for a unit.","icon":"image","href":"/api-reference/content/unit-hero-image"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Generate cover imagery for a unit.\"\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,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,p:`p`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{Heading,Info,Note,ParamField,ResponseField,Table,Warning}=_components;if(!Heading)_missingMdxReference(`Heading`,true);if(!Info)_missingMdxReference(`Info`,true);if(!Note)_missingMdxReference(`Note`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Generates a banner image for a unit of learning, used as the unit’s cover in the\nplanner and library.`}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`This endpoint takes a `,_jsxs(_components.strong,{children:[_jsx(_components.code,{children:`unit_id`}),`, not a subject and topic`]}),`. It reads the\nunit’s `,_jsx(_components.code,{children:`subject`}),`, `,_jsx(_components.code,{children:`topic`}),` and `,_jsx(_components.code,{children:`year_group`}),` from the database itself, so the\ncaller cannot vary the prompt.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`request`,children:`Request`}),`\n`,_jsx(ParamField,{body:`unit_id`,type:`string`,required:true,id:`param-unit-id`,children:_jsxs(_components.p,{children:[`The unit to generate a cover for. Must belong to the calling user — this is\none of the few endpoints that checks per-row ownership and returns `,_jsx(_components.code,{children:`403`}),` when\nit fails.`]})}),`\n`,`\n`,_jsx(Heading,{level:`2`,id:`response`,children:`Response`}),`\n`,_jsx(ResponseField,{name:`success`,type:`boolean`,id:`param-success`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`true`}),` when a URL is available, whether generated or served from cache.`]})}),`\n`,_jsx(ResponseField,{name:`url`,type:`string`,id:`param-url`,children:_jsxs(_components.p,{children:[`Public URL of the banner in the `,_jsx(_components.code,{children:`unit-hero-images`}),` bucket.`]})}),`\n`,_jsx(ResponseField,{name:`cached`,type:`\"row\" | \"content\" | false`,id:`param-cached`,children:_jsx(_components.p,{children:`Which of the three paths served the request. See below.`})}),`\n`,`\n`,_jsx(Heading,{level:`2`,id:`caching`,children:`Caching`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`cached`}),` tells you which of three paths served the response, and the distinction\nmatters because only one of them costs a generation:`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Value`}),_jsx(_components.th,{children:`Meaning`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`\"row\"`})}),_jsx(_components.td,{children:`The unit already pointed at a current-composition image. No work done.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`\"content\"`})}),_jsx(_components.td,{children:`Another unit with the same subject, topic and year group had already generated this exact image. Reused, no generation.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`false`})}),_jsx(_components.td,{children:`Nothing matched. An image was generated and uploaded.`})]})]})]}),`\n`,_jsxs(_components.p,{children:[`The cache key is a SHA-256 over `,_jsx(_components.code,{children:`subject`}),`, `,_jsx(_components.code,{children:`topic`}),` and `,_jsx(_components.code,{children:`year_group`}),` — normalised\nfor case and whitespace — salted with a composition version. Two units with the\nsame three values share one stored object rather than generating twice.`]}),`\n`,_jsx(Info,{children:_jsx(_components.p,{children:`Bumping the composition version invalidates every key at once. Existing units\nkeep serving their old banner until next viewed, then lazily regenerate in the\nnew composition. Old objects are left in place rather than deleted.`})}),`\n`,_jsx(Heading,{level:`2`,id:`errors`,children:`Errors`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Status`}),_jsx(_components.th,{children:`Cause`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`unit_id`}),` missing.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`403`}),_jsx(_components.td,{children:`The unit exists but belongs to another user.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`404`}),_jsx(_components.td,{children:`No unit with that id.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`500`}),_jsx(_components.td,{children:`Generation or storage upload failed.`})]})]})]}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[`If the image uploads but the `,_jsx(_components.code,{children:`units`}),` row fails to update, the call still returns\n`,_jsx(_components.code,{children:`200`}),` with the URL — the image is in storage and usable, only the row is stale.\nThat unit will regenerate its key on next view and land on the `,_jsx(_components.code,{children:`\"content\"`}),` cache\npath, so the failure costs a lookup rather than a second generation.`]})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Hero image","api":"POST /unit-hero-image","description":"Generate cover imagery for a unit.","icon":"image","href":"/api-reference/content/unit-hero-image"}}},"mdxSourceWithNoJs":null,"noJsSplices":[[199,217,"pre:`pre`,span:`span`,strong:`strong`,tb"],[313,399,"CodeBlock,Heading,Info,Note,ParamField,RequestExample,ResponseExample,ResponseField,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_mis"],[579,591,"questExample)_missingMdxReference(`RequestExample`,true);if(!ResponseExample)_missingMdxReference(`ResponseExample`,true);if(!ResponseField)"],[1732,1739,"_jsx(RequestExample,{children:_jsx(CodeBlock,{filename:`cURL`,numberOfLines:`4`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$BASE_URL`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`/unit-hero-image\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$ACCESS_TOKEN`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{ \"unit_id\": \"8f2c1e40-...\" }'`})]}),`\n`]})})})}),`\n`,_js"],[2424,2442,"_jsx(ResponseExample,{children:_jsx(CodeBlock,{filename:`Response`,numberOfLines:`5`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`5`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"success\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"url\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://\u003cproject>.supabase.co/storage/v1/object/public/unit-hero-images/a1b2c3d4e5f60718.png\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"cached\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"row\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})})}),`\n`,_jsx(Heading,{"]]},"mdxExtracts":{"tableOfContents":[{"title":"Request","slug":"request","depth":2,"children":[]},{"title":"Response","slug":"response","depth":2,"children":[]},{"title":"Caching","slug":"caching","depth":2,"children":[]},{"title":"Errors","slug":"errors","depth":2,"children":[]}],"codeExamples":{"request":{"type":"RequestExample","children":[{"filename":"cURL","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"shellscript\">\u003ccode language=\"shellscript\" numberOfLines=\"4\">\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#DCDCAA\">curl\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -X\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> POST\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">$BASE_URL\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">/unit-hero-image\"\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -H\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"Authorization: Bearer \u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">$ACCESS_TOKEN\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -H\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"Content-Type: application/json\"\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -d\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> '{ \"unit_id\": \"8f2c1e40-...\" }'\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]},"response":{"type":"ResponseExample","children":[{"filename":"Response","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"json\">\u003ccode language=\"json\" numberOfLines=\"5\">\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"success\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\">true\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"url\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"https://\u0026#x3C;project>.supabase.co/storage/v1/object/public/unit-hero-images/a1b2c3d4e5f60718.png\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"cached\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"row\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]}},"endpoint":{"title":"Hero image","path":"/unit-hero-image","method":"post","request":{"security":[],"parameters":{"query":{},"header":{},"cookie":{},"path":{}},"body":{"application/json":{"schemaArray":[{"type":"object","properties":{"unit_id":[{"type":"string","description":"The unit to generate a cover for. Must belong to the calling user — this is one of the few endpoints that checks per-row ownership and returns `403` when it fails.","required":true}]}}],"examples":{"example":{"value":{"unit_id":"\u003cstring>"}}}}}},"response":{"200":{"application/json":{"schemaArray":[{"type":"object","properties":{"success":[{"type":"boolean","description":"`true` when a URL is available, whether generated or served from cache."}],"url":[{"type":"string","description":"Public URL of the banner in the `unit-hero-images` bucket."}],"cached":[{"type":"object","properties":{},"description":"Which of the three paths served the request. See below."}]}}],"examples":{"example":{"value":{"success":true,"url":"\u003cstring>","cached":{}}}}}}},"deprecated":false}},"jsLinks":[],"subdomain":"meso-lab","siteName":"MESO Docs","title":"Hero image - MESO Docs","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-08-21T18:27:01.189Z","originalFileLocation":"api-reference/content/unit-hero-image.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=\"Generate cover imagery for a unit.\">\u003cmeta data-mint-head name=\"application-name\" content=\"MESO Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/meso-lab/xgmBOAoGJ_cgEBgb/_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/meso-lab/xgmBOAoGJ_cgEBgb/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/meso-lab/xgmBOAoGJ_cgEBgb/_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/meso-lab/xgmBOAoGJ_cgEBgb/_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/meso-lab/xgmBOAoGJ_cgEBgb/_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/meso-lab/xgmBOAoGJ_cgEBgb/_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/meso-lab/xgmBOAoGJ_cgEBgb/_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/meso-lab/xgmBOAoGJ_cgEBgb/_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/meso-lab/xgmBOAoGJ_cgEBgb/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Hero image - MESO Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Generate cover imagery for a unit.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"MESO Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.mesolab.ai/api-reference/content/unit-hero-image\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://meso-lab.mintlify.app/_mintlify/api/og/v2?division=Content\u0026amp;title=Hero+image\u0026amp;description=Generate+cover+imagery+for+a+unit.\u0026amp;theme=7df8d1f9585a44d32f08d999\u0026amp;signature=30b11fab873b0782a9c544e04bc960d2bbabd0c98ac06220fb364a4301104b42\">\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=\"Hero image - MESO Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Generate cover imagery for a unit.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://meso-lab.mintlify.app/_mintlify/api/og/v2?division=Content\u0026amp;title=Hero+image\u0026amp;description=Generate+cover+imagery+for+a+unit.\u0026amp;theme=7df8d1f9585a44d32f08d999\u0026amp;signature=30b11fab873b0782a9c544e04bc960d2bbabd0c98ac06220fb364a4301104b42\">\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/meso-lab/xgmBOAoGJ_cgEBgb/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"MESO Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#B64B00\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.mesolab.ai/api-reference/content/unit-hero-image\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/content/unit-hero-image.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.mesolab.ai/#organization\",\"name\":\"MESO Docs\",\"url\":\"https://docs.mesolab.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/meso-lab/4fn_Y-YWQ1gkm2sT/logo/meso-light.svg?fit=max\u0026auto=format\u0026n=4fn_Y-YWQ1gkm2sT\u0026q=85\u0026s=0f20c795a69b624ef3f0c4a575470a08\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.mesolab.ai#website\",\"name\":\"MESO Docs\",\"url\":\"https://docs.mesolab.ai\",\"publisher\":{\"@id\":\"https://docs.mesolab.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.mesolab.ai/api-reference/content/unit-hero-image#webpage\",\"url\":\"https://docs.mesolab.ai/api-reference/content/unit-hero-image\",\"name\":\"Hero image\",\"description\":\"Generate cover imagery for a unit.\",\"dateModified\":\"2026-08-21T18:27:01.189Z\",\"isPartOf\":{\"@id\":\"https://docs.mesolab.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.mesolab.ai/api-reference/content/unit-hero-image#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.mesolab.ai/api-reference/content/unit-hero-image#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Content\",\"item\":\"https://docs.mesolab.ai/api-reference/content/resource\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Hero image\",\"item\":\"https://docs.mesolab.ai/api-reference/content/unit-hero-image\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.mesolab.ai/api-reference/content/unit-hero-image#apireference\",\"headline\":\"Hero image\",\"name\":\"Hero image\",\"description\":\"Generate cover imagery for a unit.\",\"url\":\"https://docs.mesolab.ai/api-reference/content/unit-hero-image\",\"mainEntityOfPage\":{\"@id\":\"https://docs.mesolab.ai/api-reference/content/unit-hero-image#webpage\"},\"dateModified\":\"2026-08-21T18:27:01.189Z\",\"publisher\":{\"@id\":\"https://docs.mesolab.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.mesolab.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"MESO Docs\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"MESO Docs","nav":{"global":null,"tabs":[{"tab":"Teachers","icon":"graduation-cap","pages":[{"title":"Teachers","href":"/teachers/get-started"}]},{"tab":"Schools \u0026 publishers","icon":"building","pages":[{"title":"Schools \u0026 publishers","href":"/schools/rollout"}]},{"tab":"Developers","icon":"code","groups":[{"group":"Get started","icon":"rocket","pages":[{"title":"Quickstart","icon":"rocket","href":"/quickstart"},{"title":"Authentication","icon":"key","href":"/authentication"}]},{"group":"Concepts","icon":"diagram-project","pages":[{"title":"Architecture","icon":"sitemap","href":"/concepts/architecture"},{"title":"Capabilities","icon":"cubes","href":"/concepts/capabilities"},{"title":"Conventions","icon":"list-check","href":"/concepts/conventions"}]},{"group":"Overview","icon":"circle-info","pages":[{"title":"API reference","icon":"circle-info","href":"/api-reference/introduction"},{"title":"Errors","icon":"triangle-exclamation","href":"/api-reference/errors"}]},{"group":"Planning","icon":"calendar-days","pages":[{"title":"Unit planning","api":"POST /unit-planning","icon":"calendar-days","href":"/api-reference/planning/unit-planning"},{"title":"Lesson planning","api":"POST /lesson-planning","icon":"chalkboard-user","href":"/api-reference/planning/lesson-planning"}]},{"group":"Assessment","icon":"clipboard-check","pages":[{"title":"Rubric","api":"POST /rubric","icon":"table-list","href":"/api-reference/assessment/rubric"},{"title":"Assessment","api":"POST /assessment","icon":"clipboard-check","href":"/api-reference/assessment/assessment"}]},{"group":"Content","icon":"shapes","pages":[{"title":"Resource","api":"POST /resource","icon":"folder-open","href":"/api-reference/content/resource"},{"title":"Slides","api":"POST /slides","description":"Build a presentation from a lesson plan or a topic.","icon":"display","href":"/api-reference/content/slides"},{"title":"Hero image","api":"POST /unit-hero-image","icon":"image","href":"/api-reference/content/unit-hero-image"}]},{"group":"Assist","icon":"comments","pages":[{"title":"Chat","api":"POST /chat","description":"The streaming assistant conversation behind MESO Assist.","icon":"comments","href":"/api-reference/assist/chat"},{"title":"AI actions","api":"POST /ai-actions","icon":"wand-magic-sparkles","href":"/api-reference/assist/ai-actions"},{"title":"Transcription","api":"POST /whisper-transcribe","icon":"microphone","href":"/api-reference/assist/whisper-transcribe"}]},{"group":"Curriculum","icon":"compass","pages":[{"title":"Recommend learning outcomes","api":"POST /recommend-lo","icon":"compass","href":"/api-reference/curriculum/recommend-lo"},{"title":"Recommend assessments","api":"POST /recommend-as","icon":"scale-balanced","href":"/api-reference/curriculum/recommend-as"}]},{"group":"Documents","icon":"file-lines","pages":[{"title":"Document ingestion","api":"POST /ingest-teacher-document","icon":"file-arrow-up","href":"/api-reference/documents/ingest-teacher-document"}]}]}]},"basePath":"","title":"Hero image - MESO Docs","buildId":"dpl_G9nrg4qeJSZtah1Ziwbc2n6WkLch","deploymentId":"dpl_G9nrg4qeJSZtah1Ziwbc2n6WkLch","dynamics":["c2aa737661","2b790eda92","b0f84f53ff"],"chunks":["OpenApiReferenceProvider-B7XKH4J3.js","utils-lOYzL7z-.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-DF6jUUIM.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-Dpsj5f7C.js","snippetPresets-CYeiDe8v.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-CUFz1YZ_.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-D8H_iLS4.js","shallow-DdluZBHX.js","getApiPlaygroundDisplay-B9922vev.js","CodeSnippet-CMoRNGYs.js","CodeSnippets-DwyrPHuw.js","Page-DSVu9Ucl.js","getPastedJson-G-zIvlHh.js","icon-B03fnEy0.js","MethodPill-CW7teklc.js","DuplicateIcon-CtO8eekd.js","createIcon-DZTKdM_A.js","DynamicMarkdown-D5M2At0B.js","SectionHeading-C_2NaA2U.js","axios-vUo_bRtp.js"]}