{"docsConfig":{"theme":"maple","themeVersion":2,"$schema":"https://mintlify.com/docs.json","name":"PostChamp Docs","description":"How to use PostChamp: write, design, schedule and grow on LinkedIn, plus the public API and MCP server.","colors":{"primary":"#0765ff","light":"#5b9bff","dark":"#0552d6"},"logo":{"light":"/logo/light.svg","dark":"/logo/dark.svg","href":"https://postchampai.com"},"favicon":"/favicon.svg","api":{"openapi":"api-reference/openapi.json","playground":{"display":"interactive"},"examples":{"languages":["curl","javascript","python"]}},"appearance":{"default":"system"},"navbar":{"links":[{"href":"mailto:[email protected]","label":"Support"},{"href":"https://postchampai.com","label":"postchampai.com"}],"primary":{"type":"button","label":"Open PostChamp","href":"https://app.postchampai.com"}},"footer":{"socials":{"website":"https://postchampai.com"}},"seo":{"metatags":{"og:site_name":"PostChamp Docs"},"indexing":"navigable"},"fonts":{"family":"Geist"},"icons":{"library":"lucide"},"contextual":{"options":["copy","view","chatgpt","claude","cursor","vscode"],"display":"header"},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"hasAudioNarration":false,"customDomains":[],"gitSource":{"type":"github","owner":"local","repo":"local","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":"local","isBase":true},"buildId":"local","clientVersion":"0.0.4458"},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[],"googleFontsInlined":true,"isLoggedInCli":false},"customCss":[]}
{"page":{"pagePath":"api/authentication","slug":"/api/authentication","pageMetadata":{"title":"API authentication","sidebarTitle":"Authentication","description":"Create, name, scope, expire and revoke PostChamp API keys, and send them in the x-api-key header.","keywords":["api key","x-api-key","authentication","revoke","scope"],"tag":"Studio plan","href":"/api/authentication"},"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: \"Create, name, scope, expire and revoke PostChamp API keys, and send them in the x-api-key header.\"\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];const Shot=({id,alt,caption})=>{const{Frame}=_provideComponents()||{};if(!Frame)_missingMdxReference(`Frame`,true);return _jsxs(Frame,{caption,children:[_jsx(`img`,{className:`mint-block dark:mint-hidden`,src:`/images/${id}.png`,alt}),_jsx(`img`,{className:`mint-hidden dark:mint-block`,src:`/images/${id}-dark.png`,alt})]})};const api_last_used_every_seconds=`60`;const feature_api_access=`Studio`;const api_name_chars=`60`;const api_live_keys_per_organization=`50`;const api_key_prefix=`pc_live_`;const settings_api_keys_url=`https://app.postchampai.com/settings/api-keys`;const settings_api_keys_label=`Settings → API keys`;function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{Accordion,AccordionGroup,Card,CodeBlock,Columns,Heading,Info,Table,Warning,_MdxComponentBoundary}=_components;if(!Accordion)_missingMdxReference(`Accordion`,true);if(!AccordionGroup)_missingMdxReference(`AccordionGroup`,true);if(!Card)_missingMdxReference(`Card`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Columns)_missingMdxReference(`Columns`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Info)_missingMdxReference(`Info`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);if(!_MdxComponentBoundary)_missingMdxReference(`_MdxComponentBoundary`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Every API call carries an API key in the `,_jsx(_components.code,{children:`x-api-key`}),` header. A key acts as the person who created it.`]}),`\n`,_jsx(CodeBlock,{numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{children:`curl`}),_jsx(_components.span,{children:` https://api.postchampai.com/api/v1/credits`}),_jsx(_components.span,{children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{children:` -H`}),_jsx(_components.span,{children:` \"x-api-key: pc_live_xxx\"`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Only `,_jsx(_components.code,{children:`x-api-key`}),` is accepted on the public API. Browser cookies, `,_jsx(_components.code,{children:`Authorization`}),` headers and OAuth tokens are ignored there, and a key is not read anywhere else. The `,_jsx(_components.a,{href:`/mcp/authentication`,children:`MCP server`}),` uses a browser sign-in instead of a key.`]}),`\n`,_jsxs(Info,{children:[`Keys are on the `,feature_api_access,` plan. Only owners can create, rename and revoke them. Admins and other roles see a read-only notice on the page.`]}),`\n`,_jsx(Heading,{level:`2`,id:`create-a-key`,children:`Create a key`}),`\n`,_jsx(_MdxComponentBoundary,{name:`Shot`,children:_jsx(Shot,{id:`api/keys-list`,alt:`Settings, API keys, with one key in the list`,caption:`1. Create API key. 2. The key list: name, masked key, workspace, creator, dates. 3. Row actions: Rename and Revoke.`})}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`Open `,_jsx(_components.a,{href:settings_api_keys_url,children:settings_api_keys_label}),`.`]}),`\n`,_jsxs(_components.li,{children:[`Select `,_jsx(_components.strong,{children:`Create API key`}),`.`]}),`\n`,_jsxs(_components.li,{children:[`Fill in the dialog, then select `,_jsx(_components.strong,{children:`Create key`}),`.`]}),`\n`]}),`\n`,_jsx(_MdxComponentBoundary,{name:`Shot`,children:_jsx(Shot,{id:`api/keys-create`,alt:`The Create API key dialog with the name Zapier typed in`,caption:`1. Name. 2. Workspace. 3. Expires. 4. Create key.`})}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Field`}),_jsx(_components.th,{children:`What it does`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Name`})}),_jsxs(_components.td,{children:[`Required, up to `,api_name_chars,` characters. Name it after the tool that uses it, such as “Zapier” or “Weekly report script”. You can rename it later.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Workspace`})}),_jsxs(_components.td,{children:[_jsx(_components.strong,{children:`All workspaces`}),` (every workspace you can open) or one workspace. A key scoped to one workspace gets `,_jsx(_components.code,{children:`404 not_found`}),` for every other workspace.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Expires (optional)`})}),_jsxs(_components.td,{children:[`A date at least a day ahead. After it the key answers `,_jsx(_components.code,{children:`401 api_key_invalid`}),`.`]})]})]})]}),`\n`,_jsxs(_components.p,{children:[`After you select `,_jsx(_components.strong,{children:`Create key`}),`, the full key appears once. Select `,_jsx(_components.strong,{children:`Copy`}),` and store it in your secrets manager. It starts with `,_jsx(`code`,{children:api_key_prefix}),`.`]}),`\n`,_jsx(Warning,{children:`You cannot see the key again. PostChamp keeps only a SHA-256 hash, the first characters and the last four, so it cannot show the key a second time. If you lose it, revoke it and create a new one.`}),`\n`,_jsx(Heading,{level:`3`,id:`creating-a-key-over-the-api`,children:`Creating a key over the API`}),`\n`,_jsx(_components.p,{children:`Key management is not part of the public API. Keys cannot create or list keys. The key endpoints work only with a signed-in owner session, so use the app.`}),`\n`,_jsx(Heading,{level:`2`,id:`what-a-key-can-do`,children:`What a key can do`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`It acts as its creator.`}),` Calls run with the creator’s current role in the workspace. Viewers can read, editors and above can write. If the creator’s role changes, the key follows it.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`It uses the organization’s credits.`}),` Generation spends credits exactly as in the app. See `,_jsx(_components.a,{href:`/api/rate-limits`,children:`Rate limits`}),` for the separate request limits.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Client reviewers are refused.`}),` If the creator is later made a client reviewer, calls answer `,_jsx(_components.code,{children:`404 not_found`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`It stops when the creator leaves.`}),` If the creator is removed from the organization, the key answers `,_jsx(_components.code,{children:`401 api_key_invalid`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Actions are logged.`}),` Audit entries for scheduling record that an API key did it, with the key’s prefix.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`limits`,children:`Limits`}),`\n`,_jsxs(_components.p,{children:[`An organization can hold up to `,api_live_keys_per_organization,` live (not revoked) keys. Creating more answers `,_jsx(_components.code,{children:`422 too_many_api_keys`}),`. Revoke a key you no longer use.`]}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.strong,{children:`Last used`}),` column updates at most once every `,api_last_used_every_seconds,` seconds per key.`]}),`\n`,_jsx(Heading,{level:`2`,id:`rename-and-revoke`,children:`Rename and revoke`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Rename:`}),` open the row menu, select `,_jsx(_components.strong,{children:`Rename`}),`, edit the name and save.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Revoke:`}),` open the row menu, select `,_jsx(_components.strong,{children:`Revoke`}),`, then `,_jsx(_components.strong,{children:`Revoke key`}),`. Apps using the key stop working right away. Open job streams that used the key close within about 15 seconds. Revoking cannot be undone.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`keep-keys-safe`,children:`Keep keys safe`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Keep keys on your server or in a secrets manager. Never put one in a browser app, a mobile app or a public repository.`}),`\n`,_jsx(_components.li,{children:`Use one key per tool, so you can revoke one without breaking the others.`}),`\n`,_jsx(_components.li,{children:`Scope a key to one workspace when a tool needs only that workspace, and set an expiry for temporary work.`}),`\n`,_jsx(_components.li,{children:`Rotate by creating the new key first, switching your tool, then revoking the old key.`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`key-errors`,children:`Key errors`}),`\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:`Reason`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`401`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`api_key_required`})}),_jsxs(_components.td,{children:[`No `,_jsx(_components.code,{children:`x-api-key`}),` header.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`401`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`api_key_invalid`})}),_jsx(_components.td,{children:`Unknown, revoked or expired key, or its creator left. One answer for all cases, so keys cannot be probed.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`402`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`subscription_required`})}),_jsx(_components.td,{children:`The organization has no live subscription.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`403`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`plan_limit`})}),_jsx(_components.td,{children:`The plan has no API access.`})]}),_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 creator’s current role cannot do this.`})]}),_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 workspace is outside the key’s scope, or the creator is a client reviewer.`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`troubleshooting`,children:`Troubleshooting`}),`\n`,_jsxs(AccordionGroup,{children:[_jsx(Accordion,{title:`The page says only owners can manage keys`,id:`the-page-says-only-owners-can-manage-keys`,children:_jsx(_components.p,{children:`Ask an owner of the organization to create the key. Admins can open the page but not change it.`})}),_jsx(Accordion,{title:`The page asks me to upgrade`,id:`the-page-asks-me-to-upgrade`,children:_jsxs(_components.p,{children:[`Your plan does not include API access. It is on the `,feature_api_access,` plan.`]})}),_jsx(Accordion,{title:`There is no API keys page on a client domain`,id:`there-is-no-api-keys-page-on-a-client-domain`,children:_jsx(_components.p,{children:`On a white-label domain, keys are not available. Open the app on the main address.`})})]}),`\n`,_jsxs(Columns,{cols:2,children:[_jsx(Card,{title:`Quickstart`,icon:`rocket`,href:`/api/quickstart`,children:`Make your first call.`}),_jsx(Card,{title:`Errors`,icon:`triangle-alert`,href:`/api/errors`,children:`All error codes.`})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{Shot,api_last_used_every_seconds,feature_api_access,api_name_chars,api_live_keys_per_organization,api_key_prefix,settings_api_keys_url,settings_api_keys_label,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":"API authentication","sidebarTitle":"Authentication","description":"Create, name, scope, expire and revoke PostChamp API keys, and send them in the x-api-key header.","keywords":["api key","x-api-key","authentication","revoke","scope"],"tag":"Studio plan","href":"/api/authentication"}}},"mdxSourceWithNoJs":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];const Shot=({id,alt,caption})=>{const{Frame}=_provideComponents()||{};if(!Frame)_missingMdxReference(`Frame`,true);return _jsxs(Frame,{caption,children:[_jsx(`img`,{className:`mint-block dark:mint-hidden`,src:`/images/${id}.png`,alt}),_jsx(`img`,{className:`mint-hidden dark:mint-block`,src:`/images/${id}-dark.png`,alt})]})};const api_last_used_every_seconds=`60`;const feature_api_access=`Studio`;const api_name_chars=`60`;const api_live_keys_per_organization=`50`;const api_key_prefix=`pc_live_`;const settings_api_keys_url=`https://app.postchampai.com/settings/api-keys`;const settings_api_keys_label=`Settings → API keys`;function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{Accordion,AccordionGroup,Card,CodeBlock,Columns,Heading,Info,Table,Warning,_MdxComponentBoundary}=_components;if(!Accordion)_missingMdxReference(`Accordion`,true);if(!AccordionGroup)_missingMdxReference(`AccordionGroup`,true);if(!Card)_missingMdxReference(`Card`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Columns)_missingMdxReference(`Columns`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Info)_missingMdxReference(`Info`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);if(!_MdxComponentBoundary)_missingMdxReference(`_MdxComponentBoundary`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Every API call carries an API key in the `,_jsx(_components.code,{children:`x-api-key`}),` header. A key acts as the person who created it.`]}),`\n`,_jsx(CodeBlock,{numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{children:`curl`}),_jsx(_components.span,{children:` https://api.postchampai.com/api/v1/credits`}),_jsx(_components.span,{children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{children:` -H`}),_jsx(_components.span,{children:` \"x-api-key: pc_live_xxx\"`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Only `,_jsx(_components.code,{children:`x-api-key`}),` is accepted on the public API. Browser cookies, `,_jsx(_components.code,{children:`Authorization`}),` headers and OAuth tokens are ignored there, and a key is not read anywhere else. The `,_jsx(_components.a,{href:`/mcp/authentication`,children:`MCP server`}),` uses a browser sign-in instead of a key.`]}),`\n`,_jsxs(Info,{children:[`Keys are on the `,`Studio`,` plan. Only owners can create, rename and revoke them. Admins and other roles see a read-only notice on the page.`]}),`\n`,_jsx(Heading,{level:`2`,id:`create-a-key`,children:`Create a key`}),`\n`,_jsx(_MdxComponentBoundary,{name:`Shot`,children:_jsx(Shot,{id:`api/keys-list`,alt:`Settings, API keys, with one key in the list`,caption:`1. Create API key. 2. The key list: name, masked key, workspace, creator, dates. 3. Row actions: Rename and Revoke.`})}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`Open `,_jsx(_components.a,{href:settings_api_keys_url,children:`Settings → API keys`}),`.`]}),`\n`,_jsxs(_components.li,{children:[`Select `,_jsx(_components.strong,{children:`Create API key`}),`.`]}),`\n`,_jsxs(_components.li,{children:[`Fill in the dialog, then select `,_jsx(_components.strong,{children:`Create key`}),`.`]}),`\n`]}),`\n`,_jsx(_MdxComponentBoundary,{name:`Shot`,children:_jsx(Shot,{id:`api/keys-create`,alt:`The Create API key dialog with the name Zapier typed in`,caption:`1. Name. 2. Workspace. 3. Expires. 4. Create key.`})}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Field`}),_jsx(_components.th,{children:`What it does`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Name`})}),_jsxs(_components.td,{children:[`Required, up to `,`60`,` characters. Name it after the tool that uses it, such as “Zapier” or “Weekly report script”. You can rename it later.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Workspace`})}),_jsxs(_components.td,{children:[_jsx(_components.strong,{children:`All workspaces`}),` (every workspace you can open) or one workspace. A key scoped to one workspace gets `,_jsx(_components.code,{children:`404 not_found`}),` for every other workspace.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Expires (optional)`})}),_jsxs(_components.td,{children:[`A date at least a day ahead. After it the key answers `,_jsx(_components.code,{children:`401 api_key_invalid`}),`.`]})]})]})]}),`\n`,_jsxs(_components.p,{children:[`After you select `,_jsx(_components.strong,{children:`Create key`}),`, the full key appears once. Select `,_jsx(_components.strong,{children:`Copy`}),` and store it in your secrets manager. It starts with `,_jsx(`code`,{children:`pc_live_`}),`.`]}),`\n`,_jsx(Warning,{children:`You cannot see the key again. PostChamp keeps only a SHA-256 hash, the first characters and the last four, so it cannot show the key a second time. If you lose it, revoke it and create a new one.`}),`\n`,_jsx(Heading,{level:`3`,id:`creating-a-key-over-the-api`,children:`Creating a key over the API`}),`\n`,_jsx(_components.p,{children:`Key management is not part of the public API. Keys cannot create or list keys. The key endpoints work only with a signed-in owner session, so use the app.`}),`\n`,_jsx(Heading,{level:`2`,id:`what-a-key-can-do`,children:`What a key can do`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`It acts as its creator.`}),` Calls run with the creator’s current role in the workspace. Viewers can read, editors and above can write. If the creator’s role changes, the key follows it.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`It uses the organization’s credits.`}),` Generation spends credits exactly as in the app. See `,_jsx(_components.a,{href:`/api/rate-limits`,children:`Rate limits`}),` for the separate request limits.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Client reviewers are refused.`}),` If the creator is later made a client reviewer, calls answer `,_jsx(_components.code,{children:`404 not_found`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`It stops when the creator leaves.`}),` If the creator is removed from the organization, the key answers `,_jsx(_components.code,{children:`401 api_key_invalid`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Actions are logged.`}),` Audit entries for scheduling record that an API key did it, with the key’s prefix.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`limits`,children:`Limits`}),`\n`,_jsxs(_components.p,{children:[`An organization can hold up to `,`50`,` live (not revoked) keys. Creating more answers `,_jsx(_components.code,{children:`422 too_many_api_keys`}),`. Revoke a key you no longer use.`]}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.strong,{children:`Last used`}),` column updates at most once every `,`60`,` seconds per key.`]}),`\n`,_jsx(Heading,{level:`2`,id:`rename-and-revoke`,children:`Rename and revoke`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Rename:`}),` open the row menu, select `,_jsx(_components.strong,{children:`Rename`}),`, edit the name and save.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Revoke:`}),` open the row menu, select `,_jsx(_components.strong,{children:`Revoke`}),`, then `,_jsx(_components.strong,{children:`Revoke key`}),`. Apps using the key stop working right away. Open job streams that used the key close within about 15 seconds. Revoking cannot be undone.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`keep-keys-safe`,children:`Keep keys safe`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Keep keys on your server or in a secrets manager. Never put one in a browser app, a mobile app or a public repository.`}),`\n`,_jsx(_components.li,{children:`Use one key per tool, so you can revoke one without breaking the others.`}),`\n`,_jsx(_components.li,{children:`Scope a key to one workspace when a tool needs only that workspace, and set an expiry for temporary work.`}),`\n`,_jsx(_components.li,{children:`Rotate by creating the new key first, switching your tool, then revoking the old key.`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`key-errors`,children:`Key errors`}),`\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:`Reason`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`401`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`api_key_required`})}),_jsxs(_components.td,{children:[`No `,_jsx(_components.code,{children:`x-api-key`}),` header.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`401`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`api_key_invalid`})}),_jsx(_components.td,{children:`Unknown, revoked or expired key, or its creator left. One answer for all cases, so keys cannot be probed.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`402`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`subscription_required`})}),_jsx(_components.td,{children:`The organization has no live subscription.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`403`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`plan_limit`})}),_jsx(_components.td,{children:`The plan has no API access.`})]}),_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 creator’s current role cannot do this.`})]}),_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 workspace is outside the key’s scope, or the creator is a client reviewer.`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`troubleshooting`,children:`Troubleshooting`}),`\n`,_jsxs(AccordionGroup,{children:[_jsx(Accordion,{title:`The page says only owners can manage keys`,id:`the-page-says-only-owners-can-manage-keys`,children:_jsx(_components.p,{children:`Ask an owner of the organization to create the key. Admins can open the page but not change it.`})}),_jsx(Accordion,{title:`The page asks me to upgrade`,id:`the-page-asks-me-to-upgrade`,children:_jsxs(_components.p,{children:[`Your plan does not include API access. It is on the `,`Studio`,` plan.`]})}),_jsx(Accordion,{title:`There is no API keys page on a client domain`,id:`there-is-no-api-keys-page-on-a-client-domain`,children:_jsx(_components.p,{children:`On a white-label domain, keys are not available. Open the app on the main address.`})})]}),`\n`,_jsxs(Columns,{cols:2,children:[_jsx(Card,{title:`Quickstart`,icon:`rocket`,href:`/api/quickstart`,children:`Make your first call.`}),_jsx(Card,{title:`Errors`,icon:`triangle-alert`,href:`/api/errors`,children:`All error codes.`})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{Shot,api_last_used_every_seconds,feature_api_access,api_name_chars,api_live_keys_per_organization,api_key_prefix,settings_api_keys_url,settings_api_keys_label,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":"API authentication","sidebarTitle":"Authentication","description":"Create, name, scope, expire and revoke PostChamp API keys, and send them in the x-api-key header.","keywords":["api key","x-api-key","authentication","revoke","scope"],"tag":"Studio plan","href":"/api/authentication"}}}},"mdxExtracts":{"tableOfContents":[{"title":"Create a key","slug":"create-a-key","depth":2,"children":[{"title":"Creating a key over the API","slug":"creating-a-key-over-the-api","depth":3,"children":[]}]},{"title":"What a key can do","slug":"what-a-key-can-do","depth":2,"children":[]},{"title":"Limits","slug":"limits","depth":2,"children":[]},{"title":"Rename and revoke","slug":"rename-and-revoke","depth":2,"children":[]},{"title":"Keep keys safe","slug":"keep-keys-safe","depth":2,"children":[]},{"title":"Key errors","slug":"key-errors","depth":2,"children":[]},{"title":"Troubleshooting","slug":"troubleshooting","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"dynamicCss":".mint-block {\n display: block\n}\n.mint-hidden {\n display: none\n}\n.dark\\:mint-block:is(.dark *) {\n display: block\n}\n.dark\\:mint-hidden:is(.dark *) {\n display: none\n}","subdomain":"localhost","siteName":"PostChamp Docs","title":"API authentication - PostChamp Docs","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"originalFileLocation":"api/authentication.mdx","highlights":{"ugvw6s-2m":{"background":null,"blockClass":"","chunked":false,"dense":false,"diff":false,"focus":false,"html":"curl https://api.postchampai.com/api/v1/credits \\\n -H \"x-api-key: pc_live_xxx\"\n","language":"shellscript","lineCount":2,"marked":false,"meta":false,"popups":[],"styles":[{"css":".cb-code{--cb-theme-bg:#ffffff;--cb-theme-bg:light-dark(#ffffff,#1E1E1E);--cb-theme-fg:#1f2328;--cb-theme-fg:light-dark(#1f2328,#D4D4D4)}","id":".cb-code"},{"css":"z0{color:#953800;color:light-dark(#953800,#DCDCAA)}","id":"z0"},{"css":"z1{color:#0A3069;color:light-dark(#0A3069,#CE9178)}","id":"z1"},{"css":"z2{color:#CF222E;color:light-dark(#CF222E,#D7BA7D)}","id":"z2"},{"css":"z3{color:#0550AE;color:light-dark(#0550AE,#569CD6)}","id":"z3"}]}}},"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=\"Create, name, scope, expire and revoke PostChamp API keys, and send them in the x-api-key header.\">\u003cmeta data-mint-head name=\"application-name\" content=\"PostChamp Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/favicons/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/favicons/favicon-32x32.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/favicons/favicon-16x16.png\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/favicons/favicon.ico\">\u003cmeta data-mint-head property=\"og:title\" content=\"API authentication - PostChamp Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Create, name, scope, expire and revoke PostChamp API keys, and send them in the x-api-key header.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"PostChamp Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://local./api/authentication\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://docs.postchampai.com/_mintlify/og/api/authentication.png\">\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=\"API authentication - PostChamp Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Create, name, scope, expire and revoke PostChamp API keys, and send them in the x-api-key header.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://docs.postchampai.com/_mintlify/og/api/authentication.png\">\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=\"/favicons/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"PostChamp Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0765ff\">\u003clink data-mint-head rel=\"canonical\" href=\"https://local./api/authentication\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api/authentication.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"PostChamp Docs\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"PostChamp Docs\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api/authentication.md","siteName":"PostChamp Docs","nav":{"tabs":[{"tab":"Guides","icon":"book-open","pages":[{"title":"Guides","href":""}]},{"tab":"API reference","icon":"code","groups":[{"group":"Get started","pages":[{"title":"API overview","sidebarTitle":"Overview","tag":"Studio plan","href":"/api/overview"},{"title":"API quickstart","description":"Create an API key, check it, generate a LinkedIn post and schedule it, with curl, JavaScript and Python.","sidebarTitle":"Quickstart","tag":"Studio plan","href":"/api/quickstart"},{"title":"API authentication","sidebarTitle":"Authentication","tag":"Studio plan","href":"/api/authentication"},{"title":"Idempotency","description":"Send an Idempotency-Key on every call that spends credits, so a retry after a timeout never charges twice.","href":"/api/idempotency"},{"title":"Pagination","href":"/api/pagination"},{"title":"API errors","sidebarTitle":"Errors","href":"/api/errors"},{"title":"Rate limits","href":"/api/rate-limits"},{"title":"Jobs and streaming","href":"/api/jobs-and-streaming"}]},{"group":"Recipes","pages":[{"title":"Recipe: generate and schedule a post","sidebarTitle":"Generate and schedule","tag":"Studio plan","href":"/api/recipes/generate-and-schedule"},{"title":"Recipe: carousels","sidebarTitle":"Carousels","tag":"Studio plan","href":"/api/recipes/carousels"},{"title":"Recipe: infographics","sidebarTitle":"Infographics","tag":"Studio plan","href":"/api/recipes/infographics"},{"title":"Recipe: content styles","sidebarTitle":"Content styles","tag":"Studio plan","href":"/api/recipes/content-styles"}]},{"group":"Endpoints","pages":[{"group":"Account","pages":[{"title":"Describe this API key","openapi":"/api-reference/openapi.json get /api/v1/key","href":"/api-reference/account/describe-this-api-key"},{"title":"Credit balance","openapi":"/api-reference/openapi.json get /api/v1/credits","href":"/api-reference/account/credit-balance"}]},{"group":"Carousels","pages":[{"title":"List carousel templates","openapi":"/api-reference/openapi.json get /api/v1/carousel-templates","href":"/api-reference/carousels/list-carousel-templates"},{"title":"Create an AI carousel","openapi":"/api-reference/openapi.json post /api/v1/workspaces/{workspaceId}/carousels","href":"/api-reference/carousels/create-an-ai-carousel"},{"title":"Get a carousel","openapi":"/api-reference/openapi.json get /api/v1/workspaces/{workspaceId}/carousels/{id}","href":"/api-reference/carousels/get-a-carousel"},{"title":"Change a carousel","openapi":"/api-reference/openapi.json post /api/v1/workspaces/{workspaceId}/carousels/{id}/changes","href":"/api-reference/carousels/change-a-carousel"}]},{"group":"Posts","pages":[{"title":"Generate a post (1–3 versions)","openapi":"/api-reference/openapi.json post /api/v1/workspaces/{workspaceId}/posts/generate","href":"/api-reference/posts/generate-a-post-1–3-versions"},{"title":"Generate 5 variations","openapi":"/api-reference/openapi.json post /api/v1/workspaces/{workspaceId}/posts/generate-batch","href":"/api-reference/posts/generate-5-variations"},{"title":"List posts","openapi":"/api-reference/openapi.json get /api/v1/workspaces/{workspaceId}/posts","href":"/api-reference/posts/list-posts"},{"title":"Save a post you wrote","openapi":"/api-reference/openapi.json post /api/v1/workspaces/{workspaceId}/posts","href":"/api-reference/posts/save-a-post-you-wrote"},{"title":"Post timeline","openapi":"/api-reference/openapi.json get /api/v1/workspaces/{workspaceId}/posts/timeline","href":"/api-reference/posts/post-timeline"},{"title":"Get a post","openapi":"/api-reference/openapi.json get /api/v1/workspaces/{workspaceId}/posts/{postId}","href":"/api-reference/posts/get-a-post"},{"title":"Delete a post","openapi":"/api-reference/openapi.json delete /api/v1/workspaces/{workspaceId}/posts/{postId}","href":"/api-reference/posts/delete-a-post"},{"title":"Update a post","openapi":"/api-reference/openapi.json patch /api/v1/workspaces/{workspaceId}/posts/{postId}","href":"/api-reference/posts/update-a-post"}]},{"group":"Scheduling","pages":[{"title":"Schedule a post","openapi":"/api-reference/openapi.json post /api/v1/workspaces/{workspaceId}/posts/{postId}/schedule","href":"/api-reference/scheduling/schedule-a-post"},{"title":"Cancel a schedule","openapi":"/api-reference/openapi.json post /api/v1/workspaces/{workspaceId}/posts/{postId}/cancel-schedule","href":"/api-reference/scheduling/cancel-a-schedule"}]},{"group":"Content styles","pages":[{"title":"List content styles","openapi":"/api-reference/openapi.json get /api/v1/workspaces/{workspaceId}/content-styles","href":"/api-reference/content-styles/list-content-styles"},{"title":"Create a content style","openapi":"/api-reference/openapi.json post /api/v1/workspaces/{workspaceId}/content-styles","href":"/api-reference/content-styles/create-a-content-style"},{"title":"Get a content style","openapi":"/api-reference/openapi.json get /api/v1/workspaces/{workspaceId}/content-styles/{styleId}","href":"/api-reference/content-styles/get-a-content-style"},{"title":"Archive a content style","openapi":"/api-reference/openapi.json delete /api/v1/workspaces/{workspaceId}/content-styles/{styleId}","href":"/api-reference/content-styles/archive-a-content-style"},{"title":"Update a content style","openapi":"/api-reference/openapi.json patch /api/v1/workspaces/{workspaceId}/content-styles/{styleId}","href":"/api-reference/content-styles/update-a-content-style"},{"title":"Add example posts to a style","openapi":"/api-reference/openapi.json post /api/v1/workspaces/{workspaceId}/content-styles/{styleId}/examples","href":"/api-reference/content-styles/add-example-posts-to-a-style"},{"title":"Remove an example from a style","openapi":"/api-reference/openapi.json delete /api/v1/workspaces/{workspaceId}/content-styles/{styleId}/examples/{index}","href":"/api-reference/content-styles/remove-an-example-from-a-style"}]},{"group":"Infographics","pages":[{"title":"List infographics","openapi":"/api-reference/openapi.json get /api/v1/workspaces/{workspaceId}/infographics","href":"/api-reference/infographics/list-infographics"},{"title":"Create an infographic","openapi":"/api-reference/openapi.json post /api/v1/workspaces/{workspaceId}/infographics","href":"/api-reference/infographics/create-an-infographic"},{"title":"Get an infographic","openapi":"/api-reference/openapi.json get /api/v1/workspaces/{workspaceId}/infographics/{id}","href":"/api-reference/infographics/get-an-infographic"},{"title":"Delete an infographic","openapi":"/api-reference/openapi.json delete /api/v1/workspaces/{workspaceId}/infographics/{id}","href":"/api-reference/infographics/delete-an-infographic"},{"title":"Edit an infographic","openapi":"/api-reference/openapi.json post /api/v1/workspaces/{workspaceId}/infographics/{id}/edit","href":"/api-reference/infographics/edit-an-infographic"}]},{"group":"Jobs","pages":[{"title":"Job status","openapi":"/api-reference/openapi.json get /api/v1/jobs/{jobId}","href":"/api-reference/jobs/job-status"},{"title":"Job progress (SSE)","openapi":"/api-reference/openapi.json get /api/v1/jobs/{jobId}/events","href":"/api-reference/jobs/job-progress-sse"}]}]}]},{"tab":"MCP","icon":"plug","pages":[{"title":"MCP","href":"/mcp/overview"}]},{"tab":"Changelog","icon":"clock","pages":[{"title":"Changelog","href":"/changelog"}]}]},"basePath":"","title":"API authentication - PostChamp Docs","buildId":"d1f31731afbf-v2-maple","dynamics":[],"chunks":[]}