Create and manage API keys, authenticate with a Bearer token, scope account requests, and view API logs.
Every Surge API request requires an API key. Pass it as a Bearer token. Keys are scoped to a project, and account-specific resources are addressed by the account ID in the request path.
Create and manage API keys
All requests to the Surge API require an API key. You create and manage keys in the dashboard under the API Keys section.There are two key types:
Key prefix
Type
Use
sk_live_...
Live
Production API calls
sk_demo_...
Demo
Basic evaluation against the shared demo number
Demo keys are limited to sends through the shared demo number. They have no other capabilities and shouldn’t be used beyond basic evaluation of Surge. Surge is likely to deprecate demo keys in the future in favor of sandboxes.
Authenticate with a Bearer token
Pass your API key as a bearer token in the Authorization header:
Authorization: Bearer sk_live_your_api_key_here
All requests must use HTTPS. Plaintext HTTP requests are rejected.
Scope requests to an account
API keys are scoped to a project: they can access all accounts under that project. Account-specific resources are scoped by the account ID in the request path:
GET /accounts/acct_01jrzhe8d9enptypyx360pcmxj/messagesPOST /accounts/acct_01jrzhe8d9enptypyx360pcmxj/messages
A single project API key can create and manage multiple accounts, send messages from any of them, and read data across all of them.
Authentication errors
Error
HTTP status
Cause
missing_api_key
401
No Authorization header
invalid_api_key
401
Key not found or revoked
demo_api_key
403
Demo key used for an action that requires a live key
platform_locked
403
Your project has been locked
View API request logs
All authenticated API requests are logged. You can view them in the dashboard under the API Logs section. Logs include the method, path, response status, and response time for each request.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Surge","colors":{"primary":"#8200ff","light":"#a684ff","dark":"#7f22fe"},"logo":{"light":"https://mintcdn.com/surge-67d47b03/1YdD2Aq20HHnJtCK/logo.svg?fit=max\u0026auto=format\u0026n=1YdD2Aq20HHnJtCK\u0026q=85\u0026s=fb53e91d462980a01e9b7c046c98f339","dark":"https://mintcdn.com/surge-67d47b03/1YdD2Aq20HHnJtCK/logo.svg?fit=max\u0026auto=format\u0026n=1YdD2Aq20HHnJtCK\u0026q=85\u0026s=fb53e91d462980a01e9b7c046c98f339"},"favicon":"https://mintcdn.com/surge-67d47b03/TCCrlfgdQylYa0Zn/favicon.png?fit=max\u0026auto=format\u0026n=TCCrlfgdQylYa0Zn\u0026q=85\u0026s=9026e6be7d30dc29237a92585de3ae74","api":{"openapi":"openapi.documented.json"},"navbar":{"links":[{"href":"mailto:support@surge.app","label":"Support"}],"primary":{"type":"button","label":"Dashboard","href":"https://hq.surge.app"}},"footer":{"socials":{"x":"https://x.com/surgeapi","github":"https://github.com/surgeapi","linkedin":"https://www.linkedin.com/company/surgeapi"}},"seo":{"metatags":{"og:image":"https://surgemsg.com/images/surge-preview-9b01c93f5b24bb5128b47c354c371546.jpg?vsn=d"},"indexing":"navigable"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"surge-67d47b03","hasAudioNarration":false,"actualSubdomain":"surge-67d47b03","customDomains":["docs.surge.app"],"gitSource":{"type":"github","owner":"surgeapi","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":"","_id":"6b10aa029ffae5051c3fbf13"},"feedback":{"agentFeedback":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6b11f5191f8ff72afdcf0d5c","clientVersion":"0.0.4448","searchFilterCounts":[{"language":"default","tag":"API Reference","count":73},{"language":"default","tag":"Endpoints","count":49},{"language":"default","tag":"Documentation","count":39},{"language":"default","tag":"Webhooks","count":21},{"language":"default","tag":"Events","count":19},{"language":"default","tag":"Phone numbers","count":10},{"language":"default","tag":"Register your business","count":10},{"language":"default","tag":"SDKs","count":10},{"language":"default","tag":"Accounts","count":7},{"language":"default","tag":"Users","count":6}]},"assistantConfig":{},"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":"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":"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":"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":"turbopuffer-dual-write","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":"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":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"auth-vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":".nav-logo{height:2rem}"}]}
{"page":{"pagePath":"api-reference/authentication","slug":"/api-reference/authentication","pageMetadata":{"title":"Authentication","description":"Create and manage API keys, authenticate with a Bearer token, scope account requests, and view API logs.","href":"/api-reference/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 and manage API keys, authenticate with a Bearer token, scope account requests, and view API logs.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Every Surge API request requires an API key. Pass it as a Bearer token. Keys are scoped to a project, and account-specific resources are addressed by the account ID in the request path.`}),`\n`,_jsx(Heading,{level:`2`,id:`create-and-manage-api-keys`,children:`Create and manage API keys`}),`\n`,_jsxs(_components.p,{children:[`All requests to the Surge API require an API key. You create and manage keys in the dashboard under the `,_jsx(_components.strong,{children:`API Keys`}),` section.`]}),`\n`,_jsx(_components.p,{children:`There are two key types:`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Key prefix`}),_jsx(_components.th,{children:`Type`}),_jsx(_components.th,{children:`Use`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`sk_live_...`})}),_jsx(_components.td,{children:`Live`}),_jsx(_components.td,{children:`Production API calls`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`sk_demo_...`})}),_jsx(_components.td,{children:`Demo`}),_jsx(_components.td,{children:`Basic evaluation against the shared demo number`})]})]})]}),`\n`,_jsx(_components.p,{children:`Demo keys are limited to sends through the shared demo number. They have no other capabilities and shouldn’t be used beyond basic evaluation of Surge. Surge is likely to deprecate demo keys in the future in favor of sandboxes.`}),`\n`,_jsx(Heading,{level:`2`,id:`authenticate-with-a-bearer-token`,children:`Authenticate with a Bearer token`}),`\n`,_jsxs(_components.p,{children:[`Pass your API key as a bearer token in the `,_jsx(_components.code,{children:`Authorization`}),` header:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`http`,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:`http`,children:_jsxs(_components.code,{language:`http`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`Authorization`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` Bearer sk_live_your_api_key_here`})]}),`\n`]})})}),`\n`,_jsx(Warning,{children:_jsx(_components.p,{children:`All requests must use HTTPS. Plaintext HTTP requests are rejected.`})}),`\n`,_jsx(Heading,{level:`2`,id:`scope-requests-to-an-account`,children:`Scope requests to an account`}),`\n`,_jsxs(_components.p,{children:[`API keys are scoped to a `,_jsx(_components.strong,{children:`project`}),`: they can access all accounts under that project. Account-specific resources are scoped by the account ID in the request path:`]}),`\n`,_jsx(CodeBlock,{numberOfLines:`3`,language:`text`,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:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`3`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`GET /accounts/acct_01jrzhe8d9enptypyx360pcmxj/messages`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`POST /accounts/acct_01jrzhe8d9enptypyx360pcmxj/messages`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:`A single project API key can create and manage multiple accounts, send messages from any of them, and read data across all of them.`}),`\n`,_jsx(Heading,{level:`2`,id:`authentication-errors`,children:`Authentication errors`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Error`}),_jsx(_components.th,{children:`HTTP status`}),_jsx(_components.th,{children:`Cause`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`missing_api_key`})}),_jsx(_components.td,{\"data-numeric\":`true`,children:`401`}),_jsxs(_components.td,{children:[`No `,_jsx(_components.code,{children:`Authorization`}),` header`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`invalid_api_key`})}),_jsx(_components.td,{\"data-numeric\":`true`,children:`401`}),_jsx(_components.td,{children:`Key not found or revoked`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`demo_api_key`})}),_jsx(_components.td,{\"data-numeric\":`true`,children:`403`}),_jsx(_components.td,{children:`Demo key used for an action that requires a live key`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`platform_locked`})}),_jsx(_components.td,{\"data-numeric\":`true`,children:`403`}),_jsx(_components.td,{children:`Your project has been locked`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`view-api-request-logs`,children:`View API request logs`}),`\n`,_jsxs(_components.p,{children:[`All authenticated API requests are logged. You can view them in the dashboard under the `,_jsx(_components.strong,{children:`API Logs`}),` section. Logs include the method, path, response status, and response time for each request.`]})]})}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":"Create and manage API keys, authenticate with a Bearer token, scope account requests, and view API logs.","href":"/api-reference/authentication"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Create and manage API keys","slug":"create-and-manage-api-keys","depth":2,"children":[]},{"title":"Authenticate with a Bearer token","slug":"authenticate-with-a-bearer-token","depth":2,"children":[]},{"title":"Scope requests to an account","slug":"scope-requests-to-an-account","depth":2,"children":[]},{"title":"Authentication errors","slug":"authentication-errors","depth":2,"children":[]},{"title":"View API request logs","slug":"view-api-request-logs","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"surge-67d47b03","siteName":"Surge","title":"Authentication - Surge","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-12-02T21:23:11.714Z","originalFileLocation":"api-reference/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=\"Create and manage API keys, authenticate with a Bearer token, scope account requests, and view API logs.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Surge\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/surge-67d47b03/sXzShSiekorghOlZ/_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/surge-67d47b03/sXzShSiekorghOlZ/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/surge-67d47b03/sXzShSiekorghOlZ/_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/surge-67d47b03/sXzShSiekorghOlZ/_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/surge-67d47b03/sXzShSiekorghOlZ/_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/surge-67d47b03/sXzShSiekorghOlZ/_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/surge-67d47b03/sXzShSiekorghOlZ/_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/surge-67d47b03/sXzShSiekorghOlZ/_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/surge-67d47b03/sXzShSiekorghOlZ/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Authentication - Surge\">\u003cmeta data-mint-head property=\"og:description\" content=\"Create and manage API keys, authenticate with a Bearer token, scope account requests, and view API logs.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Surge\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.surge.app/api-reference/authentication\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://surgemsg.com/images/surge-preview-9b01c93f5b24bb5128b47c354c371546.jpg?vsn=d\">\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 - Surge\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Create and manage API keys, authenticate with a Bearer token, scope account requests, and view API logs.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://surgemsg.com/images/surge-preview-9b01c93f5b24bb5128b47c354c371546.jpg?vsn=d\">\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/surge-67d47b03/sXzShSiekorghOlZ/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Surge\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#8200ff\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.surge.app/api-reference/authentication\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/authentication.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.surge.app/#organization\",\"name\":\"Surge\",\"url\":\"https://docs.surge.app\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/surge-67d47b03/1YdD2Aq20HHnJtCK/logo.svg?fit=max\u0026auto=format\u0026n=1YdD2Aq20HHnJtCK\u0026q=85\u0026s=fb53e91d462980a01e9b7c046c98f339\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.surge.app#website\",\"name\":\"Surge\",\"url\":\"https://docs.surge.app\",\"publisher\":{\"@id\":\"https://docs.surge.app/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.surge.app/api-reference/authentication#webpage\",\"url\":\"https://docs.surge.app/api-reference/authentication\",\"name\":\"Authentication\",\"description\":\"Create and manage API keys, authenticate with a Bearer token, scope account requests, and view API logs.\",\"dateModified\":\"2026-12-02T21:23:11.714Z\",\"isPartOf\":{\"@id\":\"https://docs.surge.app#website\"},\"breadcrumb\":{\"@id\":\"https://docs.surge.app/api-reference/authentication#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.surge.app/api-reference/authentication#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Getting started\",\"item\":\"https://docs.surge.app/api-reference/introduction\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Authentication\",\"item\":\"https://docs.surge.app/api-reference/authentication\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.surge.app/api-reference/authentication#article\",\"headline\":\"Authentication\",\"name\":\"Authentication\",\"description\":\"Create and manage API keys, authenticate with a Bearer token, scope account requests, and view API logs.\",\"url\":\"https://docs.surge.app/api-reference/authentication\",\"mainEntityOfPage\":{\"@id\":\"https://docs.surge.app/api-reference/authentication#webpage\"},\"image\":\"https://surgemsg.com/images/surge-preview-9b01c93f5b24bb5128b47c354c371546.jpg?vsn=d\",\"dateModified\":\"2026-12-02T21:23:11.714Z\",\"publisher\":{\"@id\":\"https://docs.surge.app/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.surge.app#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Surge\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Surge\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/authentication.md","siteName":"Surge","nav":{"global":null,"anchors":[{"anchor":"Documentation","icon":"book-open","pages":[{"title":"Documentation","href":"/overview/what-is-surge"}]},{"anchor":"SDKs","icon":"code","pages":[{"title":"SDKs","href":"/sdks"}]},{"anchor":"API Reference","icon":"terminal","groups":[{"group":"Getting started","pages":[{"title":"Introduction","description":"The Surge REST API is a JSON API over HTTPS. Base URL: https://api.surge.app.","href":"/api-reference/introduction"},{"title":"Authentication","href":"/api-reference/authentication"},{"title":"Error Reference","description":"Every API error type by category: HTTP status codes, causes, and messaging-layer delivery failures with descriptions.","href":"/api-reference/errors"}]},{"group":"Endpoints","pages":[{"group":"Accounts","pages":[{"title":"Create account","openapi":"POST /accounts","href":"/api-reference/endpoint/accounts/create"},{"title":"List accounts","openapi":"GET /accounts","href":"/api-reference/endpoint/accounts/list"},{"title":"Retrieve account","openapi":"GET /accounts/{id}","href":"/api-reference/endpoint/accounts/get"},{"title":"Check account status","openapi":"GET /accounts/{account_id}/status","href":"/api-reference/endpoint/accounts/check-status"},{"title":"Retrieve account usage","openapi":"GET /accounts/{account_id}/usage","href":"/api-reference/endpoint/accounts/usage"},{"title":"Update account","openapi":"PATCH /accounts/{id}","href":"/api-reference/endpoint/accounts/update"},{"title":"Archive account","openapi":"DELETE /accounts/{id}","href":"/api-reference/endpoint/accounts/archive"}]},{"group":"Attachments","pages":[{"title":"Retrieve attachment file","openapi":"GET /attachments/{attachment_id}/file","href":"/api-reference/endpoint/attachments/get-file"}]},{"group":"Audiences","pages":[{"title":"Create audience","openapi":"POST /accounts/{account_id}/audiences","href":"/api-reference/endpoint/audiences/create"},{"title":"Add contact to audience","openapi":"POST /audiences/{audience_id}/contacts","href":"/api-reference/endpoint/audiences/add-contact"},{"title":"List audience contacts","openapi":"GET /audiences/{audience_id}/contacts","href":"/api-reference/endpoint/audiences/list-contacts"}]},{"group":"Blasts","pages":[{"title":"Create blast","openapi":"POST /accounts/{account_id}/blasts","href":"/api-reference/endpoint/blasts/create"}]},{"group":"Blocked contacts","pages":[{"title":"Block contact","openapi":"POST /accounts/{account_id}/blocked_contacts","href":"/api-reference/endpoint/blocked-contacts/create"},{"title":"List blocked contacts","openapi":"GET /accounts/{account_id}/blocked_contacts","href":"/api-reference/endpoint/blocked-contacts/list"},{"title":"Unblock contact","openapi":"DELETE /blocked_contacts/{id}","href":"/api-reference/endpoint/blocked-contacts/delete"}]},{"group":"Campaigns","pages":[{"title":"Create campaign","openapi":"POST /accounts/{account_id}/campaigns","href":"/api-reference/endpoint/campaigns/create"},{"title":"List campaigns","openapi":"GET /accounts/{account_id}/campaigns","href":"/api-reference/endpoint/campaigns/list"},{"title":"Retrieve campaign","openapi":"GET /campaigns/{id}","href":"/api-reference/endpoint/campaigns/get"},{"title":"Update campaign","openapi":"PATCH /campaigns/{id}","href":"/api-reference/endpoint/campaigns/update"},{"title":"Resend brand verification OTP","openapi":"POST /accounts/{account_id}/brand_verification_messages","href":"/api-reference/endpoint/campaigns/resend-brand-verification-message"}]},{"group":"Contacts","pages":[{"title":"Create contact","openapi":"POST /accounts/{account_id}/contacts","href":"/api-reference/endpoint/contacts/create"},{"title":"List contacts","openapi":"GET /accounts/{account_id}/contacts","href":"/api-reference/endpoint/contacts/list"},{"title":"Retrieve contact","openapi":"GET /contacts/{id}","href":"/api-reference/endpoint/contacts/get"},{"title":"Update contact","openapi":"PATCH /contacts/{id}","href":"/api-reference/endpoint/contacts/update"}]},{"group":"Messages","pages":[{"title":"Send message","openapi":"POST /accounts/{account_id}/messages","href":"/api-reference/endpoint/messages/create"},{"title":"List messages","openapi":"GET /accounts/{account_id}/messages","href":"/api-reference/endpoint/messages/list"},{"title":"Retrieve message","openapi":"GET /messages/{id}","href":"/api-reference/endpoint/messages/get"}]},{"group":"Phone numbers","pages":[{"title":"Purchase phone number","openapi":"POST /accounts/{account_id}/phone_numbers","href":"/api-reference/endpoint/phone-numbers/purchase"},{"title":"List phone numbers","openapi":"GET /accounts/{account_id}/phone_numbers","href":"/api-reference/endpoint/phone-numbers/list"},{"title":"Retrieve phone number","openapi":"GET /phone_numbers/{id}","href":"/api-reference/endpoint/phone-numbers/get"},{"title":"Update phone number","openapi":"PATCH /phone_numbers/{id}","href":"/api-reference/endpoint/phone-numbers/update"},{"title":"Release phone number","openapi":"DELETE /phone_numbers/{id}","href":"/api-reference/endpoint/phone-numbers/release"},{"title":"List available numbers","openapi":"GET /accounts/{account_id}/available_phone_numbers","href":"/api-reference/endpoint/phone-numbers/list-available-numbers"}]},{"group":"Recordings","pages":[{"title":"List recordings","openapi":"GET /accounts/{account_id}/recordings","href":"/api-reference/endpoint/recordings/list"},{"title":"Retrieve recording","openapi":"GET /recordings/{id}","href":"/api-reference/endpoint/recordings/get"},{"title":"Delete recording","openapi":"DELETE /recordings/{id}","href":"/api-reference/endpoint/recordings/delete"},{"title":"Download recording file","openapi":"GET /recordings/{recording_id}/file","href":"/api-reference/endpoint/recordings/get-file"}]},{"group":"Toll-free Campaigns","pages":[{"title":"Create toll-free campaign","openapi":"POST /accounts/{account_id}/toll_free_campaigns","href":"/api-reference/endpoint/toll-free-campaigns/create"},{"title":"List toll-free campaigns","openapi":"GET /accounts/{account_id}/toll_free_campaigns","href":"/api-reference/endpoint/toll-free-campaigns/list"},{"title":"Retrieve toll-free campaign","openapi":"GET /toll_free_campaigns/{campaign_id}","href":"/api-reference/endpoint/toll-free-campaigns/get"},{"title":"Update toll-free campaign","openapi":"PATCH /toll_free_campaigns/{campaign_id}","href":"/api-reference/endpoint/toll-free-campaigns/update"}]},{"group":"Users","pages":[{"title":"Create user","openapi":"POST /accounts/{account_id}/users","href":"/api-reference/endpoint/users/create"},{"title":"List users","openapi":"GET /accounts/{account_id}/users","href":"/api-reference/endpoint/users/list"},{"title":"Retrieve user","openapi":"GET /users/{id}","href":"/api-reference/endpoint/users/get"},{"title":"Update user","openapi":"PATCH /users/{id}","href":"/api-reference/endpoint/users/update"},{"title":"Delete user","openapi":"DELETE /users/{id}","href":"/api-reference/endpoint/users/delete"},{"title":"Create user token","openapi":"POST /users/{user_id}/tokens","href":"/api-reference/endpoint/users/create-token"}]},{"group":"Verifications","pages":[{"title":"Create verification","openapi":"POST /accounts/{account_id}/verifications","href":"/api-reference/endpoint/verifications/create"},{"title":"Check verification","openapi":"POST /verifications/{id}/checks","href":"/api-reference/endpoint/verifications/check"}]}]},{"group":"Webhooks","pages":[{"title":"Webhooks Overview","href":"/api-reference/webhooks/intro"},{"title":"Signature Verification","href":"/api-reference/webhooks/signature-validation"},{"group":"Events","pages":[{"title":"message.sent","openapi":"webhook messageSent","href":"/api-reference/webhooks/message/sent"},{"title":"message.delivered","openapi":"webhook messageDelivered","href":"/api-reference/webhooks/message/delivered"},{"title":"message.failed","openapi":"webhook messageFailed","href":"/api-reference/webhooks/message/failed"},{"title":"message.received","openapi":"webhook messageReceived","href":"/api-reference/webhooks/message/received"},{"title":"contact.opted_in","openapi":"webhook contactOptedIn","href":"/api-reference/webhooks/contact/opted_in"},{"title":"contact.opted_out","openapi":"webhook contactOptedOut","href":"/api-reference/webhooks/contact/opted_out"},{"title":"conversation.created","openapi":"webhook conversationCreated","href":"/api-reference/webhooks/conversation/created"},{"title":"campaign.submitted","openapi":"webhook campaignSubmitted","href":"/api-reference/webhooks/campaign/submitted"},{"title":"campaign.approved","openapi":"webhook campaignApproved","href":"/api-reference/webhooks/campaign/approved"},{"title":"campaign.rejected","openapi":"webhook campaignRejected","href":"/api-reference/webhooks/campaign/rejected"},{"title":"campaign.warning","openapi":"webhook campaignWarning","href":"/api-reference/webhooks/campaign/warning"},{"title":"phone_number.imported","openapi":"webhook phoneNumberImported","href":"/api-reference/webhooks/phone_number/imported"},{"title":"number_import.failed","href":"/api-reference/webhooks/number_import/failed"},{"title":"phone_number.attached_to_campaign","openapi":"webhook phoneNumberAttachedToCampaign","href":"/api-reference/webhooks/phone_number/attached_to_campaign"},{"title":"link.followed","openapi":"webhook linkFollowed","href":"/api-reference/webhooks/link/followed"},{"title":"call.ended","openapi":"webhook callEnded","href":"/api-reference/webhooks/call/ended"},{"title":"call_flow_event.created","openapi":"webhook callFlowEventCreated","href":"/api-reference/webhooks/call_flow_event/created"},{"title":"recording.completed","openapi":"webhook recordingCompleted","href":"/api-reference/webhooks/recording/completed"},{"title":"voicemail.received","openapi":"webhook voicemailReceived","href":"/api-reference/webhooks/voicemail/received"}]}]}]},{"anchor":"Resources","icon":"folder-open","pages":[{"title":"Resources","href":"/resources/hipaa"}]}]},"basePath":"","title":"Authentication - Surge","deploymentId":"dpl_XLevHnGPjzxq9mbREha5Faad63Sp","buildId":"dpl_XLevHnGPjzxq9mbREha5Faad63Sp","dynamics":[],"chunks":[]}