Tokens are formatted as mp_<32 random URL-safe bytes> — about 43 characters
after the prefix. The full token is shown exactly once in the UI at
creation time and is never displayed again. Only its prefix (e.g.
mp_abc123) and metadata (name, created date, last used) are kept visible
afterwards.
Treat your tokens like passwords. Anyone with the token has the same access
to your MagicPost account as you do via the API.
From the web app: Settings → API & MCP → Create a key.The dialog asks for an optional name (e.g. Claude Desktop, My Cursor,
Internal cron script). The name has no functional effect — it just helps
you tell tokens apart in the list and audit which integration was active when.You can hold up to 10 active tokens per account. Revoked tokens don’t
count against the limit but remain visible in the history.
In Settings → API & MCP, hit Revoke on the token row. The change
propagates within 60 seconds (the MCP server caches token validity for
that long, so a revoked token may still work for up to a minute after
revocation).Revocation is irreversible. The MCP integration that uses that token will
start receiving 401 responses — create a new token to replace it.
The GET /api/v1/auth/verify endpoint is the canonical way to check whether
a token is currently valid. It returns the user record id, email and granted
scopes if the token is good:
All v1 tokens currently have a single scope: mcp:v1. It grants full access
to every /api/v1/* endpoint of the owning user. Finer-grained scopes (e.g.
read-only, or “post:write” only) will land in a future version — existing
tokens will keep their full access at that point.
✅ Store tokens in env vars or secret managers, never in client-side code
✅ Use a different token per device or integration so you can revoke
precisely if one leaks
✅ Rotate tokens occasionally (every ~6 months for high-value automations)
❌ Never commit tokens to git, even in a private repo
❌ Never paste a token in a public log, screenshot, or support thread —
revoke and recreate if you suspect leak
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"MagicPost Developers","colors":{"primary":"#7E4EFD","light":"#9B7AFC","dark":"#5C2EE0"},"logo":{"light":"https://mintcdn.com/magicpost/SaSZgOZZKTX6XPZW/logo/light.svg?fit=max\u0026auto=format\u0026n=SaSZgOZZKTX6XPZW\u0026q=85\u0026s=91ef517ec032ce57959b2887fdaec6b4","dark":"https://mintcdn.com/magicpost/SaSZgOZZKTX6XPZW/logo/dark.svg?fit=max\u0026auto=format\u0026n=SaSZgOZZKTX6XPZW\u0026q=85\u0026s=66a4662e6c8123c3b4412f0487fe0901"},"favicon":"https://mintcdn.com/magicpost/SaSZgOZZKTX6XPZW/favicon.svg?fit=max\u0026auto=format\u0026n=SaSZgOZZKTX6XPZW\u0026q=85\u0026s=713570e242b364ac57efc9b26c0d9ae9","navbar":{"links":[{"href":"https://app.magicpost.in","label":"App"}],"primary":{"type":"button","label":"Create API key","href":"https://app.magicpost.in/account?tab=api-keys"}},"footer":{"socials":{"x":"https://x.com/magicpost","linkedin":"https://linkedin.com/company/magicpost"}},"styling":{"latex":false},"navigation":{"global":{"anchors":[{"anchor":"Status","icon":"signal","href":"https://status.magicpost.in"},{"anchor":"Support","icon":"envelope","href":"mailto:support@magicpost.in"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"magicpost","hasAudioNarration":false,"actualSubdomain":"magicpost","customDomains":["dev.magicpost.in"],"gitSource":{"type":"github","owner":"magicpost","repo":"magicpost-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6acca741dda9cd5d54f7a0c6","clientVersion":"0.0.4087","searchFilterCounts":[{"language":"default","tag":"Guides","count":10},{"language":"default","tag":"API reference","count":6},{"language":"default","tag":"MCP integration","count":6},{"language":"default","tag":"Endpoints","count":5},{"language":"default","tag":"Essentials","count":2},{"language":"default","tag":"Getting started","count":2},{"language":"default","tag":"Overview","count":1}]},"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":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"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":"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":"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":"editor-metadata","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":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"comment-mode","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"essentials/authentication","slug":"/essentials/authentication","pageMetadata":{"title":"Authentication","description":"Personal Access Tokens (PATs) — how they work, where to use them, how to revoke them.","icon":"key","href":"/essentials/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: \"Personal Access Tokens (PATs) — how they work, where to use them, how to revoke 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={code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Every call to `,_jsx(_components.code,{children:`/api/v1/*`}),` and every MCP tool invocation must carry a\n`,_jsx(_components.strong,{children:`Personal Access Token`}),` (PAT) in the `,_jsx(_components.code,{children:`Authorization`}),` header:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,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:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`Authorization:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` Bearer`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` mp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`how-tokens-look`,children:`How tokens look`}),`\n`,_jsxs(_components.p,{children:[`Tokens are formatted as `,_jsx(_components.code,{children:`mp_\u003c32 random URL-safe bytes>`}),` — about 43 characters\nafter the prefix. The full token is shown `,_jsx(_components.strong,{children:`exactly once`}),` in the UI at\ncreation time and is never displayed again. Only its `,_jsx(_components.code,{children:`prefix`}),` (e.g.\n`,_jsx(_components.code,{children:`mp_abc123`}),`) and metadata (name, created date, last used) are kept visible\nafterwards.`]}),`\n`,_jsx(Warning,{children:_jsx(_components.p,{children:`Treat your tokens like passwords. Anyone with the token has the same access\nto your MagicPost account as you do via the API.`})}),`\n`,_jsx(Heading,{level:`2`,id:`creating-a-token`,children:`Creating a token`}),`\n`,_jsxs(_components.p,{children:[`From the web app: `,_jsx(_components.strong,{children:`Settings → API \u0026 MCP → Create a key`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`The dialog asks for an optional `,_jsx(_components.strong,{children:`name`}),` (e.g. `,_jsx(_components.code,{children:`Claude Desktop`}),`, `,_jsx(_components.code,{children:`My Cursor`}),`,\n`,_jsx(_components.code,{children:`Internal cron script`}),`). The name has no functional effect — it just helps\nyou tell tokens apart in the list and audit which integration was active when.`]}),`\n`,_jsxs(_components.p,{children:[`You can hold up to `,_jsx(_components.strong,{children:`10 active tokens`}),` per account. Revoked tokens don’t\ncount against the limit but remain visible in the history.`]}),`\n`,_jsx(Heading,{level:`2`,id:`using-a-token`,children:`Using a token`}),`\n`,_jsx(Heading,{level:`3`,id:`with-the-mcp-server`,children:`With the MCP server`}),`\n`,_jsxs(_components.p,{children:[`In your MCP client config (Claude Desktop, Cursor, claude.ai), pass the token\nas a header via `,_jsx(_components.code,{children:`mcp-remote`}),`:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`14`,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:`14`,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:` \"mcpServers\"`}),_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:` \"magicpost\"`}),_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:` \"command\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"npx\"`}),_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:` \"args\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"-y\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"mcp-remote\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://mcp.magicpost.in/mcp\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"--header\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization:Bearer mp_YOUR_TOKEN\"`})}),`\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`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`with-the-rest-api`,children:`With the REST API`}),`\n`,_jsx(_components.p,{children:`Just add the header to every request:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,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:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.magicpost.in/api/v1/auth/verify`}),_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 mp_YOUR_TOKEN\"`})]}),`\n`]})})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`6`,language:`python`,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:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`6`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` os, httpx`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`client `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` httpx.Client(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` base_url`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://api.magicpost.in/api/v1\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` headers`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Authorization\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Bearer `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`os.environ[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'MAGICPOST_TOKEN'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},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`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`client.get(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"/posts\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`params`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"scheduled\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`})`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`revoking-a-token`,children:`Revoking a token`}),`\n`,_jsxs(_components.p,{children:[`In `,_jsx(_components.strong,{children:`Settings → API \u0026 MCP`}),`, hit `,_jsx(_components.strong,{children:`Revoke`}),` on the token row. The change\npropagates within `,_jsx(_components.strong,{children:`60 seconds`}),` (the MCP server caches token validity for\nthat long, so a revoked token may still work for up to a minute after\nrevocation).`]}),`\n`,_jsx(_components.p,{children:`Revocation is irreversible. The MCP integration that uses that token will\nstart receiving 401 responses — create a new token to replace it.`}),`\n`,_jsx(Heading,{level:`2`,id:`verifying-a-token`,children:`Verifying a token`}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`GET /api/v1/auth/verify`}),` endpoint is the canonical way to check whether\na token is currently valid. It returns the user record id, email and granted\nscopes if the token is good:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,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:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.magicpost.in/api/v1/auth/verify`}),_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 mp_xxx\"`})]}),`\n`]})})}),`\n`,_jsx(CodeBlock,{filename:``,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:` \"user_record_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"recXXXXXXX\"`}),_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:` \"email\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"you@example.com\"`}),_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:` \"scopes\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"mcp:v1\"`}),_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`,_jsx(Heading,{level:`2`,id:`scopes`,children:`Scopes`}),`\n`,_jsxs(_components.p,{children:[`All v1 tokens currently have a single scope: `,_jsx(_components.code,{children:`mcp:v1`}),`. It grants full access\nto every `,_jsx(_components.code,{children:`/api/v1/*`}),` endpoint of the owning user. Finer-grained scopes (e.g.\nread-only, or “post:write” only) will land in a future version — existing\ntokens will keep their full access at that point.`]}),`\n`,_jsx(Heading,{level:`2`,id:`token-security-checklist`,children:`Token security checklist`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`✅ Store tokens in env vars or secret managers, never in client-side code`}),`\n`,_jsx(_components.li,{children:`✅ Use a different token per device or integration so you can revoke\nprecisely if one leaks`}),`\n`,_jsx(_components.li,{children:`✅ Rotate tokens occasionally (every ~6 months for high-value automations)`}),`\n`,_jsx(_components.li,{children:`❌ Never commit tokens to git, even in a private repo`}),`\n`,_jsx(_components.li,{children:`❌ Never paste a token in a public log, screenshot, or support thread —\nrevoke and recreate if you suspect leak`}),`\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":"Authentication","description":"Personal Access Tokens (PATs) — how they work, where to use them, how to revoke them.","icon":"key","href":"/essentials/authentication"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"How tokens look","slug":"how-tokens-look","depth":2,"children":[]},{"title":"Creating a token","slug":"creating-a-token","depth":2,"children":[]},{"title":"Using a token","slug":"using-a-token","depth":2,"children":[{"title":"With the MCP server","slug":"with-the-mcp-server","depth":3,"children":[]},{"title":"With the REST API","slug":"with-the-rest-api","depth":3,"children":[]}]},{"title":"Revoking a token","slug":"revoking-a-token","depth":2,"children":[]},{"title":"Verifying a token","slug":"verifying-a-token","depth":2,"children":[]},{"title":"Scopes","slug":"scopes","depth":2,"children":[]},{"title":"Token security checklist","slug":"token-security-checklist","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"magicpost","siteName":"MagicPost Developers","title":"Authentication - MagicPost Developers","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-05-20T06:24:27.501Z","originalFileLocation":"essentials/authentication.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=\"Personal Access Tokens (PATs) — how they work, where to use them, how to revoke them.\">\u003cmeta data-mint-head name=\"application-name\" content=\"MagicPost Developers\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/magicpost/2jMlhCCrsGGacSFW/_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/magicpost/2jMlhCCrsGGacSFW/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/magicpost/2jMlhCCrsGGacSFW/_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/magicpost/2jMlhCCrsGGacSFW/_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/magicpost/2jMlhCCrsGGacSFW/_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/magicpost/2jMlhCCrsGGacSFW/_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/magicpost/2jMlhCCrsGGacSFW/_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/magicpost/2jMlhCCrsGGacSFW/_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/magicpost/2jMlhCCrsGGacSFW/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Authentication - MagicPost Developers\">\u003cmeta data-mint-head property=\"og:description\" content=\"Personal Access Tokens (PATs) — how they work, where to use them, how to revoke them.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"MagicPost Developers\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://dev.magicpost.in/essentials/authentication\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://magicpost.mintlify.site/_mintlify/api/og/v2?division=Essentials\u0026amp;title=Authentication\u0026amp;description=Personal+Access+Tokens+%28PATs%29+%E2%80%94+how+they+work%2C+where+to+use+them%2C+how+to+revoke+them.\u0026amp;theme=a93b00ce5d9e9ccedb8abce2\u0026amp;signature=a319d2925ade2a1d07343d19d0afa3e43451de1879194630529aadcf8a019110\">\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=\"Authentication - MagicPost Developers\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Personal Access Tokens (PATs) — how they work, where to use them, how to revoke them.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://magicpost.mintlify.site/_mintlify/api/og/v2?division=Essentials\u0026amp;title=Authentication\u0026amp;description=Personal+Access+Tokens+%28PATs%29+%E2%80%94+how+they+work%2C+where+to+use+them%2C+how+to+revoke+them.\u0026amp;theme=a93b00ce5d9e9ccedb8abce2\u0026amp;signature=a319d2925ade2a1d07343d19d0afa3e43451de1879194630529aadcf8a019110\">\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/magicpost/2jMlhCCrsGGacSFW/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"MagicPost Developers\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#7E4EFD\">\u003clink data-mint-head rel=\"canonical\" href=\"https://dev.magicpost.in/essentials/authentication\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/essentials/authentication.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://dev.magicpost.in/#organization\",\"name\":\"MagicPost Developers\",\"url\":\"https://dev.magicpost.in\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/magicpost/SaSZgOZZKTX6XPZW/logo/light.svg?fit=max\u0026auto=format\u0026n=SaSZgOZZKTX6XPZW\u0026q=85\u0026s=91ef517ec032ce57959b2887fdaec6b4\"}},{\"@type\":\"WebSite\",\"@id\":\"https://dev.magicpost.in#website\",\"name\":\"MagicPost Developers\",\"url\":\"https://dev.magicpost.in\",\"publisher\":{\"@id\":\"https://dev.magicpost.in/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://dev.magicpost.in/essentials/authentication#webpage\",\"url\":\"https://dev.magicpost.in/essentials/authentication\",\"name\":\"Authentication\",\"description\":\"Personal Access Tokens (PATs) — how they work, where to use them, how to revoke them.\",\"dateModified\":\"2026-05-20T06:24:27.501Z\",\"isPartOf\":{\"@id\":\"https://dev.magicpost.in#website\"},\"breadcrumb\":{\"@id\":\"https://dev.magicpost.in/essentials/authentication#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://dev.magicpost.in/essentials/authentication#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"MagicPost Developers\",\"item\":\"https://dev.magicpost.in\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Authentication\",\"item\":\"https://dev.magicpost.in/essentials/authentication\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://dev.magicpost.in/essentials/authentication#article\",\"headline\":\"Authentication\",\"name\":\"Authentication\",\"description\":\"Personal Access Tokens (PATs) — how they work, where to use them, how to revoke them.\",\"url\":\"https://dev.magicpost.in/essentials/authentication\",\"mainEntityOfPage\":{\"@id\":\"https://dev.magicpost.in/essentials/authentication#webpage\"},\"dateModified\":\"2026-05-20T06:24:27.501Z\",\"publisher\":{\"@id\":\"https://dev.magicpost.in/#organization\"},\"isPartOf\":{\"@id\":\"https://dev.magicpost.in#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"MagicPost Developers\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"MagicPost Developers","nav":{"global":{"anchors":[{"anchor":"Status","icon":"signal","href":"https://status.magicpost.in"},{"anchor":"Support","icon":"envelope","href":"mailto:support@magicpost.in"}]},"tabs":[{"tab":"Guides","groups":[{"group":"Getting started","pages":[{"title":"Introduction","icon":"rocket","href":"/introduction"},{"title":"Quickstart","description":"Connect Claude Desktop to your MagicPost account in 3 steps.","icon":"play","href":"/quickstart"}]},{"group":"Essentials","pages":[{"title":"Authentication","icon":"key","href":"/essentials/authentication"},{"title":"Errors \u0026 rate limits","description":"Error shape, HTTP status mapping, retry policy.","icon":"triangle-exclamation","href":"/essentials/errors"}]},{"group":"MCP integration","pages":[{"title":"MCP overview","icon":"robot","href":"/mcp/overview"},{"title":"Claude Desktop","icon":"message","href":"/mcp/setup-claude-desktop"},{"title":"Setup Claude Code","icon":"terminal","href":"/mcp/setup-claude-code"},{"title":"Cursor","icon":"terminal","href":"/mcp/setup-cursor"},{"title":"Attach media","icon":"paperclip","href":"/mcp/media-attachments"},{"title":"Tools catalog","icon":"wrench","href":"/mcp/tools"}]}]},{"tab":"API reference","pages":[{"title":"API reference","href":"/api-reference/overview"}]}]},"basePath":"","title":"Authentication - MagicPost Developers","buildId":"dpl_FWZhTb2vab28gFGFH4ojka6qEznQ","deploymentId":"dpl_FWZhTb2vab28gFGFH4ojka6qEznQ","dynamics":[],"chunks":[]}