The error envelope, the codes you can get, and how to handle them.
Every failure returns the same envelope — never alongside data:
{ "error": { "code": "VALIDATION_ERROR", "message": "Domain is not a valid hostname", "details": [ { "field": "domain", "code": "INVALID_FORMAT", "message": "Domain is not a valid hostname" } ] }}
code and message are always present; details only appears on field-level
failures.
Branch on error.code, never on error.message. Messages are written for
humans and change without notice; codes are a contract.
Bulk endpoints are not all-or-nothing in the same way. create_brand_prompts
writes the valid rows and reports the rest in the response body — a 201 can
still contain failures:
Check prompts_failed and errors_and_warnings even on a success status.The one exception is usage limits: if the batch as a whole would exceed
your subscription, the entire mutation is rolled back and you get a 422USAGE_LIMIT_REACHED instead — no rows are written.
401 — stop retrying. The key is bad, revoked, or expired; retrying won’t
fix it.
403 — you’re calling an endpoint outside the public surface, or a brand
your org doesn’t own. Also not retryable.
404 — treat as terminal. A soft-deleted brand starts returning it
mid-integration, so handle it as “gone”, not as a transient failure.
422 — a bug in your payload. Log details and fix the caller.
429 — back off exponentially and retry. Don’t rotate keys to get around
it; the per-IP backstop catches that too.
500 — retry with backoff, cap the attempts, and alert if it sticks.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Cognizo Docs","description":"Cognizo API and MCP Documentation. Track and grow your brand's visibility, share of voice, and sentiment across AI search engines like ChatGPT, Claude, Perplexity, and Google AI Overviews.","colors":{"primary":"#6C4CF1","light":"#8A6EF5","dark":"#4A2FD0"},"logo":{"light":"https://mintcdn.com/cognizo/x-lz_CTiDXjk7exn/images/cognizo-logo.png?fit=max\u0026auto=format\u0026n=x-lz_CTiDXjk7exn\u0026q=85\u0026s=beb92c1c8994be1c625caf4c4840ba0b","dark":"https://mintcdn.com/cognizo/x-lz_CTiDXjk7exn/images/cognizo-logo-dark.png?fit=max\u0026auto=format\u0026n=x-lz_CTiDXjk7exn\u0026q=85\u0026s=afa66996adab115482c97e8d5ba5ecd9","href":"https://docs.cognizo.ai"},"favicon":"https://mintcdn.com/cognizo/aQn_f7JfezHrAXFA/favicon.png?fit=max\u0026auto=format\u0026n=aQn_f7JfezHrAXFA\u0026q=85\u0026s=a77aea5ad0f9e341aa31106b5363b783","background":{"color":{"dark":"#0B081C"}},"navbar":{"links":[{"href":"https://cognizo.ai","label":"Website"},{"href":"https://help.cognizo.ai","label":"Help Center"},{"href":"https://www.cognizo.ai/blog","label":"Blog"}],"primary":{"type":"button","label":"Dashboard","href":"https://app.cognizo.ai"}},"footer":{"socials":{"website":"https://cognizo.ai","linkedin":"https://linkedin.com/company/cognizo"}},"seo":{"indexing":"all"},"fonts":{"family":"Geist"},"icons":{"library":"fontawesome"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"cognizo","hasAudioNarration":false,"actualSubdomain":"cognizo","customDomains":["docs.cognizo.ai"],"gitSource":{"type":"github","owner":"cognizo-ai","repo":"cognizo-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"collectionId":"29cee2e4-9777-4d4c-b42a-474cddc0af33","liveDeploymentHistoryId":"6ae4ed2bafc3f6fb7305af70","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae4ed2bafc3f6fb7305af70"},"feedback":{"thumbs":false},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6ae4ed2bafc3f6fb7305af70","clientVersion":"0.0.4054","searchFilterCounts":[{"language":"default","tag":"API Reference","count":79},{"language":"default","tag":"ContentStudio","count":13},{"language":"default","tag":"Guides","count":12},{"language":"default","tag":"Citations","count":8},{"language":"default","tag":"Prompts","count":8},{"language":"default","tag":"BrandActions","count":6},{"language":"default","tag":"Technical audit","count":6},{"language":"default","tag":"Brands","count":5},{"language":"default","tag":"Opportunities","count":5},{"language":"default","tag":"Topics","count":5}]},"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},{"name":"sso-setup-deadline-banner","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}],"googleFontsInlined":true},"customCss":[],"page":{"pagePath":"guides/errors","slug":"/guides/errors","pageMetadata":{"title":"Errors","description":"The error envelope, the codes you can get, and how to handle them.","href":"/guides/errors"},"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: \"The error envelope, the codes you can get, and how to handle them.\"\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={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Every failure returns the same envelope — never alongside `,_jsx(_components.code,{children:`data`}),`:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`9`,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:`9`,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:` \"error\"`}),_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:` \"code\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"VALIDATION_ERROR\"`}),_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:` \"message\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Domain is not a valid hostname\"`}),_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:` \"details\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"field\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"domain\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"code\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"INVALID_FORMAT\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"message\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Domain is not a valid hostname\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`code`}),` and `,_jsx(_components.code,{children:`message`}),` are always present; `,_jsx(_components.code,{children:`details`}),` only appears on field-level\nfailures.`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`Branch on `,_jsx(_components.code,{children:`error.code`}),`, never on `,_jsx(_components.code,{children:`error.message`}),`. Messages are written for\nhumans and change without notice; codes are a contract.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`codes`,children:`Codes`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Status`}),_jsx(_components.th,{children:`Code`}),_jsx(_components.th,{children:`When`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`BAD_REQUEST`})}),_jsx(_components.td,{children:`A parameter is malformed or a required one is missing — e.g. a date that won’t parse.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`401`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`UNAUTHORIZED`})}),_jsxs(_components.td,{children:[`No `,_jsx(_components.code,{children:`X-API-KEY`}),` header, or the key is unknown, revoked, or expired.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`403`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`FORBIDDEN`})}),_jsx(_components.td,{children:`The key is valid but the path isn’t part of the public API, or the brand belongs to another organization.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`404`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`NOT_FOUND`})}),_jsx(_components.td,{children:`The brand, prompt, topic, competitor or ad doesn’t exist — including a brand that’s been soft-deleted.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`422`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`VALIDATION_ERROR`})}),_jsxs(_components.td,{children:[`The payload parsed but failed validation. Look at `,_jsx(_components.code,{children:`details`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`422`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`USAGE_LIMIT_REACHED`})}),_jsxs(_components.td,{children:[`A write would push your subscription past its prompt/region limits. `,_jsx(_components.strong,{children:`The whole batch is rolled back`}),` — nothing partial is written.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`429`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`RATE_LIMITED`})}),_jsxs(_components.td,{children:[`Too many requests. See `,_jsx(_components.a,{href:`/guides/rate-limits`,children:`Rate limits`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`500`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`INTERNAL_ERROR`})}),_jsx(_components.td,{children:`Something broke on our side. Safe to retry with backoff; if it persists, get in touch.`})]})]})]}),`\n`,_jsx(Heading,{level:`3`,id:`field-codes`,children:`Field codes`}),`\n`,_jsxs(_components.p,{children:[`Inside `,_jsx(_components.code,{children:`details[].code`}),` on a `,_jsx(_components.code,{children:`VALIDATION_ERROR`}),`:`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Code`}),_jsx(_components.th,{children:`Meaning`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`REQUIRED`})}),_jsx(_components.td,{children:`The field is missing or empty.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`INVALID_FORMAT`})}),_jsx(_components.td,{children:`Present but malformed (a domain that isn’t a hostname, a bad UUID).`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`OUT_OF_RANGE`})}),_jsx(_components.td,{children:`A number or date outside the accepted range.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`DUPLICATE`})}),_jsx(_components.td,{children:`Conflicts with something that already exists.`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`partial-success-on-bulk-writes`,children:`Partial success on bulk writes`}),`\n`,_jsxs(_components.p,{children:[`Bulk endpoints are not all-or-nothing in the same way. `,_jsx(_components.code,{children:`create_brand_prompts`}),`\nwrites the valid rows and reports the rest in the response body — a `,_jsx(_components.code,{children:`201`}),` can\nstill contain failures:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`10`,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:`10`,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:` \"data\"`}),_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:` \"total_prompts\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`12`}),_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:` \"prompts_added\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`10`}),_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:` \"prompts_failed\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`2`}),_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:` \"duplicates\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"best crm for startups\"`}),_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:` \"invalid_regions\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"xx\"`}),_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:` \"errors_and_warnings\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [ ]`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Check `,_jsx(_components.code,{children:`prompts_failed`}),` and `,_jsx(_components.code,{children:`errors_and_warnings`}),` even on a success status.`]}),`\n`,_jsxs(_components.p,{children:[`The one exception is `,_jsx(_components.strong,{children:`usage limits`}),`: if the batch as a whole would exceed\nyour subscription, the entire mutation is rolled back and you get a `,_jsx(_components.code,{children:`422`}),`\n`,_jsx(_components.code,{children:`USAGE_LIMIT_REACHED`}),` instead — no rows are written.`]}),`\n`,_jsx(Heading,{level:`2`,id:`handling-errors`,children:`Handling errors`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`401`}),` — stop retrying. The key is bad, revoked, or expired; retrying won’t\nfix it.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`403`}),` — you’re calling an endpoint outside the public surface, or a brand\nyour org doesn’t own. Also not retryable.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`404`}),` — treat as terminal. A soft-deleted brand starts returning it\nmid-integration, so handle it as “gone”, not as a transient failure.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`422`}),` — a bug in your payload. Log `,_jsx(_components.code,{children:`details`}),` and fix the caller.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`429`}),` — back off exponentially and retry. Don’t rotate keys to get around\nit; the per-IP backstop catches that too.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`500`}),` — retry with backoff, cap the attempts, and alert if it sticks.`]}),`\n`]})]})}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":"Errors","description":"The error envelope, the codes you can get, and how to handle them.","href":"/guides/errors"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Codes","slug":"codes","depth":2,"children":[{"title":"Field codes","slug":"field-codes","depth":3,"children":[]}]},{"title":"Partial success on bulk writes","slug":"partial-success-on-bulk-writes","depth":2,"children":[]},{"title":"Handling errors","slug":"handling-errors","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"cognizo","siteName":"Cognizo Docs","title":"Errors - Cognizo Docs","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-08-05T21:46:10.646Z","originalFileLocation":"guides/errors.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=\"The error envelope, the codes you can get, and how to handle them.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Cognizo 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/cognizo/gUxCvqimeXGJ3dX1/_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/cognizo/gUxCvqimeXGJ3dX1/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/cognizo/gUxCvqimeXGJ3dX1/_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/cognizo/gUxCvqimeXGJ3dX1/_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/cognizo/gUxCvqimeXGJ3dX1/_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/cognizo/gUxCvqimeXGJ3dX1/_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/cognizo/gUxCvqimeXGJ3dX1/_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/cognizo/gUxCvqimeXGJ3dX1/_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/cognizo/gUxCvqimeXGJ3dX1/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Errors - Cognizo Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"The error envelope, the codes you can get, and how to handle them.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Cognizo Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.cognizo.ai/guides/errors\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://cognizo.mintlify.app/_mintlify/api/og/v2?division=Guides\u0026amp;title=Errors\u0026amp;description=The+error+envelope%2C+the+codes+you+can+get%2C+and+how+to+handle+them.\u0026amp;theme=ba2aed5c62369492a9ac6532\u0026amp;signature=430cc7e9e2815a9eb83a8182d21876689f87075d833302e98484af2ed4dcc385\">\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=\"Errors - Cognizo Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"The error envelope, the codes you can get, and how to handle them.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://cognizo.mintlify.app/_mintlify/api/og/v2?division=Guides\u0026amp;title=Errors\u0026amp;description=The+error+envelope%2C+the+codes+you+can+get%2C+and+how+to+handle+them.\u0026amp;theme=ba2aed5c62369492a9ac6532\u0026amp;signature=430cc7e9e2815a9eb83a8182d21876689f87075d833302e98484af2ed4dcc385\">\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/cognizo/gUxCvqimeXGJ3dX1/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Cognizo Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#6C4CF1\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.cognizo.ai/guides/errors\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/guides/errors.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.cognizo.ai/#organization\",\"name\":\"Cognizo Docs\",\"url\":\"https://docs.cognizo.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/cognizo/x-lz_CTiDXjk7exn/images/cognizo-logo.png?fit=max\u0026auto=format\u0026n=x-lz_CTiDXjk7exn\u0026q=85\u0026s=beb92c1c8994be1c625caf4c4840ba0b\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.cognizo.ai#website\",\"name\":\"Cognizo Docs\",\"url\":\"https://docs.cognizo.ai\",\"publisher\":{\"@id\":\"https://docs.cognizo.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.cognizo.ai/guides/errors#webpage\",\"url\":\"https://docs.cognizo.ai/guides/errors\",\"name\":\"Errors\",\"description\":\"The error envelope, the codes you can get, and how to handle them.\",\"dateModified\":\"2026-08-05T21:46:10.646Z\",\"isPartOf\":{\"@id\":\"https://docs.cognizo.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.cognizo.ai/guides/errors#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.cognizo.ai/guides/errors#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Guides\",\"item\":\"https://docs.cognizo.ai/guides/authentication\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Errors\",\"item\":\"https://docs.cognizo.ai/guides/errors\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.cognizo.ai/guides/errors#article\",\"headline\":\"Errors\",\"name\":\"Errors\",\"description\":\"The error envelope, the codes you can get, and how to handle them.\",\"url\":\"https://docs.cognizo.ai/guides/errors\",\"mainEntityOfPage\":{\"@id\":\"https://docs.cognizo.ai/guides/errors#webpage\"},\"dateModified\":\"2026-08-05T21:46:10.646Z\",\"publisher\":{\"@id\":\"https://docs.cognizo.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.cognizo.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Cognizo Docs\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Cognizo Docs","nav":{"global":null,"tabs":[{"tab":"Guides","groups":[{"group":"Get started","pages":[{"title":"Cognizo API","href":""},{"title":"Quickstart","href":"/quickstart"}]},{"group":"Guides","pages":[{"title":"Authentication","href":"/guides/authentication"},{"title":"Pagination \u0026 filtering","href":"/guides/pagination-filtering"},{"title":"Metrics \u0026 units","description":"What visibility, share of voice and sentiment actually measure — and the units traps.","href":"/guides/metrics"},{"title":"Errors","href":"/guides/errors"},{"title":"Rate limits","description":"Limits, the 429 response, and how to back off.","href":"/guides/rate-limits"}]}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/api-reference/introduction"}]},{"tab":"MCP","pages":[{"title":"MCP","href":"/mcp/overview"}]}]},"basePath":"","title":"Errors - Cognizo Docs","buildId":"dpl_345ReqzYaAjzS9QpeJemsKdb7KDj","deploymentId":"dpl_345ReqzYaAjzS9QpeJemsKdb7KDj","dynamics":[],"chunks":[]}