Authenticate Metal API requests with server-to-server API keys: create and manage keys in the app as an admin, and handle 401 and 403 errors.
The Metal API uses API keys to authenticate requests. Each key belongs to a single organization, and every request is automatically scoped to that organization’s data.API keys are service-level, server-to-server credentials. They are not OAuth tokens and they do not impersonate each end user of a customer-built app. For per-user access from Claude, ChatGPT, or Cursor, use the Metal MCP server instead. See Choose the API or MCP for the two models side by side.
The secret key is returned only once, when the key is created. If you lose it, delete the key and create a new one. Never expose it in client-side code, browsers, or mobile apps. API keys are for server-to-server use only.
Keys are created, rotated, and revoked in the app. An Admin, or a member of the Metal team, manages them at Settings → Organization → API & MCP Access.GET /v1/keys/current reports which key a request is using, so you can confirm the credentials an integration holds:
The gateway also exposes GET, POST, and DELETE /v1/keys, but only to that signed-in session. API keys are rejected, so those endpoints aren’t part of the API reference: manage keys in the app.
Some endpoints also check the caller’s role as well as their credentials:
API key management: an Admin, or a member of the Metal team, signed in to the Metal app. API keys are always rejected, including keys an Admin created.
Schema and CRM configuration writes: an Admin signed in to the app, or an API key an Admin created. Keys created by other roles are rejected. Reads of the schema and of CRM configurations stay open to any member and any key.
A call that doesn’t meet the rule returns 403 Forbidden:
{ "code": 403, "message": "Admin or Metal Team role required", "details": [{ "message": "Admin or Metal Team role required" }]}
Read message for the text to show a user. details repeats it once per reason or per field. This body is different from the error body returned for authentication failures, and some resource-level refusals use the error body too, so handle the two shapes separately. See Errors.
If credentials are missing or invalid, the API responds with 401 Unauthorized:
{ "error": "invalid api key or clientId" }
If an API key calls an endpoint that requires a signed-in Admin, such as POST /v1/keys, the API responds with 403 Forbidden. That body carries code, message, and details rather than error; see Admin-only endpoints for the shape.See Errors for the full list of status codes and how to handle them.
{"docsConfig":{"theme":"palm","$schema":"https://mintlify.com/docs.json","name":"Metal Docs","description":"Developer documentation and API reference for Metal, the AI context layer for financial firms.","colors":{"primary":"#AF4719","light":"#E0764A","dark":"#8F3A14"},"logo":{"light":"https://mintcdn.com/metal-05dd0988/nE9Niq1EZxmrmtFS/logo/light.png?fit=max\u0026auto=format\u0026n=nE9Niq1EZxmrmtFS\u0026q=85\u0026s=215c9e6983b210f31b2f2f90fe58922d","dark":"https://mintcdn.com/metal-05dd0988/nE9Niq1EZxmrmtFS/logo/dark.png?fit=max\u0026auto=format\u0026n=nE9Niq1EZxmrmtFS\u0026q=85\u0026s=46e0a5261f69de6c07f84eb8543a195d","href":"https://www.metal.ai"},"favicon":"https://mintcdn.com/metal-05dd0988/kWbcLNNTbUpq7lH_/favicon.png?fit=max\u0026auto=format\u0026n=kWbcLNNTbUpq7lH_\u0026q=85\u0026s=aa6f9eae2cd28cf1532c714602acb90d","api":{"openapi":"api-reference/openapi.json","playground":{"display":"interactive"},"examples":{"languages":["bash","python","javascript","go"]}},"appearance":{"default":"system"},"background":{"color":{"light":"#FAF7EF","dark":"#1A1A18"}},"navbar":{"links":[{"href":"mailto:support@metal.ai","label":"Support"}],"primary":{"type":"button","label":"Book a demo","href":"https://www.metal.ai/book-a-demo"}},"footer":{"socials":{"website":"https://www.metal.ai","x":"https://x.com/metal__ai","linkedin":"https://www.linkedin.com/company/getmetal"}},"fonts":{"heading":{"family":"Lora"},"body":{"family":"Inter"}},"styling":{"eyebrows":"breadcrumbs","codeblocks":{"theme":{"light":"github-light","dark":"github-dark"}},"latex":false},"contextual":{"options":["copy","view","chatgpt","claude","cursor","vscode"],"display":"header"},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"metal-05dd0988","hasAudioNarration":false,"actualSubdomain":"metal-05dd0988","customDomains":["docs.metal.ai"],"gitSource":{"type":"github","owner":"getmetal","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"collectionId":"42d3382f-6d8b-4b0d-bda5-8d2cdf5c40b4","liveDeploymentHistoryId":"6ae8b993fd92378ebc2e98cc","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae8b993fd92378ebc2e98cc"},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6ae8b993fd92378ebc2e98cc","clientVersion":"0.0.4076","searchFilterCounts":[{"language":"default","tag":"Developers","count":149},{"language":"default","tag":"API reference","count":123},{"language":"default","tag":"Core records","count":40},{"language":"default","tag":"User guide","count":34},{"language":"default","tag":"Lists \u0026 taxonomy","count":32},{"language":"default","tag":"Administration","count":22},{"language":"default","tag":"Enrichment \u0026 scoring","count":19},{"language":"default","tag":"Documentation","count":16},{"language":"default","tag":"Working in Metal","count":15},{"language":"default","tag":"Companies","count":12}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"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":"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":true},"customCss":[],"page":{"pagePath":"authentication","slug":"/authentication","pageMetadata":{"title":"Authentication","description":"Authenticate Metal API requests with server-to-server API keys: create and manage keys in the app as an admin, and handle 401 and 403 errors.","keywords":["authentication","api key","client id","headers","security"],"href":"/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: \"Authenticate Metal API requests with server-to-server API keys: create and manage keys in the app as an admin, and handle 401 and 403 errors.\"\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},{Card,CardGroup,CodeBlock,Frame,Heading,Note,OptimizedImage,Step,Steps,Table,Warning}=_components;if(!Card)_missingMdxReference(`Card`,true);if(!CardGroup)_missingMdxReference(`CardGroup`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Frame)_missingMdxReference(`Frame`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!OptimizedImage)_missingMdxReference(`OptimizedImage`,true);if(!Step)_missingMdxReference(`Step`,true);if(!Steps)_missingMdxReference(`Steps`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`The Metal API uses API keys to authenticate requests. Each key belongs to a single organization, and every request is automatically scoped to that organization’s data.`}),`\n`,_jsxs(_components.p,{children:[`API keys are `,_jsx(_components.strong,{children:`service-level, server-to-server credentials`}),`. They are not OAuth tokens and they do not impersonate each end user of a customer-built app. For per-user access from Claude, ChatGPT, or Cursor, use the `,_jsx(_components.a,{href:`/mcp/overview`,children:`Metal MCP server`}),` instead. See `,_jsx(_components.a,{href:`/build-on-metal`,children:`Choose the API or MCP`}),` for the two models side by side.`]}),`\n`,_jsx(Heading,{level:`2`,id:`api-key-credentials`,children:`API key credentials`}),`\n`,_jsx(_components.p,{children:`An API key has two parts that are always sent together:`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Credential`}),_jsx(_components.th,{children:`Header`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Client ID`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`x-metal-client-id`})}),_jsx(_components.td,{children:`Public identifier for the key.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Secret key`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`x-metal-api-key`})}),_jsx(_components.td,{children:`Secret value that authenticates the request.`})]})]})]}),`\n`,_jsx(_components.p,{children:`Send both headers on every request:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:`curl`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` https://api.metal.ai/v1/companies`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` -H`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"x-metal-client-id: `}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`$METAL_CLIENT_ID`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` -H`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"x-metal-api-key: `}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`$METAL_API_KEY`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"`})]}),`\n`]})})}),`\n`,_jsx(Warning,{children:_jsx(_components.p,{children:`The secret key is returned only once, when the key is created. If you lose it, delete the key and create a new one. Never expose it in client-side code, browsers, or mobile apps. API keys are for server-to-server use only.`})}),`\n`,_jsx(Heading,{level:`2`,id:`create-a-key-in-the-app`,children:`Create a key in the app`}),`\n`,_jsx(_components.p,{children:`Create your first API key from the Metal app. You need the Admin role to create, list, or revoke keys.`}),`\n`,_jsxs(Steps,{children:[_jsxs(Step,{title:`Open API \u0026 MCP Access`,children:[_jsxs(_components.p,{children:[`In the Metal app, go to `,_jsx(_components.strong,{children:`Settings → Organization → API \u0026 MCP Access`}),`.`]}),_jsx(Frame,{caption:`The API \u0026 MCP Access page lists your organization's keys.`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/metal-05dd0988/kWbcLNNTbUpq7lH_/images/api-keys-list.png?fit=max\u0026auto=format\u0026n=kWbcLNNTbUpq7lH_\u0026q=85\u0026s=0d5827973f094476ac7e30370051aac5`,alt:`Metal settings page showing the API Keys table with name, client ID, key last four, and created date columns`,\"data-og-width\":`2108`,width:`2108`,\"data-og-height\":`1968`,height:`1968`,\"data-path\":`images/api-keys-list.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/metal-05dd0988/kWbcLNNTbUpq7lH_/images/api-keys-list.png?w=280\u0026fit=max\u0026auto=format\u0026n=kWbcLNNTbUpq7lH_\u0026q=85\u0026s=be2905a3e543ec27575c1a51076043df 280w, https://mintcdn.com/metal-05dd0988/kWbcLNNTbUpq7lH_/images/api-keys-list.png?w=560\u0026fit=max\u0026auto=format\u0026n=kWbcLNNTbUpq7lH_\u0026q=85\u0026s=43ac76ea3f485bb13e5e734215aaf21a 560w, https://mintcdn.com/metal-05dd0988/kWbcLNNTbUpq7lH_/images/api-keys-list.png?w=840\u0026fit=max\u0026auto=format\u0026n=kWbcLNNTbUpq7lH_\u0026q=85\u0026s=9bb46fc3d8ede0a7fa1df42859a86aa1 840w, https://mintcdn.com/metal-05dd0988/kWbcLNNTbUpq7lH_/images/api-keys-list.png?w=1100\u0026fit=max\u0026auto=format\u0026n=kWbcLNNTbUpq7lH_\u0026q=85\u0026s=48a742b067e100b57d495282f13d3807 1100w, https://mintcdn.com/metal-05dd0988/kWbcLNNTbUpq7lH_/images/api-keys-list.png?w=1650\u0026fit=max\u0026auto=format\u0026n=kWbcLNNTbUpq7lH_\u0026q=85\u0026s=51bbb4d479fc33cffb1de59ee604a176 1650w, https://mintcdn.com/metal-05dd0988/kWbcLNNTbUpq7lH_/images/api-keys-list.png?w=2500\u0026fit=max\u0026auto=format\u0026n=kWbcLNNTbUpq7lH_\u0026q=85\u0026s=0b8ecdce96e0698b9d0e5b738ff458aa 2500w`})})]}),_jsxs(Step,{title:`Create a key`,children:[_jsxs(_components.p,{children:[`In the `,_jsx(_components.strong,{children:`API Keys`}),` card, click `,_jsx(_components.strong,{children:`Create API Key`}),`, enter a descriptive `,_jsx(_components.strong,{children:`Name`}),` (for example, “Production sync”), and click `,_jsx(_components.strong,{children:`Create`}),`.`]}),_jsx(Frame,{caption:`Give the key a descriptive name.`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/metal-05dd0988/kWbcLNNTbUpq7lH_/images/api-keys-create-dialog.png?fit=max\u0026auto=format\u0026n=kWbcLNNTbUpq7lH_\u0026q=85\u0026s=b914fba3402d7f1b3a4bd352334afc30`,alt:`Create API Key dialog with a name input and a Create button`,\"data-og-width\":`2108`,width:`2108`,\"data-og-height\":`1968`,height:`1968`,\"data-path\":`images/api-keys-create-dialog.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/metal-05dd0988/kWbcLNNTbUpq7lH_/images/api-keys-create-dialog.png?w=280\u0026fit=max\u0026auto=format\u0026n=kWbcLNNTbUpq7lH_\u0026q=85\u0026s=b66034a0445715e3f17d92451ab7bd24 280w, https://mintcdn.com/metal-05dd0988/kWbcLNNTbUpq7lH_/images/api-keys-create-dialog.png?w=560\u0026fit=max\u0026auto=format\u0026n=kWbcLNNTbUpq7lH_\u0026q=85\u0026s=77960f809b8b807fa19a21b04cc72b02 560w, https://mintcdn.com/metal-05dd0988/kWbcLNNTbUpq7lH_/images/api-keys-create-dialog.png?w=840\u0026fit=max\u0026auto=format\u0026n=kWbcLNNTbUpq7lH_\u0026q=85\u0026s=5cec929351033c3053befc1490df6b18 840w, https://mintcdn.com/metal-05dd0988/kWbcLNNTbUpq7lH_/images/api-keys-create-dialog.png?w=1100\u0026fit=max\u0026auto=format\u0026n=kWbcLNNTbUpq7lH_\u0026q=85\u0026s=ad840ae2641183c898180cdc0ac9fbd9 1100w, https://mintcdn.com/metal-05dd0988/kWbcLNNTbUpq7lH_/images/api-keys-create-dialog.png?w=1650\u0026fit=max\u0026auto=format\u0026n=kWbcLNNTbUpq7lH_\u0026q=85\u0026s=b84c0c4f001c6a22f2d10dc4c46113f9 1650w, https://mintcdn.com/metal-05dd0988/kWbcLNNTbUpq7lH_/images/api-keys-create-dialog.png?w=2500\u0026fit=max\u0026auto=format\u0026n=kWbcLNNTbUpq7lH_\u0026q=85\u0026s=059b9e275a562ad363f40228b702b30b 2500w`})})]}),_jsxs(Step,{title:`Copy your credentials`,children:[_jsxs(_components.p,{children:[`Metal shows the new key’s `,_jsx(_components.strong,{children:`Client ID`}),` (`,_jsx(_components.code,{children:`x-metal-client-id`}),`) and `,_jsx(_components.strong,{children:`API Key`}),` (`,_jsx(_components.code,{children:`x-metal-api-key`}),`). Copy both and store them securely.`]}),_jsx(Frame,{caption:`Copy the Client ID and API Key. The secret is shown only once.`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/metal-05dd0988/kWbcLNNTbUpq7lH_/images/api-keys-created.png?fit=max\u0026auto=format\u0026n=kWbcLNNTbUpq7lH_\u0026q=85\u0026s=47ff9a807c4447782db006ec1fe99518`,alt:`Created key dialog displaying the Client ID and API Key values with copy buttons`,\"data-og-width\":`2108`,width:`2108`,\"data-og-height\":`1968`,height:`1968`,\"data-path\":`images/api-keys-created.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/metal-05dd0988/kWbcLNNTbUpq7lH_/images/api-keys-created.png?w=280\u0026fit=max\u0026auto=format\u0026n=kWbcLNNTbUpq7lH_\u0026q=85\u0026s=098477a80d17b09f83bad1dbe9c79a89 280w, https://mintcdn.com/metal-05dd0988/kWbcLNNTbUpq7lH_/images/api-keys-created.png?w=560\u0026fit=max\u0026auto=format\u0026n=kWbcLNNTbUpq7lH_\u0026q=85\u0026s=5e2f248ac868da0bae68a1be17485fce 560w, https://mintcdn.com/metal-05dd0988/kWbcLNNTbUpq7lH_/images/api-keys-created.png?w=840\u0026fit=max\u0026auto=format\u0026n=kWbcLNNTbUpq7lH_\u0026q=85\u0026s=933109dbad04df13f917ba01fadddab2 840w, https://mintcdn.com/metal-05dd0988/kWbcLNNTbUpq7lH_/images/api-keys-created.png?w=1100\u0026fit=max\u0026auto=format\u0026n=kWbcLNNTbUpq7lH_\u0026q=85\u0026s=4c6cd6856e9fbb5d5893f793e3191c71 1100w, https://mintcdn.com/metal-05dd0988/kWbcLNNTbUpq7lH_/images/api-keys-created.png?w=1650\u0026fit=max\u0026auto=format\u0026n=kWbcLNNTbUpq7lH_\u0026q=85\u0026s=0329bfc2497e20035ff9edffb2487000 1650w, https://mintcdn.com/metal-05dd0988/kWbcLNNTbUpq7lH_/images/api-keys-created.png?w=2500\u0026fit=max\u0026auto=format\u0026n=kWbcLNNTbUpq7lH_\u0026q=85\u0026s=e93243587d91b987aeea96ac5a0e58fb 2500w`})}),_jsx(Warning,{children:_jsxs(_components.p,{children:[`This is the only time the `,_jsx(_components.strong,{children:`API Key`}),` secret is shown. If you lose it, delete the key and create a new one.`]})})]})]}),`\n`,_jsx(_components.p,{children:`The number of keys you can create depends on your plan. If you hit the limit, delete unused keys before creating new ones.`}),`\n`,_jsx(Heading,{level:`2`,id:`manage-keys`,children:`Manage keys`}),`\n`,_jsxs(_components.p,{children:[`Keys are created, rotated, and revoked in the app. An Admin, or a member of the Metal team, manages them at `,_jsx(_components.strong,{children:`Settings → Organization → API \u0026 MCP Access`}),`.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`GET /v1/keys/current`}),` reports which key a request is using, so you can confirm the credentials an integration holds:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:`curl`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` https://api.metal.ai/v1/keys/current`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` -H`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"x-metal-client-id: `}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`$METAL_CLIENT_ID`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` -H`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"x-metal-api-key: `}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`$METAL_API_KEY`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"`})]}),`\n`]})})}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[`The gateway also exposes `,_jsx(_components.code,{children:`GET`}),`, `,_jsx(_components.code,{children:`POST`}),`, and `,_jsx(_components.code,{children:`DELETE /v1/keys`}),`, but only to that signed-in session. API keys are rejected, so those endpoints aren’t part of the `,_jsx(_components.a,{href:`/api-reference/introduction`,children:`API reference`}),`: manage keys in the app.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`admin-only-endpoints`,children:`Admin-only endpoints`}),`\n`,_jsx(_components.p,{children:`Some endpoints also check the caller’s role as well as their credentials:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`API key management`}),`: an Admin, or a member of the Metal team, signed in to the Metal app. API keys are always rejected, including keys an Admin created.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Schema and CRM configuration writes`}),`: an Admin signed in to the app, or an API key an Admin created. Keys created by other roles are rejected. Reads of the schema and of CRM configurations stay open to any member and any key.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`A call that doesn’t meet the rule returns `,_jsx(_components.code,{children:`403 Forbidden`}),`:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`5`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"code\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`403`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"message\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"Admin or Metal Team role required\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"details\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: [{ `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`\"message\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"Admin or Metal Team role required\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` }]`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Read `,_jsx(_components.code,{children:`message`}),` for the text to show a user. `,_jsx(_components.code,{children:`details`}),` repeats it once per reason or per field. This body is different from the `,_jsx(_components.code,{children:`error`}),` body returned for authentication failures, and some resource-level refusals use the `,_jsx(_components.code,{children:`error`}),` body too, so handle the two shapes separately. See `,_jsx(_components.a,{href:`/guides/errors#response-format`,children:`Errors`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`best-practices`,children:`Best practices`}),`\n`,_jsxs(CardGroup,{cols:2,children:[_jsx(Card,{title:`Use separate keys per integration`,icon:`layer-group`,children:_jsx(_components.p,{children:`Create a distinct key for each integration or environment so you can rotate or revoke them independently.`})}),_jsx(Card,{title:`Rotate regularly`,icon:`arrows-rotate`,children:_jsx(_components.p,{children:`Create a new key, deploy it, then delete the old one to rotate without downtime.`})}),_jsx(Card,{title:`Store secrets securely`,icon:`vault`,children:_jsx(_components.p,{children:`Keep keys in a secret manager or environment variables, never in source control.`})}),_jsx(Card,{title:`Scope by purpose`,icon:`tag`,children:_jsx(_components.p,{children:`Name keys after the integration that uses them so you can audit and revoke precisely.`})})]}),`\n`,_jsx(Heading,{level:`2`,id:`errors`,children:`Errors`}),`\n`,_jsxs(_components.p,{children:[`If credentials are missing or invalid, the API responds with `,_jsx(_components.code,{children:`401 Unauthorized`}),`:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`{ `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`\"error\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"invalid api key or clientId\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` }`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`If an API key calls an endpoint that requires a signed-in Admin, such as `,_jsx(_components.code,{children:`POST /v1/keys`}),`, the API responds with `,_jsx(_components.code,{children:`403 Forbidden`}),`. That body carries `,_jsx(_components.code,{children:`code`}),`, `,_jsx(_components.code,{children:`message`}),`, and `,_jsx(_components.code,{children:`details`}),` rather than `,_jsx(_components.code,{children:`error`}),`; see `,_jsx(_components.a,{href:`#admin-only-endpoints`,children:`Admin-only endpoints`}),` for the shape.`]}),`\n`,_jsxs(_components.p,{children:[`See `,_jsx(_components.a,{href:`/guides/errors`,children:`Errors`}),` for the full list of status codes and how to handle them.`]})]})}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":{"codeStyling":{"theme":{"light":"github-light","dark":"github-dark"}},"config":{},"pageMetadata":{"title":"Authentication","description":"Authenticate Metal API requests with server-to-server API keys: create and manage keys in the app as an admin, and handle 401 and 403 errors.","keywords":["authentication","api key","client id","headers","security"],"href":"/authentication"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"API key credentials","slug":"api-key-credentials","depth":2,"children":[]},{"title":"Create a key in the app","slug":"create-a-key-in-the-app","depth":2,"children":[]},{"title":"Manage keys","slug":"manage-keys","depth":2,"children":[]},{"title":"Admin-only endpoints","slug":"admin-only-endpoints","depth":2,"children":[]},{"title":"Best practices","slug":"best-practices","depth":2,"children":[]},{"title":"Errors","slug":"errors","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"metal-05dd0988","siteName":"Metal Docs","title":"Authentication - Metal Docs","relatedPagesConfig":{"enabled":true,"limit":5,"mode":"automatic"},"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-28T14:14:27.454Z","originalFileLocation":"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=\"Authenticate Metal API requests with server-to-server API keys: create and manage keys in the app as an admin, and handle 401 and 403 errors.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Metal 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/metal-05dd0988/H5xVb6VOFSWBSPlZ/_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/metal-05dd0988/H5xVb6VOFSWBSPlZ/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/metal-05dd0988/H5xVb6VOFSWBSPlZ/_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/metal-05dd0988/H5xVb6VOFSWBSPlZ/_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/metal-05dd0988/H5xVb6VOFSWBSPlZ/_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/metal-05dd0988/H5xVb6VOFSWBSPlZ/_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/metal-05dd0988/H5xVb6VOFSWBSPlZ/_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/metal-05dd0988/H5xVb6VOFSWBSPlZ/_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/metal-05dd0988/H5xVb6VOFSWBSPlZ/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Authentication - Metal Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Authenticate Metal API requests with server-to-server API keys: create and manage keys in the app as an admin, and handle 401 and 403 errors.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Metal Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.metal.ai/authentication\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://metal-05dd0988.mintlify.site/_mintlify/api/og/v2?division=Get+started\u0026amp;title=Authentication\u0026amp;description=Authenticate+Metal+API+requests+with+server-to-server+API+keys%3A+create+and+manage+keys+in+the+app+as+an+admin%2C+and+handle+401+and+403+errors.\u0026amp;theme=8371c31aca97183926192ed6\u0026amp;signature=d9f140b41ccfb3f4ae918c964f04497433495c07ce17a21b1e79729fddc1ee6c\">\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 - Metal Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Authenticate Metal API requests with server-to-server API keys: create and manage keys in the app as an admin, and handle 401 and 403 errors.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://metal-05dd0988.mintlify.site/_mintlify/api/og/v2?division=Get+started\u0026amp;title=Authentication\u0026amp;description=Authenticate+Metal+API+requests+with+server-to-server+API+keys%3A+create+and+manage+keys+in+the+app+as+an+admin%2C+and+handle+401+and+403+errors.\u0026amp;theme=8371c31aca97183926192ed6\u0026amp;signature=d9f140b41ccfb3f4ae918c964f04497433495c07ce17a21b1e79729fddc1ee6c\">\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/metal-05dd0988/H5xVb6VOFSWBSPlZ/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Metal Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#AF4719\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.metal.ai/authentication\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/authentication.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.metal.ai/#organization\",\"name\":\"Metal Docs\",\"url\":\"https://docs.metal.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/metal-05dd0988/nE9Niq1EZxmrmtFS/logo/light.png?fit=max\u0026auto=format\u0026n=nE9Niq1EZxmrmtFS\u0026q=85\u0026s=215c9e6983b210f31b2f2f90fe58922d\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.metal.ai#website\",\"name\":\"Metal Docs\",\"url\":\"https://docs.metal.ai\",\"publisher\":{\"@id\":\"https://docs.metal.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.metal.ai/authentication#webpage\",\"url\":\"https://docs.metal.ai/authentication\",\"name\":\"Authentication\",\"description\":\"Authenticate Metal API requests with server-to-server API keys: create and manage keys in the app as an admin, and handle 401 and 403 errors.\",\"dateModified\":\"2026-10-28T14:14:27.454Z\",\"isPartOf\":{\"@id\":\"https://docs.metal.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.metal.ai/authentication#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.metal.ai/authentication#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Get started\",\"item\":\"https://docs.metal.ai/index\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Authentication\",\"item\":\"https://docs.metal.ai/authentication\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.metal.ai/authentication#article\",\"headline\":\"Authentication\",\"name\":\"Authentication\",\"description\":\"Authenticate Metal API requests with server-to-server API keys: create and manage keys in the app as an admin, and handle 401 and 403 errors.\",\"url\":\"https://docs.metal.ai/authentication\",\"mainEntityOfPage\":{\"@id\":\"https://docs.metal.ai/authentication#webpage\"},\"dateModified\":\"2026-10-28T14:14:27.454Z\",\"keywords\":\"authentication, api key, client id, headers, security\",\"publisher\":{\"@id\":\"https://docs.metal.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.metal.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Metal Docs\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Metal Docs","nav":{"global":null,"products":[{"product":"Developers","icon":"code","description":"Build on the Metal API — core concepts, integration guides, MCP, and the full API reference.","tabs":[{"tab":"Documentation","icon":"book-open","groups":[{"group":"Get started","pages":[{"title":"Metal","href":""},{"title":"Quickstart","description":"Create a Metal API key, set your credentials, make your first authenticated request, and create your first company through the Metal API in four steps.","href":"/quickstart"},{"title":"Authentication","href":"/authentication"},{"title":"Choose the API or MCP","description":"When to use the Metal REST API versus the Metal MCP server, how each authenticates, and what a customer-built agent can and cannot do.","href":"/build-on-metal"}]},{"group":"Core concepts","pages":[{"title":"Platform overview","href":"/concepts/platform"},{"title":"Data model","href":"/concepts/data-model"},{"title":"Enrichment","href":"/concepts/enrichment"},{"title":"Reconciliation \u0026 ranking","href":"/concepts/reconciliation"},{"title":"Financial metrics","href":"/concepts/financial-metrics"},{"title":"Workflows, runs, and branch steps","href":"/concepts/workflows"}]},{"group":"MCP server","pages":[{"title":"Metal MCP server","href":"/mcp/overview"},{"title":"MCP tools reference","href":"/mcp/tools-reference"},{"title":"Connect Cursor","href":"/mcp/cursor"},{"title":"Connect Claude","href":"/mcp/claude"},{"title":"Connect ChatGPT","href":"/mcp/chatgpt"},{"title":"Other MCP clients","href":"/mcp/clients"}]}]},{"tab":"Guides","icon":"compass","pages":[{"title":"Guides","href":"/guides/sync-data"}]},{"tab":"API reference","icon":"code","pages":[{"title":"API reference","href":"/api-reference/introduction"}]}]},{"product":"User guide","icon":"book-open","description":"Learn how to use and administer the Metal app, feature by feature.","pages":[{"title":"User guide","href":"/help"}]}]},"basePath":"","title":"Authentication - Metal Docs","buildId":"dpl_8LJbrAiZvr1K98WQNZXCyY5AvT34","deploymentId":"dpl_8LJbrAiZvr1K98WQNZXCyY5AvT34","dynamics":["07c022d89b","a74be98ba7","a9bb46feb3"],"chunks":["Frame-NdetNziF.js","DynamicMarkdown-CD8713Yy.js","zoom-image-lightbox-DMoL6lHz.js","lightbox-handle-r17bVUz3.js","Markdown-D7Ofw1oz.js","clsx-eKJ4rcii.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-CwjSCXIK.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-9EK5IAXV.js"]}