Service tokens provide an alternate authentication method to be used with the PlanetScale CLI and API. They are typically used in automated scenarios where pscale auth login cannot be used. Service tokens are also required for any calls to the API, as well as minting OAuth tokens for API use.
Create service tokens using the PlanetScale dashboard
To create a service token using the dashboard, log into your organization, go to the “Settings” > “Service tokens” page, and click the “New service token” button.Give the token a name (this is used for your reference only) and click “Create service token”.The modal will update, displaying your service token where the Name field was. Copy the ID and token values as you’ll need them moving forward. Click “Edit token permissions” to proceed.
Be sure to copy the service token after you create it. There’s no way to retrieve the token value once you leave this page.
Service tokens are configured with granular permissions, both for the organization that owns them as well as on a per database level. Before you can use a service token, these permissions must be added.
Organization permissions are required when performing operations that are specific to the organization and not for an individual database. To enable a service token for performing these operations, locate the Organization access section and click “Add organization permissions”.In the Organization access permissions modal, check the box next to each of the permission scopes that you want to assign to the token. Click “Save permissions” once finished.For a full list of organization access permissions, see the API documentation for service tokens.
In order to perform operations specific to a database, permissions can be assigned per-database. To do this, locate the section titled Database access and click “Add database access” to open the Database access permissions modal.Select the database you want to grant access to and check the box next to each permission option you need to grant. Once you are done, click “Save permissions”.For a full list of database access permissions, see the API documentation for service tokens.
Organization admins can grant database permissions to all current and future databases. This is available in the Permissions for all databases section.
Any permission added to all databases will not be able to be disabled on an individual basis.
A service token with the create_databases organization permission can create new databases in your organization. When a service token creates a database, it is automatically granted database access permissions for that database. You do not need to add database permissions separately for each database the token creates.Only organization administrators can grant the create_databases permission to a service token. Auto-granted permissions apply only to databases the token creates, not to existing databases in the organization.To grant this permission from the dashboard, open the service token’s Organization access section and click “Add organization permissions”. In the Organization access permissions modal, check the box for Create organization databases and click “Save permissions”.You can also grant organization access using the CLI:
Once the create_databases permission is in place, you can create databases with the token using the CLI or API.Refer to the Create a database API reference for all available parameters.
When a database requires administrator approval for deploy requests (located in your database’s Settings page), a service token cannot approve a deploy request created by the same service token. Also, users can’t approve a deploy request created by a service token that they created.
When you execute commands using the PlanetScale CLI, it will automatically parse those values and use them to access the service. However, you’ll also need to pass in your organization name using the --org flag like so:
If you don’t want to set environment variables, you may also pass in the Service Token and Service Token ID by using the --service-token and --service-token-id flags respectively:
In order to execute a request to the PlanetScale API, you’ll need a service token to execute requests directly or for minting OAuth tokens. Both the ID and token are required in the Authorization header without a scheme. Below is an example of how to use a service token to list details about the organizations the token can access:
curl --request GET \ --url 'https://api.planetscale.com/v1/organizations' \ --header 'Authorization: <SERVICE_TOKEN_ID>:<SERVICE_TOKEN>'
Refer to the API docs for more details on how to use the API.
If you want to modify the permissions granted to a service token, start by opening the service token from the settings pane. Select the three dots next to the organization or database name permissions you want to modify and click “Edit permissions”.
This will open a modal that allows you to modify the permissions the service token has to access that organization.
You can add database access permissions to your service token for each database in your organization.To add database access permissions, use the command:
Running pscale in CI or an AI agent uses a service token instead of pscale auth login. Provide the token as environment variables (recommended) or as flags on each command; both are equivalent:
# Environment variables (recommended for CI and agents)export PLANETSCALE_SERVICE_TOKEN_ID="<SERVICE_TOKEN_ID>"export PLANETSCALE_SERVICE_TOKEN="<SERVICE_TOKEN>"# Or per-command flagspscale database list --org <org> \ --service-token-id "<SERVICE_TOKEN_ID>" \ --service-token "<SERVICE_TOKEN>"
A service token has no active organization, so resource commands need the org supplied explicitly. Set it with PLANETSCALE_ORG, the --org flag on the subcommand, or pscale org switch <org> (which works with a service token):
export PLANETSCALE_ORG="<org>"pscale database list --format json # uses PLANETSCALE_ORGpscale database list --org <org> --format json # explicit flag
--org goes on the resource subcommand (database, branch, sql, api, …), never on root pscale. pscale --org <org> database list fails with unknown flag: --org.
pscale org show prints not authenticated yet. Please run 'pscale auth login' under a valid service token. This is the no-current-org state, not an auth failure. Do not respond by running pscale auth login. Discover the org with pscale org list and pass it with --org or PLANETSCALE_ORG.
pscale auth check --format json confirms a token is wired up. Expect "authenticated": true, "auth_method": "service_token", and (until an org is set) an action_required status with a NO_ORG issue and a non-zero exit code. Resolve it by passing --org/PLANETSCALE_ORG on your commands.
When a command’s human output is hard to parse, prefer --format json, or drop to the raw API with pscale api, which returns the API response verbatim and uses the same token:
# org listpscale api organizations --format json# database list / showpscale api organizations/<org>/databases --format jsonpscale api organizations/<org>/databases/<database> --format json# branch list / showpscale api organizations/<org>/databases/<database>/branches --format jsonpscale api organizations/<org>/databases/<database>/branches/<branch> --format json# service-token list / show-access (CLI blocked under service-token auth)pscale api organizations/<org>/service-tokens --format jsonpscale api organizations/<org>/service-tokens/<id> --format json
{"docsConfig":{"theme":"aspen","$schema":"https://mintlify.com/docs.json","name":"PlanetScale","description":"PlanetScale is a relational database platform for Vitess, Neki, and Postgres that gives you scale, performance, and reliability without sacrificing developer experience.","colors":{"primary":"#0e73cc","light":"#47b7f8","dark":"#f15817"},"logo":{"light":"https://mintcdn.com/planetscale-2/xUilVHToUFALai8a/logo/light.png?fit=max\u0026auto=format\u0026n=xUilVHToUFALai8a\u0026q=85\u0026s=cccd3c9fc813c01b899ab7af15a115b1","dark":"https://mintcdn.com/planetscale-2/xUilVHToUFALai8a/logo/dark.png?fit=max\u0026auto=format\u0026n=xUilVHToUFALai8a\u0026q=85\u0026s=4153888dc0ef54ddc3464738a2d7ee6e","href":"https://planetscale.com"},"favicon":"https://mintcdn.com/planetscale-2/DJh9Bv1aUZHTVDnK/favicon.svg?fit=max\u0026auto=format\u0026n=DJh9Bv1aUZHTVDnK\u0026q=85\u0026s=cc6ec9d8d0deb3450719bb4b5b6df73a","background":{"color":{"light":"#fafafa","dark":"#111111"}},"navbar":{"links":[{"href":"https://auth.planetscale.com/sign-in","label":"Log in"},{"href":"https://auth.planetscale.com/sign-up","label":"Get started"}],"primary":{"type":"button","label":"Get in touch","href":"https://planetscale.com/contact"}},"footer":{"socials":{"x":"https://twitter.com/planetscale","github":"https://github.com/planetscale","linkedin":"https://www.linkedin.com/company/planetscale","youtube":"https://www.youtube.com/c/PlanetScale","discord":"https://pscale.link/community","facebook":"https://www.facebook.com/planetscaledata"}},"seo":{"metatags":{"canonical":"https://planetscale.com/docs"}},"fonts":{"heading":{"family":"Inter"},"body":{"family":"Inter"}},"integrations":{"segment":{"key":"9Ujczlrndco2w8fcFAakL0FT4bsJCCh3"}},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"styling":{"latex":false},"navigation":{"global":{"anchors":[{"anchor":"Blog","icon":"newspaper","href":"https://planetscale.com/blog"},{"anchor":"Contact Us","icon":"headset","href":"https://planetscale.com/contact"},{"anchor":"Status","icon":"signal","href":"https://www.planetscalestatus.com/"},{"anchor":"Benchmarks","icon":"chart-line","href":"https://planetscale.com/benchmarks"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"planetscale-2","hasAudioNarration":false,"actualSubdomain":"planetscale-2","customDomains":["planetscale.com"],"gitSource":{"type":"github","owner":"planetscale","repo":"www","deployBranch":"main","contentDirectory":"content/mintlify/docs","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ae0d00e8f66b62075dabe46","collectionId":"97da3369-b90a-4cba-9879-e53bf4caef1e","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae0d00e8f66b62075dabe46"},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"CONTEXTUAL_FEEDBACK":{"status":"ENABLED"},"CODE_SNIPPET_FEEDBACK":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6ae0d00e8f66b62075dabe46","clientVersion":"0.0.3990","searchFilterCounts":[{"language":"default","tag":"Platform","count":286},{"language":"default","tag":"API Reference","count":262},{"language":"default","tag":"Vitess","count":182},{"language":"default","tag":"Postgres","count":108},{"language":"default","tag":"General API endpoints","count":93},{"language":"default","tag":"Vitess API endpoints","count":59},{"language":"default","tag":"Neki","count":58},{"language":"default","tag":"Guides","count":58},{"language":"default","tag":"Neki API endpoints","count":50},{"language":"default","tag":"Postgres API endpoints","count":46}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true,"deflection":{"enabled":true,"type":"link","url":"https://planetscale.com/contact?initial=support"}},"basePath":"/docs","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":"editor-v7-file-tree","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"pause-universal-search-reconcile","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":"per-site-search-delta","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":"editor-private-page-search","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":"editor-nav-generations","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":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-agent-model-picker","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"isAtlas":false,"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":"#content-container{column-gap:2rem}.nav-tabs{column-gap:.5em}.nav-tabs-item{padding:0 8px}.eyebrow,.light #navigation-items .text-gray-700,.nav-tabs a{color:#616161}#navigation-items .text-primary,#topbar-cta-button .text-white,#topbar-cta-button svg,.nav-tabs a.text-primary{color:#1a1a1a}.nav-tabs a.text-primary .bg-primary{background-color:#1a1a1a;left:0}.dark .nav-tabs a[href='/docs/vitess'i].text-primary,.nav-tabs a[href='/docs/vitess'i].text-primary{color:#f15817}.dark .nav-tabs a[href='/docs/vitess'i].text-primary .bg-primary,.nav-tabs a[href='/docs/vitess'i].text-primary .bg-primary{background-color:#f15817}.nav-tabs a[href='/docs/postgres'i].text-primary{color:#0e73cc}.nav-tabs a[href='/docs/postgres'i].text-primary .bg-primary{background-color:#0e73cc}.nav-tabs a[href='/docs/neki'i].text-primary{color:#8f7200}.nav-tabs a[href='/docs/neki'i].text-primary .bg-primary{background-color:#8f7200}.dark .nav-tabs a{color:#a1a1a1}.dark #navigation-items .text-primary,.dark .nav-tabs a.text-primary{color:#fafafa}.dark .nav-tabs a.text-primary .bg-primary{background-color:#fafafa}.dark .nav-tabs a[href='/docs/postgres'i].text-primary{color:#47b7f8}.dark .nav-tabs a[href='/docs/postgres'i].text-primary .bg-primary{background-color:#47b7f8}.dark .nav-tabs a[href='/docs/neki'i].text-primary{color:#fbca00}.dark .nav-tabs a[href='/docs/neki'i].text-primary .bg-primary{background-color:#fbca00}.prose:is(.dark *){color:#c1c1c1}.prose :where(a):not(:where([class~='not-prose'], [class~='not-prose'] *)){color:#0e73cc;font-weight:500}.dark .prose :where(a):not(:where(.not-prose, .not-prose *)){color:#47b7f8}.dark .eyebrow{color:#a1a1a1}@media (min-width:1024px){#content-container{padding-top:2rem;padding-right:2rem;padding-left:2.5rem}}#topbar-cta-button a>span{background-color:#fbca00}.group:hover span{opacity:1!important}.bg-primary\\/10{background-color:rgba(129,129,129,.1)}.dark .bg-primary\\/10{background-color:rgba(255,255,255,.1)}body[data-current-path^='/vitess'] svg.bg-primary{background-color:#f15817}body[data-current-path^='/vitess'] .border-primary{border-color:#f15817}body[data-current-path^='/vitess'] #table-of-contents-content .text-primary,body[data-current-path^='/vitess'] .eyebrow{color:#f15817}body[data-current-path^='/vitess'] .card-group a:hover{border-color:#f15817!important}body[data-current-path^='/postgres'] .eyebrow{color:#0e73cc}.dark body[data-current-path^='/postgres'] .eyebrow{color:#47b7f8}body[data-current-path^='/neki'] svg.bg-primary{background-color:#8f7200}body[data-current-path^='/neki'] [data-component-part=card-icon]{background-color:#fbca00}body[data-current-path^='/neki'] [data-component-part=card-icon] svg.bg-primary{background-color:#1a1a1a;transform:scale(.7);transform-origin:center}body[data-current-path^='/neki'] .border-primary{border-color:#8f7200}body[data-current-path^='/neki'] #table-of-contents-content .text-primary{color:#1a1a1a;background-color:transparent;border-color:#fbca00}body[data-current-path^='/neki'] .eyebrow{display:inline-flex;align-items:center;width:fit-content;height:auto;min-height:1.25rem;padding:0 .375rem;color:#1a1a1a;background-color:#fbca00}body[data-current-path^='/neki'] .eyebrow:empty,body[data-current-path^='/neki'] .eyebrow[data-empty]{display:none}.dark body[data-current-path^='/neki'] .card-group .card:hover,body[data-current-path^='/neki'] .card-group .card:hover{--primary:251 202 0;--primary-light:251 202 0;border-color:#fbca00!important}.dark body[data-current-path^='/neki'] [data-component-part=card-icon],.dark body[data-current-path^='/neki'] svg.bg-primary{background-color:#fbca00}.dark body[data-current-path^='/neki'] [data-component-part=card-icon] svg.bg-primary{background-color:#1a1a1a}.dark body[data-current-path^='/neki'] .border-primary{border-color:#fbca00}.dark body[data-current-path^='/neki'] #table-of-contents-content .text-primary{color:#fafafa;background-color:transparent;border-color:#fbca00}.dark body[data-current-path^='/neki'] .eyebrow{color:#1a1a1a;background-color:#fbca00}footer div:last-child{display:none}#header,#pagination a,[data-component-part=card-content-container],[data-component-part=frame-caption]{text-wrap:balance}.step:last-of-type [data-component-part=step-line]{opacity:0}"}],"page":{"pagePath":"api/service-tokens","slug":"/api/service-tokens","pageMetadata":{"title":"Service tokens","description":"PlanetScale provides the ability to create service tokens for your PlanetScale organization via the CLI or directly in the UI.","og:image":"images/og/api/service-tokens.png","href":"/api/service-tokens"},"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: \"PlanetScale provides the ability to create service tokens for your PlanetScale organization via the CLI or directly in the UI.\"\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`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{CodeBlock,Frame,Heading,OptimizedImage,Table,Tip,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Frame)_missingMdxReference(`Frame`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!OptimizedImage)_missingMdxReference(`OptimizedImage`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tip)_missingMdxReference(`Tip`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`2`,id:`overview`,children:`Overview`}),`\n`,_jsxs(_components.p,{children:[`Service tokens provide an alternate authentication method to be used with the PlanetScale CLI and API. They are typically used in automated scenarios where `,_jsx(_components.code,{children:`pscale auth login`}),` cannot be used. Service tokens are also required for any calls to the API, as well as minting OAuth tokens for API use.`]}),`\n`,_jsx(Heading,{level:`2`,id:`create-service-tokens-using-the-planetscale-dashboard`,children:`Create service tokens using the PlanetScale dashboard`}),`\n`,_jsxs(_components.p,{children:[`To create a service token using the dashboard, log into your organization, go to the `,_jsxs(_components.a,{href:`https://app.planetscale.com/~/settings/service-tokens`,children:[_jsx(_components.strong,{children:`“Settings”`}),` > `,_jsx(_components.strong,{children:`“Service tokens”`})]}),` page, and click the `,_jsx(_components.strong,{children:`“New service token”`}),` button.`]}),`\n`,_jsxs(_components.p,{children:[`Give the token a name (this is used for your reference only) and click `,_jsx(_components.strong,{children:`“Create service token”`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`The modal will update, displaying your service token where the Name field was. Copy the ID and token values as you’ll need them moving forward. Click `,_jsx(_components.strong,{children:`“Edit token permissions”`}),` to proceed.`]}),`\n`,_jsx(Tip,{children:_jsx(_components.p,{children:`Be sure to copy the service token after you create it. There’s no way to retrieve the token value once you leave this page.`})}),`\n`,_jsx(Frame,{children:_jsx(OptimizedImage,{src:`https://mintcdn.com/planetscale-2/GA0k5H-MolPvBjDk/images/assets/docs/concepts/service-tokens/modal-with-service-token-2.png?fit=max\u0026auto=format\u0026n=GA0k5H-MolPvBjDk\u0026q=85\u0026s=1f18f07b836f9395cc035223cfc9e437`,alt:`Service token detail page`,\"data-og-width\":`1220`,width:`1220`,\"data-og-height\":`972`,height:`972`,\"data-path\":`images/assets/docs/concepts/service-tokens/modal-with-service-token-2.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/planetscale-2/GA0k5H-MolPvBjDk/images/assets/docs/concepts/service-tokens/modal-with-service-token-2.png?w=280\u0026fit=max\u0026auto=format\u0026n=GA0k5H-MolPvBjDk\u0026q=85\u0026s=6b8b964f7bff6ee8b3f68206d28e0508 280w, https://mintcdn.com/planetscale-2/GA0k5H-MolPvBjDk/images/assets/docs/concepts/service-tokens/modal-with-service-token-2.png?w=560\u0026fit=max\u0026auto=format\u0026n=GA0k5H-MolPvBjDk\u0026q=85\u0026s=ecfb220fc14bee244e969c37b9704bfd 560w, https://mintcdn.com/planetscale-2/GA0k5H-MolPvBjDk/images/assets/docs/concepts/service-tokens/modal-with-service-token-2.png?w=840\u0026fit=max\u0026auto=format\u0026n=GA0k5H-MolPvBjDk\u0026q=85\u0026s=d17f2534fd5226b7ba759437917f29d7 840w, https://mintcdn.com/planetscale-2/GA0k5H-MolPvBjDk/images/assets/docs/concepts/service-tokens/modal-with-service-token-2.png?w=1100\u0026fit=max\u0026auto=format\u0026n=GA0k5H-MolPvBjDk\u0026q=85\u0026s=4d69a3882b65409ba250111794e90b24 1100w, https://mintcdn.com/planetscale-2/GA0k5H-MolPvBjDk/images/assets/docs/concepts/service-tokens/modal-with-service-token-2.png?w=1650\u0026fit=max\u0026auto=format\u0026n=GA0k5H-MolPvBjDk\u0026q=85\u0026s=2139e7ed502211c03ca4fa825ac0c1fe 1650w, https://mintcdn.com/planetscale-2/GA0k5H-MolPvBjDk/images/assets/docs/concepts/service-tokens/modal-with-service-token-2.png?w=2500\u0026fit=max\u0026auto=format\u0026n=GA0k5H-MolPvBjDk\u0026q=85\u0026s=9e0549863228c5adf442a450b9632190 2500w`})}),`\n`,_jsx(Heading,{level:`2`,id:`assign-service-token-permissions`,children:`Assign service token permissions`}),`\n`,_jsx(_components.p,{children:`Service tokens are configured with granular permissions, both for the organization that owns them as well as on a per database level. Before you can use a service token, these permissions must be added.`}),`\n`,_jsx(Heading,{level:`3`,id:`add-organization-permissions`,children:`Add organization permissions`}),`\n`,_jsxs(_components.p,{children:[`Organization permissions are required when performing operations that are specific to the organization and not for an individual database. To enable a service token for performing these operations, locate the `,_jsx(_components.strong,{children:`Organization access`}),` section and click `,_jsx(_components.strong,{children:`“Add organization permissions”`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`In the `,_jsx(_components.strong,{children:`Organization access permissions`}),` modal, check the box next to each of the permission scopes that you want to assign to the token. Click `,_jsx(_components.strong,{children:`“Save permissions”`}),` once finished.`]}),`\n`,_jsxs(_components.p,{children:[`For a full list of organization access permissions, see the `,_jsx(_components.a,{href:`/api/reference/service-tokens#organization-access-permissions`,children:`API documentation for service tokens`}),`.`]}),`\n`,_jsx(Heading,{level:`3`,id:`add-database-permissions`,children:`Add database permissions`}),`\n`,_jsxs(_components.p,{children:[`In order to perform operations specific to a database, permissions can be assigned per-database. To do this, locate the section titled `,_jsx(_components.strong,{children:`Database access`}),` and click `,_jsx(_components.strong,{children:`“Add database access”`}),` to open the `,_jsx(_components.strong,{children:`Database access permissions`}),` modal.`]}),`\n`,_jsxs(_components.p,{children:[`Select the database you want to grant access to and check the box next to each permission option you need to grant. Once you are done, click `,_jsx(_components.strong,{children:`“Save permissions”`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`For a full list of database access permissions, see the `,_jsx(_components.a,{href:`/api/reference/service-tokens#database-access-permissions`,children:`API documentation for service tokens`}),`.`]}),`\n`,_jsx(Frame,{children:_jsx(OptimizedImage,{src:`https://mintcdn.com/planetscale-2/GA0k5H-MolPvBjDk/images/assets/docs/concepts/service-tokens/db-access-permissions-2.png?fit=max\u0026auto=format\u0026n=GA0k5H-MolPvBjDk\u0026q=85\u0026s=2f2a5fae0c095305dc848397de6962a5`,alt:`The Database access permissions modal.`,\"data-og-width\":`1173`,width:`1173`,\"data-og-height\":`1236`,height:`1236`,\"data-path\":`images/assets/docs/concepts/service-tokens/db-access-permissions-2.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/planetscale-2/GA0k5H-MolPvBjDk/images/assets/docs/concepts/service-tokens/db-access-permissions-2.png?w=280\u0026fit=max\u0026auto=format\u0026n=GA0k5H-MolPvBjDk\u0026q=85\u0026s=ad8f9989e1ca8119ed52396094a70cbc 280w, https://mintcdn.com/planetscale-2/GA0k5H-MolPvBjDk/images/assets/docs/concepts/service-tokens/db-access-permissions-2.png?w=560\u0026fit=max\u0026auto=format\u0026n=GA0k5H-MolPvBjDk\u0026q=85\u0026s=5e8b89156ee9d79ae8895435ee91cf72 560w, https://mintcdn.com/planetscale-2/GA0k5H-MolPvBjDk/images/assets/docs/concepts/service-tokens/db-access-permissions-2.png?w=840\u0026fit=max\u0026auto=format\u0026n=GA0k5H-MolPvBjDk\u0026q=85\u0026s=254ff3c8ae1a2c66557965739c27f021 840w, https://mintcdn.com/planetscale-2/GA0k5H-MolPvBjDk/images/assets/docs/concepts/service-tokens/db-access-permissions-2.png?w=1100\u0026fit=max\u0026auto=format\u0026n=GA0k5H-MolPvBjDk\u0026q=85\u0026s=7d9a92296e85fb8db95ecb034dee9878 1100w, https://mintcdn.com/planetscale-2/GA0k5H-MolPvBjDk/images/assets/docs/concepts/service-tokens/db-access-permissions-2.png?w=1650\u0026fit=max\u0026auto=format\u0026n=GA0k5H-MolPvBjDk\u0026q=85\u0026s=7f8ecf4e7c026fe61eccf5c47e8fd0f0 1650w, https://mintcdn.com/planetscale-2/GA0k5H-MolPvBjDk/images/assets/docs/concepts/service-tokens/db-access-permissions-2.png?w=2500\u0026fit=max\u0026auto=format\u0026n=GA0k5H-MolPvBjDk\u0026q=85\u0026s=a865a4bfd9b1cbc48b402919149855ae 2500w`})}),`\n`,_jsx(Heading,{level:`3`,id:`add-permissions-for-all-databases`,children:`Add permissions for all databases`}),`\n`,_jsxs(_components.p,{children:[`Organization admins can grant database permissions to all current and future databases. This is available in the `,_jsx(_components.strong,{children:`Permissions for all databases`}),` section.\nAny permission added to all databases will not be able to be disabled on an individual basis.`]}),`\n`,_jsx(Heading,{level:`2`,id:`creating-databases-with-service-tokens`,children:`Creating databases with service tokens`}),`\n`,_jsxs(_components.p,{children:[`A service token with the `,_jsx(_components.code,{children:`create_databases`}),` organization permission can create new databases in your organization. When a service token creates a database, it is automatically granted `,_jsx(_components.a,{href:`/api/reference/service-tokens#database-access-permissions`,children:`database access permissions`}),` for that database. You do not need to add database permissions separately for each database the token creates.`]}),`\n`,_jsxs(_components.p,{children:[`Only organization administrators can grant the `,_jsx(_components.code,{children:`create_databases`}),` permission to a service token. Auto-granted permissions apply only to databases the token creates, not to existing databases in the organization.`]}),`\n`,_jsxs(_components.p,{children:[`To grant this permission from the dashboard, open the service token’s `,_jsx(_components.strong,{children:`Organization access`}),` section and click `,_jsx(_components.strong,{children:`“Add organization permissions”`}),`. In the `,_jsx(_components.strong,{children:`Organization access permissions`}),` modal, check the box for `,_jsx(_components.strong,{children:`Create organization databases`}),` and click `,_jsx(_components.strong,{children:`“Save permissions”`}),`.`]}),`\n`,_jsx(_components.p,{children:`You can also grant organization access using the CLI:`}),`\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:`pscale`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` service-token`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` add-access`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`SERVICE_TOKEN_I`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`D`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` create_databases`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Once the `,_jsx(_components.code,{children:`create_databases`}),` permission is in place, you can create databases with the token using the CLI or API.`]}),`\n`,_jsxs(_components.p,{children:[`Refer to the `,_jsx(_components.a,{href:`/api/reference/create_database`,children:`Create a database`}),` API reference for all available parameters.`]}),`\n`,_jsx(Heading,{level:`2`,id:`service-tokens-and-deploy-requests-approvals`,children:`Service tokens and deploy requests approvals`}),`\n`,_jsxs(_components.p,{children:[`When a database requires administrator approval for deploy requests (located in your database’s `,_jsx(_components.strong,{children:`Settings`}),` page), a service token cannot approve a deploy request created by the same service token. Also, users can’t approve a deploy request created by a service token that they created.`]}),`\n`,_jsx(Heading,{level:`2`,id:`use-a-service-token-with-the-planetscale-cli`,children:`Use a service token with the PlanetScale CLI`}),`\n`,_jsx(_components.p,{children:`To use service tokens with the PlanetScale CLI, set the following environment variables in your terminal:`}),`\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:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`export`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` PLANETSCALE_SERVICE_TOKEN`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=\u003c`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`YOUR_SERVICE_TOKEN`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`export`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` PLANETSCALE_SERVICE_TOKEN_ID`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=\u003c`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`YOUR_SERVICE_TOKEN_ID`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`When you execute commands using the PlanetScale CLI, it will automatically parse those values and use them to access the service. However, you’ll also need to pass in your organization name using the `,_jsx(_components.code,{children:`--org`}),` flag like so:`]}),`\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:`pscale`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` branch`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` create`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`DB_NAM`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`E`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`BRANCH_NAM`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`E`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --org`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`ORG_NAM`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`E`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`If you don’t want to set environment variables, you may also pass in the Service Token and Service Token ID by using the `,_jsxs(_components.a,{href:`/cli/service-token`,children:[_jsx(_components.code,{children:`--service-token`}),` and `,_jsx(_components.code,{children:`--service-token-id`}),` flags`]}),` respectively:`]}),`\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:`pscale`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` branch`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` create`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`DB_NAM`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`E`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`BRANCH_NAM`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`E`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --org`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`ORG_NAM`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`E`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --service-token`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`SERVICE_TOKE`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`N`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --service-token-id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`SERVICE_TOKEN_I`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`D`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`use-a-service-token-with-the-planetscale-api`,children:`Use a service token with the PlanetScale API`}),`\n`,_jsxs(_components.p,{children:[`In order to execute a request to the PlanetScale API, you’ll need a service token to execute requests directly or for minting OAuth tokens. Both the ID and token are required in the `,_jsx(_components.code,{children:`Authorization`}),` header without a scheme. Below is an example of how to use a service token to list details about the organizations the token can access:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,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:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --request`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` GET`}),_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:` --url`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://api.planetscale.com/v1/organizations'`}),_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:` --header`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Authorization: \u003cSERVICE_TOKEN_ID>:\u003cSERVICE_TOKEN>'`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Refer to the `,_jsx(_components.a,{href:`/api/reference/getting-started-with-planetscale-api`,children:`API docs`}),` for more details on how to use the API.`]}),`\n`,_jsx(Heading,{level:`2`,id:`modify-service-token-permissions`,children:`Modify service token permissions`}),`\n`,_jsxs(_components.p,{children:[`If you want to modify the permissions granted to a service token, start by opening the service token from the settings pane. Select the three dots next to the organization or database name permissions you want to modify and click `,_jsx(_components.strong,{children:`“Edit permissions”`}),`.`]}),`\n`,_jsx(Frame,{children:_jsx(OptimizedImage,{src:`https://mintcdn.com/planetscale-2/GA0k5H-MolPvBjDk/images/assets/docs/concepts/service-tokens/edit-org-perms-2.png?fit=max\u0026auto=format\u0026n=GA0k5H-MolPvBjDk\u0026q=85\u0026s=2ff592a3bac8993002f800c5b41ad4b0`,alt:`The location of the Edit permissions option for organization permissions.`,\"data-og-width\":`1353`,width:`1353`,\"data-og-height\":`1012`,height:`1012`,\"data-path\":`images/assets/docs/concepts/service-tokens/edit-org-perms-2.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/planetscale-2/GA0k5H-MolPvBjDk/images/assets/docs/concepts/service-tokens/edit-org-perms-2.png?w=280\u0026fit=max\u0026auto=format\u0026n=GA0k5H-MolPvBjDk\u0026q=85\u0026s=de468559b21d1de3a9b5ebe17a685ce4 280w, https://mintcdn.com/planetscale-2/GA0k5H-MolPvBjDk/images/assets/docs/concepts/service-tokens/edit-org-perms-2.png?w=560\u0026fit=max\u0026auto=format\u0026n=GA0k5H-MolPvBjDk\u0026q=85\u0026s=c4e0761dcad008ba733deb90d7498a48 560w, https://mintcdn.com/planetscale-2/GA0k5H-MolPvBjDk/images/assets/docs/concepts/service-tokens/edit-org-perms-2.png?w=840\u0026fit=max\u0026auto=format\u0026n=GA0k5H-MolPvBjDk\u0026q=85\u0026s=5780573dc61103c1413c071343ec275c 840w, https://mintcdn.com/planetscale-2/GA0k5H-MolPvBjDk/images/assets/docs/concepts/service-tokens/edit-org-perms-2.png?w=1100\u0026fit=max\u0026auto=format\u0026n=GA0k5H-MolPvBjDk\u0026q=85\u0026s=d7ab59ae612941ac39c690b4ccd2e714 1100w, https://mintcdn.com/planetscale-2/GA0k5H-MolPvBjDk/images/assets/docs/concepts/service-tokens/edit-org-perms-2.png?w=1650\u0026fit=max\u0026auto=format\u0026n=GA0k5H-MolPvBjDk\u0026q=85\u0026s=908fc1f14fd170ed16b57f6be9f4e220 1650w, https://mintcdn.com/planetscale-2/GA0k5H-MolPvBjDk/images/assets/docs/concepts/service-tokens/edit-org-perms-2.png?w=2500\u0026fit=max\u0026auto=format\u0026n=GA0k5H-MolPvBjDk\u0026q=85\u0026s=90cc315d328b832a8f3f1820cef1b4be 2500w`})}),`\n`,_jsx(_components.p,{children:`This will open a modal that allows you to modify the permissions the service token has to access that organization.`}),`\n`,_jsx(Heading,{level:`2`,id:`delete-a-service-token`,children:`Delete a service token`}),`\n`,_jsxs(_components.p,{children:[`You can delete a service token at any time from the service token detail page. Simply click the `,_jsx(_components.strong,{children:`“Delete service token”`}),` button.`]}),`\n`,_jsx(Frame,{children:_jsx(OptimizedImage,{src:`https://mintcdn.com/planetscale-2/GA0k5H-MolPvBjDk/images/assets/docs/concepts/service-tokens/delete-service-token-2.png?fit=max\u0026auto=format\u0026n=GA0k5H-MolPvBjDk\u0026q=85\u0026s=81a02e008e79a793ba15464b09e3b759`,alt:`Delete service token.`,\"data-og-width\":`1361`,width:`1361`,\"data-og-height\":`337`,height:`337`,\"data-path\":`images/assets/docs/concepts/service-tokens/delete-service-token-2.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/planetscale-2/GA0k5H-MolPvBjDk/images/assets/docs/concepts/service-tokens/delete-service-token-2.png?w=280\u0026fit=max\u0026auto=format\u0026n=GA0k5H-MolPvBjDk\u0026q=85\u0026s=2d575f146408408ecd14995993f1102c 280w, https://mintcdn.com/planetscale-2/GA0k5H-MolPvBjDk/images/assets/docs/concepts/service-tokens/delete-service-token-2.png?w=560\u0026fit=max\u0026auto=format\u0026n=GA0k5H-MolPvBjDk\u0026q=85\u0026s=6befd7a440764827acd162bc11ebba31 560w, https://mintcdn.com/planetscale-2/GA0k5H-MolPvBjDk/images/assets/docs/concepts/service-tokens/delete-service-token-2.png?w=840\u0026fit=max\u0026auto=format\u0026n=GA0k5H-MolPvBjDk\u0026q=85\u0026s=6821ff07da3452180307f951a930e983 840w, https://mintcdn.com/planetscale-2/GA0k5H-MolPvBjDk/images/assets/docs/concepts/service-tokens/delete-service-token-2.png?w=1100\u0026fit=max\u0026auto=format\u0026n=GA0k5H-MolPvBjDk\u0026q=85\u0026s=dd8a041da990bb1223a2529d7274c124 1100w, https://mintcdn.com/planetscale-2/GA0k5H-MolPvBjDk/images/assets/docs/concepts/service-tokens/delete-service-token-2.png?w=1650\u0026fit=max\u0026auto=format\u0026n=GA0k5H-MolPvBjDk\u0026q=85\u0026s=6e1f63a2a0d680a891318896e7b56651 1650w, https://mintcdn.com/planetscale-2/GA0k5H-MolPvBjDk/images/assets/docs/concepts/service-tokens/delete-service-token-2.png?w=2500\u0026fit=max\u0026auto=format\u0026n=GA0k5H-MolPvBjDk\u0026q=85\u0026s=d7ac5491944cb607a0102bcadbd7c362 2500w`})}),`\n`,_jsx(Heading,{level:`2`,id:`manage-service-tokens-using-the-planetscale-cli`,children:`Manage service tokens using the PlanetScale CLI`}),`\n`,_jsxs(_components.p,{children:[`Service tokens can also be created and managed directly from the `,_jsx(_components.a,{href:`/cli/service-token`,children:`PlanetScale CLI`}),`.`]}),`\n`,_jsx(Heading,{level:`3`,id:`create-a-new-service-token`,children:`Create a new service token`}),`\n`,_jsx(_components.p,{children:`Use the following command to create a service token:`}),`\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:`pscale`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` service-token`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` create`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`This command will return a service token ID and value for your use.`}),`\n`,_jsx(Heading,{level:`3`,id:`add-database-access-permissions`,children:`Add database access permissions`}),`\n`,_jsx(_components.p,{children:`You can add database access permissions to your service token for each database in your organization.`}),`\n`,_jsx(_components.p,{children:`To add database access permissions, use the command:`}),`\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:`pscale`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` service-token`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` add-access`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`SERVICE_TOKEN_I`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`D`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`ACCESS_PERMISSIO`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`N`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --database`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`DB_NAM`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`E`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`For example, to give a service token the ability to create, read, and delete branches on a specific database, use the following command:`}),`\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:`pscale`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` service-token`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` add-access`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`SERVICE_TOKEN_I`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`D`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` read_branch`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` delete_branch`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` create_branch`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --database`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`DB_NAM`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`E`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`A complete list of service token access permissions can be found in the `,_jsx(_components.a,{href:`/api/reference/service-tokens#access-permissions`,children:`PlanetScale API documentation`}),`.`]}),`\n`,_jsx(Heading,{level:`3`,id:`remove-database-access-permissions`,children:`Remove database access permissions`}),`\n`,_jsx(_components.p,{children:`You can also remove database access permissions for a service token.`}),`\n`,_jsx(_components.p,{children:`Use the following command to remove one or more permissions:`}),`\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:`pscale`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` service-token`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` delete-access`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`SERVICE_TOKEN_I`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`D`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`ACCESS_PERMISSIO`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`N`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --database`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`DB_NAM`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`E`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`delete-a-service-token-2`,children:`Delete a service token`}),`\n`,_jsx(_components.p,{children:`To delete a service token, run the following command:`}),`\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:`pscale`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` service-token`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` delete`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`SERVICE_TOKEN_I`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`D`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`service-token-automation`,children:`Service token automation`}),`\n`,_jsxs(_components.p,{children:[`Running `,_jsx(_components.code,{children:`pscale`}),` in CI or an AI agent uses a `,_jsx(_components.a,{href:`/cli/service-tokens`,children:`service token`}),` instead of `,_jsx(_components.code,{children:`pscale auth login`}),`. Provide the token as environment variables (recommended) or as flags on each command; both are equivalent:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`8`,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:`8`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Environment variables (recommended for CI and agents)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`export`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` PLANETSCALE_SERVICE_TOKEN_ID`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\u003cSERVICE_TOKEN_ID>\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`export`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` PLANETSCALE_SERVICE_TOKEN`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\u003cSERVICE_TOKEN>\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Or per-command flags`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`pscale`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` database`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` list`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --org`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`or`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`g`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`}),_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:` --service-token-id`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"\u003cSERVICE_TOKEN_ID>\"`}),_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:` --service-token`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"\u003cSERVICE_TOKEN>\"`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`A service token has `,_jsx(_components.strong,{children:`no active organization`}),`, so resource commands need the org supplied explicitly. Set it with `,_jsx(_components.code,{children:`PLANETSCALE_ORG`}),`, the `,_jsx(_components.code,{children:`--org`}),` flag on the subcommand, or `,_jsx(_components.code,{children:`pscale org switch \u003corg>`}),` (which works with a service token):`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,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:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`export`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` PLANETSCALE_ORG`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\u003corg>\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`pscale`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` database`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` list`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --format`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` json`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # uses PLANETSCALE_ORG`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`pscale`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` database`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` list`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --org`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`or`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`g`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --format`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` json`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # explicit flag`})]}),`\n`]})})}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`--org`}),` goes on the `,_jsx(_components.strong,{children:`resource subcommand`}),` (`,_jsx(_components.code,{children:`database`}),`, `,_jsx(_components.code,{children:`branch`}),`, `,_jsx(_components.code,{children:`sql`}),`, `,_jsx(_components.code,{children:`api`}),`, …), never on root `,_jsx(_components.code,{children:`pscale`}),`. `,_jsx(_components.code,{children:`pscale --org \u003corg> database list`}),` fails with `,_jsx(_components.code,{children:`unknown flag: --org`}),`.`]})}),`\n`,_jsxs(_components.p,{children:[`Per-command-family matrices (env-var auth, `,_jsx(_components.code,{children:`--service-token`}),` flag, required `,_jsx(_components.code,{children:`--org`}),`, Postgres/Vitess, `,_jsx(_components.code,{children:`--format json`}),`, API equivalent): `,_jsx(_components.a,{href:`/cli/org#service-token-automation-org`,children:_jsx(_components.code,{children:`org`})}),` · `,_jsx(_components.a,{href:`/cli/service-token#service-token-automation-service-token`,children:_jsx(_components.code,{children:`service-token`})}),` · `,_jsx(_components.a,{href:`/cli/database#service-token-automation-database`,children:_jsx(_components.code,{children:`database`})}),` · `,_jsx(_components.a,{href:`/cli/branch#service-token-automation-branch`,children:_jsx(_components.code,{children:`branch`})}),` · `,_jsx(_components.a,{href:`/cli/role#service-token-automation-role`,children:_jsx(_components.code,{children:`role`})}),` · `,_jsx(_components.a,{href:`/cli/password#service-token-automation-password`,children:_jsx(_components.code,{children:`password`})}),`.`]}),`\n`,_jsx(Heading,{level:`3`,id:`commands-to-avoid-under-a-service-token`,children:`Commands to avoid under a service token`}),`\n`,_jsx(_components.p,{children:`Do not retry these with service-token auth. The failure is by design, not transient. This is the most common cause of agent retry loops.`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{style:{textAlign:`left`},children:`Command`}),_jsx(_components.th,{style:{textAlign:`left`},children:`Why`}),_jsx(_components.th,{style:{textAlign:`left`},children:`Do this instead`}),_jsx(_components.th,{style:{textAlign:`left`},children:`Exact error`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{style:{textAlign:`left`},children:_jsx(_components.code,{children:`pscale org show`})}),_jsx(_components.td,{style:{textAlign:`left`},children:`A service token has no “current” organization`}),_jsxs(_components.td,{style:{textAlign:`left`},children:[_jsx(_components.code,{children:`pscale org list --format json`}),`, then pass `,_jsx(_components.code,{children:`--org`}),` or `,_jsx(_components.code,{children:`PLANETSCALE_ORG`})]}),_jsx(_components.td,{style:{textAlign:`left`},children:_jsx(_components.code,{children:`not authenticated yet. Please run 'pscale auth login'`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{style:{textAlign:`left`},children:_jsx(_components.code,{children:`pscale service-token list`})}),_jsx(_components.td,{style:{textAlign:`left`},children:`Token management is blocked when authenticated with a token`}),_jsx(_components.td,{style:{textAlign:`left`},children:_jsx(_components.code,{children:`pscale api organizations/\u003corg>/service-tokens --format json`})}),_jsx(_components.td,{style:{textAlign:`left`},children:_jsx(_components.code,{children:`pscale service-token list is unavailable when authenticated with a service token`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{style:{textAlign:`left`},children:_jsx(_components.code,{children:`pscale service-token show-access`})}),_jsxs(_components.td,{style:{textAlign:`left`},children:[`Same as `,_jsx(_components.code,{children:`list`})]}),_jsx(_components.td,{style:{textAlign:`left`},children:_jsx(_components.code,{children:`pscale api organizations/\u003corg>/service-tokens/\u003cid> --format json`})}),_jsx(_components.td,{style:{textAlign:`left`},children:_jsx(_components.code,{children:`pscale service-token show-access is unavailable when authenticated with a service token`})})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{style:{textAlign:`left`},children:[_jsx(_components.code,{children:`pscale service-token`}),` (other sub-commands)`]}),_jsx(_components.td,{style:{textAlign:`left`},children:`Create/manage tokens blocked under service-token auth`}),_jsxs(_components.td,{style:{textAlign:`left`},children:[_jsx(_components.code,{children:`pscale auth login`}),`, then CLI; or `,_jsx(_components.a,{href:`/api/reference/service-tokens`,children:`Service tokens API`})]}),_jsx(_components.td,{style:{textAlign:`left`},children:_jsx(_components.code,{children:`pscale service-token \u003csub-command> is unavailable when authenticated with a service token`})})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{style:{textAlign:`left`},children:[_jsx(_components.code,{children:`pscale auth login`}),` / `,_jsx(_components.code,{children:`logout`})]}),_jsx(_components.td,{style:{textAlign:`left`},children:`Not needed; the token is the credential`}),_jsxs(_components.td,{style:{textAlign:`left`},children:[`Set the token env vars; run `,_jsx(_components.code,{children:`pscale auth check --format json`}),` to confirm`]}),_jsx(_components.td,{style:{textAlign:`left`},children:`requires an interactive browser device flow`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{style:{textAlign:`left`},children:[_jsx(_components.code,{children:`pscale shell`}),` / `,_jsx(_components.code,{children:`connect`})]}),_jsx(_components.td,{style:{textAlign:`left`},children:`Interactive sessions`}),_jsxs(_components.td,{style:{textAlign:`left`},children:[`Use `,_jsx(_components.a,{href:`/cli/sql`,children:_jsx(_components.code,{children:`pscale sql`})}),` for non-interactive queries`]}),_jsx(_components.td,{style:{textAlign:`left`},children:`opens an interactive session`})]})]})]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`pscale org show`}),` prints `,_jsx(_components.code,{children:`not authenticated yet. Please run 'pscale auth login'`}),` under a valid service token. This is the `,_jsx(_components.strong,{children:`no-current-org`}),` state, not an auth failure. Do `,_jsx(_components.strong,{children:`not`}),` respond by running `,_jsx(_components.code,{children:`pscale auth login`}),`. Discover the org with `,_jsx(_components.code,{children:`pscale org list`}),` and pass it with `,_jsx(_components.code,{children:`--org`}),` or `,_jsx(_components.code,{children:`PLANETSCALE_ORG`}),`.`]})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`pscale auth check --format json`}),` confirms a token is wired up. Expect `,_jsx(_components.code,{children:`\"authenticated\": true`}),`, `,_jsx(_components.code,{children:`\"auth_method\": \"service_token\"`}),`, and (until an org is set) an `,_jsx(_components.code,{children:`action_required`}),` status with a `,_jsx(_components.code,{children:`NO_ORG`}),` issue and a non-zero exit code. Resolve it by passing `,_jsx(_components.code,{children:`--org`}),`/`,_jsx(_components.code,{children:`PLANETSCALE_ORG`}),` on your commands.`]}),`\n`,_jsxs(Heading,{level:`3`,id:`pscale-api-fallback-for-hard-to-parse-output`,children:[_jsx(_components.code,{children:`pscale api`}),` fallback for hard-to-parse output`]}),`\n`,_jsxs(_components.p,{children:[`When a command’s human output is hard to parse, prefer `,_jsx(_components.code,{children:`--format json`}),`, or drop to the raw API with `,_jsx(_components.code,{children:`pscale api`}),`, which returns the API response verbatim and uses the same token:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`14`,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:`14`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# org list`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`pscale`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` api`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` organizations`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --format`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` json`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# database list / show`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`pscale`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` api`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` organizations/`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`or`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`g`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`/databases`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --format`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` json`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`pscale`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` api`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` organizations/`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`or`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`g`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`/databases/`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`databas`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`e`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --format`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` json`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# branch list / show`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`pscale`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` api`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` organizations/`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`or`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`g`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`/databases/`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`databas`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`e`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`/branches`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --format`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` json`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`pscale`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` api`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` organizations/`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`or`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`g`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`/databases/`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`databas`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`e`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`/branches/`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`branc`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`h`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --format`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` json`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# service-token list / show-access (CLI blocked under service-token auth)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`pscale`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` api`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` organizations/`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`or`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`g`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`/service-tokens`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --format`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` json`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`pscale`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` api`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` organizations/`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`or`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`g`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`/service-tokens/`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`i`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`d`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --format`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` json`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`need-help`,children:`Need help?`}),`\n`,_jsxs(_components.p,{children:[`Get help from `,_jsx(_components.a,{href:`https://planetscale.com/contact?initial=support`,children:`the PlanetScale Support team`}),`, or join our\\xA0`,_jsx(_components.a,{href:`https://pscale.link/community`,children:`Discord community`}),` to see how others are using PlanetScale.`]})]})}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":"Service tokens","description":"PlanetScale provides the ability to create service tokens for your PlanetScale organization via the CLI or directly in the UI.","og:image":"images/og/api/service-tokens.png","href":"/api/service-tokens"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Overview","slug":"overview","depth":2,"children":[]},{"title":"Create service tokens using the PlanetScale dashboard","slug":"create-service-tokens-using-the-planetscale-dashboard","depth":2,"children":[]},{"title":"Assign service token permissions","slug":"assign-service-token-permissions","depth":2,"children":[{"title":"Add organization permissions","slug":"add-organization-permissions","depth":3,"children":[]},{"title":"Add database permissions","slug":"add-database-permissions","depth":3,"children":[]},{"title":"Add permissions for all databases","slug":"add-permissions-for-all-databases","depth":3,"children":[]}]},{"title":"Creating databases with service tokens","slug":"creating-databases-with-service-tokens","depth":2,"children":[]},{"title":"Service tokens and deploy requests approvals","slug":"service-tokens-and-deploy-requests-approvals","depth":2,"children":[]},{"title":"Use a service token with the PlanetScale CLI","slug":"use-a-service-token-with-the-planetscale-cli","depth":2,"children":[]},{"title":"Use a service token with the PlanetScale API","slug":"use-a-service-token-with-the-planetscale-api","depth":2,"children":[]},{"title":"Modify service token permissions","slug":"modify-service-token-permissions","depth":2,"children":[]},{"title":"Delete a service token","slug":"delete-a-service-token","depth":2,"children":[]},{"title":"Manage service tokens using the PlanetScale CLI","slug":"manage-service-tokens-using-the-planetscale-cli","depth":2,"children":[{"title":"Create a new service token","slug":"create-a-new-service-token","depth":3,"children":[]},{"title":"Add database access permissions","slug":"add-database-access-permissions","depth":3,"children":[]},{"title":"Remove database access permissions","slug":"remove-database-access-permissions","depth":3,"children":[]},{"title":"Delete a service token","slug":"delete-a-service-token-2","depth":3,"children":[]}]},{"title":"Service token automation","slug":"service-token-automation","depth":2,"children":[{"title":"Commands to avoid under a service token","slug":"commands-to-avoid-under-a-service-token","depth":3,"children":[]},{"title":"pscale api fallback for hard-to-parse output","slug":"pscale-api-fallback-for-hard-to-parse-output","depth":3,"children":[]}]},{"title":"Need help?","slug":"need-help","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/docs/_mintlify/custom/planetscale-2/b155242ec3c4945e/custom.js"],"subdomain":"planetscale-2","siteName":"PlanetScale","title":"Service tokens - PlanetScale","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-07-29T09:14:47.343Z","originalFileLocation":"api/service-tokens.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=\"PlanetScale provides the ability to create service tokens for your PlanetScale organization via the CLI or directly in the UI.\">\u003cmeta data-mint-head name=\"application-name\" content=\"PlanetScale\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/planetscale-2/_bFyi8IG4CeLblEd/_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=\"/docs/mintlify-assets/_mintlify/favicons/planetscale-2/_bFyi8IG4CeLblEd/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/planetscale-2/_bFyi8IG4CeLblEd/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/planetscale-2/_bFyi8IG4CeLblEd/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/planetscale-2/_bFyi8IG4CeLblEd/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/planetscale-2/_bFyi8IG4CeLblEd/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/planetscale-2/_bFyi8IG4CeLblEd/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/planetscale-2/_bFyi8IG4CeLblEd/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/planetscale-2/_bFyi8IG4CeLblEd/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Service tokens - PlanetScale\">\u003cmeta data-mint-head property=\"og:description\" content=\"PlanetScale provides the ability to create service tokens for your PlanetScale organization via the CLI or directly in the UI.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"PlanetScale\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://planetscale.com/docs/api/service-tokens\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://planetscale-2.mintlify.app/images/og/api/service-tokens.png\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Service tokens - PlanetScale\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"PlanetScale provides the ability to create service tokens for your PlanetScale organization via the CLI or directly in the UI.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://planetscale-2.mintlify.app/images/og/api/service-tokens.png\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/docs/mintlify-assets/_mintlify/favicons/planetscale-2/_bFyi8IG4CeLblEd/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"PlanetScale\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0e73cc\">\u003clink data-mint-head rel=\"canonical\" href=\"https://planetscale.com/docs/api/service-tokens\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/api/service-tokens.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://planetscale.com/#organization\",\"name\":\"PlanetScale\",\"url\":\"https://planetscale.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/planetscale-2/xUilVHToUFALai8a/logo/light.png?fit=max\u0026auto=format\u0026n=xUilVHToUFALai8a\u0026q=85\u0026s=cccd3c9fc813c01b899ab7af15a115b1\"}},{\"@type\":\"WebSite\",\"@id\":\"https://planetscale.com/docs#website\",\"name\":\"PlanetScale\",\"url\":\"https://planetscale.com/docs\",\"publisher\":{\"@id\":\"https://planetscale.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://planetscale.com/docs/api/service-tokens#webpage\",\"url\":\"https://planetscale.com/docs/api/service-tokens\",\"name\":\"Service tokens\",\"description\":\"PlanetScale provides the ability to create service tokens for your PlanetScale organization via the CLI or directly in the UI.\",\"dateModified\":\"2026-07-29T09:14:47.343Z\",\"isPartOf\":{\"@id\":\"https://planetscale.com/docs#website\"},\"breadcrumb\":{\"@id\":\"https://planetscale.com/docs/api/service-tokens#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://planetscale.com/docs/api/service-tokens#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Introduction\",\"item\":\"https://planetscale.com/docs/api/reference/getting-started-with-planetscale-api\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Service tokens\",\"item\":\"https://planetscale.com/docs/api/service-tokens\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://planetscale.com/docs/api/service-tokens#article\",\"headline\":\"Service tokens\",\"name\":\"Service tokens\",\"description\":\"PlanetScale provides the ability to create service tokens for your PlanetScale organization via the CLI or directly in the UI.\",\"url\":\"https://planetscale.com/docs/api/service-tokens\",\"mainEntityOfPage\":{\"@id\":\"https://planetscale.com/docs/api/service-tokens#webpage\"},\"image\":\"https://planetscale.com/docs/images/og/api/service-tokens.png\",\"dateModified\":\"2026-07-29T09:14:47.343Z\",\"publisher\":{\"@id\":\"https://planetscale.com/#organization\"},\"isPartOf\":{\"@id\":\"https://planetscale.com/docs#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"PlanetScale\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"PlanetScale","nav":{"global":{"anchors":[{"anchor":"Blog","icon":"newspaper","href":"https://planetscale.com/blog"},{"anchor":"Contact Us","icon":"headset","href":"https://planetscale.com/contact"},{"anchor":"Status","icon":"signal","href":"https://www.planetscalestatus.com/"},{"anchor":"Benchmarks","icon":"chart-line","href":"https://planetscale.com/benchmarks"}]},"tabs":[{"tab":"Platform","pages":[{"title":"Platform","href":""}]},{"tab":"Vitess","pages":[{"title":"Vitess","href":"/vitess"}]},{"tab":"Neki","pages":[{"title":"Neki","href":"/neki"}]},{"tab":"Postgres","pages":[{"title":"Postgres","href":"/postgres"}]},{"tab":"API Reference","groups":[{"group":"Introduction","pages":[{"title":"Getting started with PlanetScale API","href":"/api/reference/getting-started-with-planetscale-api"},{"title":"Rate limits","href":"/api/reference/rate-limits"},{"title":"Pagination","href":"/api/reference/pagination"},{"title":"PlanetScale API and OAuth applications","sidebarTitle":"API and OAuth applications","description":"The PlanetScale API allows you to manage your PlanetScale databases programmatically.","href":"/api/planetscale-api-oauth-applications"},{"title":"Service tokens","href":"/api/service-tokens"},{"title":"OpenAPI Spec","description":"Download the PlanetScale API OpenAPI 3.0 specification","href":"/api/openapi-spec"}]},{"group":"Webhooks in PlanetScale","pages":[{"title":"Webhooks","sidebarTitle":"Setting up webhooks","href":"/api/webhooks"},{"title":"Webhook events reference","href":"/api/webhook-events"}]},{"group":"Authentication","pages":[{"title":"Service tokens","href":"/api/reference/service-tokens"},{"title":"OAuth","href":"/api/reference/oauth"},{"group":"OAuth tokens","pages":[{"title":"Create or refresh OAuth token","href":"/api/reference/oauth/create-token"},{"title":"Revoke OAuth token","href":"/api/reference/oauth/revoke-token"},{"title":"Get OAuth token info","href":"/api/reference/oauth/token-info"}]},{"title":"OAuth access scopes","href":"/api/reference/oauth-access-scopes"}]},{"group":"General API endpoints","pages":[{"group":"Audit logs","pages":[{"openapi":"get /organizations/{organization}/audit-log","title":"List audit logs","href":"/api/reference/list_audit_logs"}]},{"group":"Backup policies","pages":[{"openapi":"get /organizations/{organization}/databases/{database}/backup-policies","title":"List backup policies","href":"/api/reference/list_backup_policies"},{"openapi":"post /organizations/{organization}/databases/{database}/backup-policies","title":"Create a backup policy","href":"/api/reference/create_backup_policy"},{"openapi":"get /organizations/{organization}/databases/{database}/backup-policies/{id}","title":"Get a backup policy","href":"/api/reference/get_backup_policy"},{"openapi":"patch /organizations/{organization}/databases/{database}/backup-policies/{id}","title":"Update a backup policy","href":"/api/reference/update_backup_policy"},{"openapi":"delete /organizations/{organization}/databases/{database}/backup-policies/{id}","title":"Delete a backup policy","href":"/api/reference/delete_backup_policy"}]},{"group":"Backups","pages":[{"openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/backups","title":"List backups","href":"/api/reference/list_backups"},{"openapi":"post /organizations/{organization}/databases/{database}/branches/{branch}/backups","title":"Create a backup","href":"/api/reference/create_backup"},{"openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/backups/{id}","title":"Get a backup","href":"/api/reference/get_backup"},{"openapi":"delete /organizations/{organization}/databases/{database}/branches/{branch}/backups/{id}","title":"Delete a backup","href":"/api/reference/delete_backup"},{"openapi":"patch /organizations/{organization}/databases/{database}/branches/{branch}/backups/{id}","title":"Update a backup","href":"/api/reference/update_backup"}]},{"group":"Billing payment methods","pages":[{"openapi":"get /organizations/{organization}/billing/payment-method","title":"Get the current billing payment method","href":"/api/reference/get_organization_billing_payment_method"},{"openapi":"delete /organizations/{organization}/billing/payment-method","title":"Delete the current billing payment method","href":"/api/reference/delete_organization_billing_payment_method"}]},{"group":"Cluster sizes","pages":[{"openapi":"get /organizations/{organization}/cluster-size-skus","title":"List available cluster sizes","href":"/api/reference/list_cluster_size_skus"}]},{"group":"Database branches","pages":[{"openapi":"get /organizations/{organization}/databases/{database}/branches","title":"List branches","href":"/api/reference/list_branches"},{"openapi":"post /organizations/{organization}/databases/{database}/branches","title":"Create a branch","href":"/api/reference/create_branch"},{"openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}","title":"Get a branch","href":"/api/reference/get_branch"},{"openapi":"patch /organizations/{organization}/databases/{database}/branches/{branch}","title":"Update a branch","href":"/api/reference/update_branch"},{"openapi":"delete /organizations/{organization}/databases/{database}/branches/{branch}","title":"Delete a branch","href":"/api/reference/delete_branch"}]},{"group":"Databases","pages":[{"openapi":"get /organizations/{organization}/databases","title":"List databases","href":"/api/reference/list_databases"},{"openapi":"post /organizations/{organization}/databases","title":"Create a database","href":"/api/reference/create_database"},{"openapi":"get /organizations/{organization}/databases/{database}","title":"Get a database","href":"/api/reference/get_database"},{"openapi":"patch /organizations/{organization}/databases/{database}","title":"Update database settings","href":"/api/reference/update_database_settings"},{"openapi":"delete /organizations/{organization}/databases/{database}","title":"Delete a database","href":"/api/reference/delete_database"},{"openapi":"get /organizations/{organization}/databases/{database}/read-only-regions","title":"List read-only regions","href":"/api/reference/list_read_only_regions"},{"openapi":"get /organizations/{organization}/databases/{database}/regions","title":"List database regions","href":"/api/reference/list_database_regions"}]},{"group":"Invoices","pages":[{"openapi":"get /organizations/{organization}/invoices","title":"Get invoices","href":"/api/reference/list_invoices"},{"openapi":"get /organizations/{organization}/invoices/{id}","title":"Get an invoice","href":"/api/reference/get_invoice"},{"openapi":"get /organizations/{organization}/invoices/{id}/line-items","title":"Get invoice line items","href":"/api/reference/get_invoice_line_items"}]},{"group":"Metrics","pages":[{"openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/metrics/keyspace-tables","title":"Get table storage metrics by keyspace","href":"/api/reference/get_branch_keyspace_table_metrics"},{"openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/metrics","title":"Get time-series metrics","href":"/api/reference/get_branch_metrics"},{"openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/metrics/query","title":"Get time-series metrics for SQL queries","href":"/api/reference/get_branch_query_metrics"},{"openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/metrics/tables","title":"Get table storage metrics","href":"/api/reference/get_branch_table_metrics"},{"openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/metrics/tag","title":"Get time-series metrics grouped by query tags","href":"/api/reference/get_branch_tag_metrics"},{"openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/metrics/instant","title":"Get current metric values","href":"/api/reference/get_instant_branch_metrics"},{"openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/metrics/tablets-instant","title":"Get current tablet metrics","href":"/api/reference/get_instant_tablet_metrics"},{"openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/metrics/tablets","title":"Get time-series tablet metrics","href":"/api/reference/get_tablet_metrics"}]},{"group":"OAuth applications","pages":[{"openapi":"get /organizations/{organization}/oauth-applications","title":"List OAuth applications","href":"/api/reference/list_oauth_applications"},{"openapi":"get /organizations/{organization}/oauth-applications/{application_id}","title":"Get an OAuth application","href":"/api/reference/get_oauth_application"},{"openapi":"get /organizations/{organization}/oauth-applications/{application_id}/tokens/{token_id}","title":"Get an OAuth token","href":"/api/reference/get_oauth_token"},{"openapi":"delete /organizations/{organization}/oauth-applications/{application_id}/tokens/{token_id}","title":"Delete an OAuth token","href":"/api/reference/delete_oauth_token"}]},{"group":"OAuth tokens","pages":[{"openapi":"post /organizations/{organization}/oauth-applications/{id}/token","title":"Create or renew an OAuth token","href":"/api/reference/create_oauth_token"}]},{"group":"Organization invitations","pages":[{"openapi":"get /organizations/{organization}/invitations","title":"List pending invitations","href":"/api/reference/list_organization_invitations"},{"openapi":"post /organizations/{organization}/invitations","title":"Send an invitation","href":"/api/reference/create_organization_invitation"},{"openapi":"delete /organizations/{organization}/invitations/{id}","title":"Cancel an invitation","href":"/api/reference/cancel_organization_invitation"}]},{"group":"Organization members","pages":[{"openapi":"get /organizations/{organization}/members","title":"List organization members","href":"/api/reference/list_organization_members"},{"openapi":"get /organizations/{organization}/members/{id}","title":"Get an organization member","href":"/api/reference/get_organization_membership"},{"openapi":"patch /organizations/{organization}/members/{id}","title":"Update organization member role","href":"/api/reference/update_organization_membership"},{"openapi":"delete /organizations/{organization}/members/{id}","title":"Remove a member from an organization","href":"/api/reference/remove_organization_member"}]},{"group":"Organizations","pages":[{"openapi":"get /organizations","title":"List organizations","href":"/api/reference/list_organizations"},{"openapi":"get /organizations/{organization}","title":"Get an organization","href":"/api/reference/get_organization"},{"openapi":"patch /organizations/{organization}","title":"Update an organization","href":"/api/reference/update_organization"},{"openapi":"get /organizations/{organization}/regions","title":"List regions for an organization","href":"/api/reference/list_regions_for_organization"}]},{"group":"Organization teams","pages":[{"openapi":"get /organizations/{organization}/teams","title":"List teams in an organization","href":"/api/reference/list_organization_teams"},{"openapi":"post /organizations/{organization}/teams","title":"Create an organization team","href":"/api/reference/create_organization_team"},{"openapi":"get /organizations/{organization}/teams/{team}","title":"Get an organization team","href":"/api/reference/get_organization_team"},{"openapi":"patch /organizations/{organization}/teams/{team}","title":"Update an organization team","href":"/api/reference/update_organization_team"},{"openapi":"delete /organizations/{organization}/teams/{team}","title":"Delete an organization team","href":"/api/reference/delete_organization_team"},{"openapi":"get /organizations/{organization}/teams/{team}/members","title":"List team members","href":"/api/reference/list_organization_team_members"},{"openapi":"post /organizations/{organization}/teams/{team}/members","title":"Add a member to a team","href":"/api/reference/add_organization_team_member"},{"openapi":"get /organizations/{organization}/teams/{team}/members/{id}","title":"Get a team member","href":"/api/reference/get_organization_team_member"},{"openapi":"delete /organizations/{organization}/teams/{team}/members/{id}","title":"Remove a member from a team","href":"/api/reference/remove_organization_team_member"}]},{"group":"Query insights","pages":[{"openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/insights","title":"List branch queries","href":"/api/reference/list_branch_queries"},{"openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/insights/{fingerprint}","title":"Retrieve query statistics","href":"/api/reference/get_query_statistics"},{"openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/insights/{fingerprint}/summary","title":"Retrieve a summary of query statistics","href":"/api/reference/get_query_summary"},{"openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/insights/queries/{id}","title":"Retrieve a branch query","href":"/api/reference/get_branch_query"},{"openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/insights/errors","title":"List branch query errors","href":"/api/reference/list_branch_query_errors"},{"openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/insights/errors/{fingerprint}","title":"List queries for an error fingerprint","href":"/api/reference/get_branch_query_error"},{"openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/insights/anomalies","title":"List branch anomalies","href":"/api/reference/list_branch_anomalies"},{"openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/insights/anomalies/{id}","title":"Retrieve a branch anomaly","href":"/api/reference/get_branch_anomaly"},{"openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/insights/tags","title":"List query tags","href":"/api/reference/list_branch_query_tags"},{"openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/insights/tags/summaries","title":"List query statistics grouped by tag","href":"/api/reference/list_branch_query_tag_summaries"},{"openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/insights/tags/{tag}","title":"Retrieve a query tag","href":"/api/reference/get_branch_query_tag"}]},{"group":"Query Insights reports","pages":[{"openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/query-patterns","title":"List generated query patterns reports","href":"/api/reference/list_generated_query_patterns_reports"},{"openapi":"post /organizations/{organization}/databases/{database}/branches/{branch}/query-patterns","title":"Create a new query patterns report","href":"/api/reference/create_query_patterns_report"},{"openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/query-patterns/{id}","title":"Show the status of a query patterns report","href":"/api/reference/get_query_patterns_report_status"},{"openapi":"delete /organizations/{organization}/databases/{database}/branches/{branch}/query-patterns/{id}","title":"Delete a query patterns report","href":"/api/reference/delete_query_patterns_report"},{"openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/query-patterns/{id}/download","title":"Download a finished query patterns report","href":"/api/reference/get_query_patterns_report"}]},{"group":"Schema recommendations","pages":[{"openapi":"get /organizations/{organization}/databases/{database}/schema-recommendations","title":"List schema recommendations","href":"/api/reference/list_schema_recommendations"},{"openapi":"get /organizations/{organization}/databases/{database}/schema-recommendations/{number}","title":"Get a schema recommendation","href":"/api/reference/get_schema_recommendation"},{"openapi":"post /organizations/{organization}/databases/{database}/schema-recommendations/{number}/dismiss","title":"Dismiss a schema recommendation","href":"/api/reference/dismiss_schema_recommendation"}]},{"group":"Regions","pages":[{"openapi":"get /regions","title":"List public regions","href":"/api/reference/list_public_regions"}]},{"group":"Service tokens","pages":[{"openapi":"post /organizations/{organization}/service-tokens","title":"Create a service token","href":"/api/reference/create_service_token"},{"openapi":"delete /organizations/{organization}/service-tokens/{id}","title":"Delete a service token","href":"/api/reference/delete_service_token"},{"openapi":"get /organizations/{organization}/service-tokens/{id}","title":"Get a service token","href":"/api/reference/get_service_token"},{"openapi":"get /organizations/{organization}/service-tokens","title":"List service tokens","href":"/api/reference/list_service_tokens"}]},{"group":"Users","pages":[{"openapi":"get /user","title":"Get current user","href":"/api/reference/get_current_user"}]},{"group":"Webhooks","pages":[{"openapi":"get /organizations/{organization}/databases/{database}/webhooks","title":"List webhooks","href":"/api/reference/list_webhooks"},{"openapi":"post /organizations/{organization}/databases/{database}/webhooks","title":"Create a webhook","href":"/api/reference/create_webhook"},{"openapi":"get /organizations/{organization}/databases/{database}/webhooks/{id}","title":"Get a webhook","href":"/api/reference/get_webhook"},{"openapi":"patch /organizations/{organization}/databases/{database}/webhooks/{id}","title":"Update a webhook","href":"/api/reference/update_webhook"},{"openapi":"delete /organizations/{organization}/databases/{database}/webhooks/{id}","title":"Delete a webhook","href":"/api/reference/delete_webhook"},{"openapi":"post /organizations/{organization}/databases/{database}/webhooks/{id}/test","title":"Test a webhook","href":"/api/reference/test_webhook"}]}]},{"group":"Postgres API endpoints","pages":[{"group":"Branch changes","pages":[{"openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/changes","title":"Get branch change requests","href":"/api/reference/list_branch_change_requests"},{"openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/changes/{id}","title":"Get a branch change request","href":"/api/reference/get_branch_change_request"},{"openapi":"patch /organizations/{organization}/databases/{database}/branches/{branch}/changes","title":"Upsert a change request for cluster size, replicas, storage, or parameters","href":"/api/reference/update_branch_change_request"},{"openapi":"delete /organizations/{organization}/databases/{database}/branches/{branch}/resizes","title":"Cancel a change request","href":"/api/reference/cancel_branch_change_request"}]},{"group":"Cluster extensions","pages":[{"openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/extensions","title":"List cluster extensions","href":"/api/reference/list_extensions"}]},{"group":"Cluster parameters","pages":[{"openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/parameters","title":"List cluster parameters","href":"/api/reference/list_parameters"}]},{"group":"Dedicated PgBouncers","pages":[{"openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/bouncers","title":"List bouncers","href":"/api/reference/list_bouncers"},{"openapi":"post /organizations/{organization}/databases/{database}/branches/{branch}/bouncers","title":"Create a bouncer","href":"/api/reference/create_bouncer"},{"openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/bouncers/{bouncer}","title":"Get a bouncer","href":"/api/reference/get_bouncer"},{"openapi":"delete /organizations/{organization}/databases/{database}/branches/{branch}/bouncers/{bouncer}","title":"Delete a bouncer","href":"/api/reference/delete_bouncer"},{"openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/bouncer-resizes","title":"Get bouncer resize requests","href":"/api/reference/list_branch_bouncer_resize_requests"},{"openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/bouncers/{bouncer}/resizes","title":"Get bouncer resize requests","href":"/api/reference/list_bouncer_resize_requests"},{"openapi":"patch /organizations/{organization}/databases/{database}/branches/{branch}/bouncers/{bouncer}/resizes","title":"Upsert a bouncer resize request","href":"/api/reference/update_bouncer_resize_request"},{"openapi":"delete /organizations/{organization}/databases/{database}/branches/{branch}/bouncers/{bouncer}/resizes","title":"Cancel a resize request","href":"/api/reference/cancel_bouncer_resize_request"}]},{"group":"IP restrictions","pages":[{"openapi":"get /organizations/{organization}/databases/{database}/cidrs","title":"List IP restriction entries","href":"/api/reference/list_database_postgres_cidrs"},{"openapi":"post /organizations/{organization}/databases/{database}/cidrs","title":"Create an IP restriction entry","href":"/api/reference/create_database_postgres_cidr"},{"openapi":"get /organizations/{organization}/databases/{database}/cidrs/{id}","title":"Get an IP restriction entry","href":"/api/reference/get_database_postgres_cidr"},{"openapi":"patch /organizations/{organization}/databases/{database}/cidrs/{id}","title":"Update an IP restriction entry","href":"/api/reference/update_database_postgres_cidr"},{"openapi":"delete /organizations/{organization}/databases/{database}/cidrs/{id}","title":"Delete an IP restriction entry","href":"/api/reference/delete_database_postgres_cidr"}]},{"group":"Dedicated read replicas","pages":[{"openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/dedicated-read-replicas","title":"List dedicated read replicas","href":"/api/reference/list_dedicated_read_replicas"},{"openapi":"post /organizations/{organization}/databases/{database}/branches/{branch}/dedicated-read-replicas","title":"Create a dedicated read replica","href":"/api/reference/create_dedicated_read_replica"},{"openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/dedicated-read-replicas/{dedicated_read_replica}","title":"Get a dedicated read replica","href":"/api/reference/get_dedicated_read_replica"},{"openapi":"patch /organizations/{organization}/databases/{database}/branches/{branch}/dedicated-read-replicas/{dedicated_read_replica}","title":"Update a dedicated read replica","href":"/api/reference/update_dedicated_read_replica"},{"openapi":"delete /organizations/{organization}/databases/{database}/branches/{branch}/dedicated-read-replicas/{dedicated_read_replica}","title":"Delete a dedicated read replica","href":"/api/reference/delete_dedicated_read_replica"},{"openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/dedicated-read-replica-changes","title":"Get dedicated read replica change requests","href":"/api/reference/list_dedicated_read_replica_change_requests"}]},{"group":"Roles","pages":[{"openapi":"post /organizations/{organization}/databases/{database}/branches/{branch}/roles","title":"Create role credentials","href":"/api/reference/create_role"},{"openapi":"delete /organizations/{organization}/databases/{database}/branches/{branch}/roles/{id}","title":"Delete role credentials","href":"/api/reference/delete_role"},{"openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/roles/default","title":"Get the default postgres role","href":"/api/reference/get_default_role"},{"openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/roles/{id}","title":"Get a role","href":"/api/reference/get_role"},{"openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/roles","title":"List roles","href":"/api/reference/list_roles"},{"openapi":"post /organizations/{organization}/databases/{database}/branches/{branch}/roles/{id}/reassign","title":"Reassign objects owned by one role to another role","href":"/api/reference/reassign_role_objects"},{"openapi":"post /organizations/{organization}/databases/{database}/branches/{branch}/roles/{id}/renew","title":"Renew role expiration","href":"/api/reference/renew_role"},{"openapi":"post /organizations/{organization}/databases/{database}/branches/{branch}/roles/reset-default","title":"Reset default credentials","href":"/api/reference/reset_default_role"},{"openapi":"post /organizations/{organization}/databases/{database}/branches/{branch}/roles/{id}/reset","title":"Reset a role's password","href":"/api/reference/reset_role"},{"openapi":"patch /organizations/{organization}/databases/{database}/branches/{branch}/roles/{id}","title":"Update role name","href":"/api/reference/update_role"}]},{"group":"Switchovers","pages":[{"openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/switchovers","title":"List switchovers","href":"/api/reference/list_switchovers"},{"openapi":"post /organizations/{organization}/databases/{database}/branches/{branch}/switchovers","title":"Create a switchover","href":"/api/reference/create_switchover"},{"openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/switchovers/{id}","title":"Get a switchover","href":"/api/reference/get_switchover"}]},{"group":"Traffic budgets","pages":[{"openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/traffic/budgets","title":"List traffic budgets","href":"/api/reference/list_traffic_budgets"},{"openapi":"post /organizations/{organization}/databases/{database}/branches/{branch}/traffic/budgets","title":"Create a traffic budget","href":"/api/reference/create_traffic_budget"},{"openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/traffic/budgets/{id}","title":"Get a traffic budget","href":"/api/reference/get_traffic_budget"},{"openapi":"patch /organizations/{organization}/databases/{database}/branches/{branch}/traffic/budgets/{id}","title":"Update a traffic budget","href":"/api/reference/update_traffic_budget"},{"openapi":"delete /organizations/{organization}/databases/{database}/branches/{branch}/traffic/budgets/{id}","title":"Delete a traffic budget","href":"/api/reference/delete_traffic_budget"},{"openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/insights/{fingerprint}/traffic/budgets","title":"List traffic budgets affecting a query fingerprint","href":"/api/reference/list_traffic_budgets_for_query"}]},{"group":"Traffic rules","pages":[{"openapi":"post /organizations/{organization}/databases/{database}/branches/{branch}/traffic/budgets/{budget_id}/rules","title":"Create a traffic rule","href":"/api/reference/create_traffic_rule"},{"openapi":"delete /organizations/{organization}/databases/{database}/branches/{branch}/traffic/budgets/{budget_id}/rules/{id}","title":"Delete a traffic rule","href":"/api/reference/delete_traffic_rule"}]}]},{"group":"Neki API endpoints","pages":[{"group":"Admins","pages":[{"title":"Get the admin for a branch","openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/admin","href":"/api/reference/get_admin"},{"title":"Update the admin for a branch","openapi":"patch /organizations/{organization}/databases/{database}/branches/{branch}/admin","href":"/api/reference/update_admin"},{"title":"List admin size SKUs for a branch","openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/admin-size-skus","href":"/api/reference/list_admin_size_skus"},{"title":"List change requests for an admin","openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/admin/changes","href":"/api/reference/list_admin_change_requests"},{"title":"Get a change request for an admin","openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/admin/changes/{id}","href":"/api/reference/get_admin_change_request"},{"title":"Cancel a change request for an admin","openapi":"delete /organizations/{organization}/databases/{database}/branches/{branch}/admin/changes/{id}","href":"/api/reference/cancel_admin_change_request"},{"title":"List parameters for an admin","openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/admin/parameters","href":"/api/reference/list_admin_parameters"}]},{"group":"Configuration profiles","pages":[{"title":"List configuration profiles for a branch","openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/configuration-profiles","href":"/api/reference/list_shard_configuration_profiles"},{"title":"Create a configuration profile for a branch","openapi":"post /organizations/{organization}/databases/{database}/branches/{branch}/configuration-profiles","href":"/api/reference/create_shard_configuration_profile"},{"title":"Get a configuration profile for a branch","openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/configuration-profiles/{configuration_profile}","href":"/api/reference/get_shard_configuration_profile"},{"title":"Update a configuration profile for a branch","openapi":"patch /organizations/{organization}/databases/{database}/branches/{branch}/configuration-profiles/{configuration_profile}","href":"/api/reference/update_shard_configuration_profile"},{"title":"Delete a configuration profile for a branch","openapi":"delete /organizations/{organization}/databases/{database}/branches/{branch}/configuration-profiles/{configuration_profile}","href":"/api/reference/delete_shard_configuration_profile"},{"title":"Run maintenance for selected configuration profiles","openapi":"post /organizations/{organization}/databases/{database}/branches/{branch}/configuration-profiles/maintenance","href":"/api/reference/run_shard_configuration_profiles_maintenance"},{"title":"Run maintenance for a configuration profile","openapi":"post /organizations/{organization}/databases/{database}/branches/{branch}/configuration-profiles/{configuration_profile}/maintenance","href":"/api/reference/run_shard_configuration_profile_maintenance"},{"title":"List change requests for a configuration profile","openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/configuration-profiles/{configuration_profile}/changes","href":"/api/reference/list_shard_configuration_profile_change_requests"},{"title":"Get a change request for a configuration profile","openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/configuration-profiles/{configuration_profile}/changes/{id}","href":"/api/reference/get_shard_configuration_profile_change_request"},{"title":"Cancel a change request for a configuration profile","openapi":"delete /organizations/{organization}/databases/{database}/branches/{branch}/configuration-profiles/{configuration_profile}/changes/{id}","href":"/api/reference/cancel_shard_configuration_profile_change_request"},{"title":"List extensions for a configuration profile","openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/configuration-profiles/{configuration_profile}/extensions","href":"/api/reference/list_shard_configuration_profile_extensions"},{"title":"Enable or disable an extension for a configuration profile","openapi":"patch /organizations/{organization}/databases/{database}/branches/{branch}/configuration-profiles/{configuration_profile}/extensions/{extension}","href":"/api/reference/update_shard_configuration_profile_extension"},{"title":"List parameters for a configuration profile","openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/configuration-profiles/{configuration_profile}/parameters","href":"/api/reference/list_shard_configuration_profile_parameters"}]},{"group":"Configuration profile shards","pages":[{"title":"List shards for a configuration profile","openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/configuration-profiles/{configuration_profile}/shards","href":"/api/reference/list_shard_configuration_profile_shards"},{"title":"Add a shard to a configuration profile","openapi":"post /organizations/{organization}/databases/{database}/branches/{branch}/configuration-profiles/{configuration_profile}/shards","href":"/api/reference/create_shard_configuration_profile_shard"},{"title":"Add shards to a configuration profile","openapi":"post /organizations/{organization}/databases/{database}/branches/{branch}/configuration-profiles/{configuration_profile}/shards/bulk","href":"/api/reference/bulk_create_shard_configuration_profile_shards"},{"title":"Assign shards to a configuration profile","openapi":"patch /organizations/{organization}/databases/{database}/branches/{branch}/configuration-profiles/{configuration_profile}/shards","href":"/api/reference/assign_shard_configuration_profile_shards"},{"title":"Remove shards from a configuration profile","openapi":"delete /organizations/{organization}/databases/{database}/branches/{branch}/configuration-profiles/{configuration_profile}/shards","href":"/api/reference/delete_shard_configuration_profile_shards"},{"title":"Get a shard in a configuration profile","openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/configuration-profiles/{configuration_profile}/shards/{id}","href":"/api/reference/get_shard_configuration_profile_shard"},{"title":"Update a shard in a configuration profile","openapi":"patch /organizations/{organization}/databases/{database}/branches/{branch}/configuration-profiles/{configuration_profile}/shards/{id}","href":"/api/reference/update_shard_configuration_profile_shard"},{"title":"Remove a shard from a configuration profile","openapi":"delete /organizations/{organization}/databases/{database}/branches/{branch}/configuration-profiles/{configuration_profile}/shards/{id}","href":"/api/reference/delete_shard_configuration_profile_shard"}]},{"group":"Data topology","pages":[{"title":"Get the data topology for a branch","openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/data-topology","href":"/api/reference/get_data_topology"},{"title":"Set the data topology for a branch","openapi":"put /organizations/{organization}/databases/{database}/branches/{branch}/data-topology","href":"/api/reference/update_data_topology"}]},{"group":"Default configuration profile","pages":[{"title":"Get the default configuration profile for a branch","openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/default-configuration-profile","href":"/api/reference/get_default_shard_configuration_profile"},{"title":"Set the default configuration profile for a branch","openapi":"put /organizations/{organization}/databases/{database}/branches/{branch}/default-configuration-profile","href":"/api/reference/set_default_shard_configuration_profile"}]},{"group":"Neki changes","pages":[{"title":"List change requests for a branch","openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/neki-changes","href":"/api/reference/list_neki_change_requests"},{"title":"Get a change request for a branch","openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/neki-changes/{id}","href":"/api/reference/get_neki_change_request"},{"title":"Cancel a change request for a branch","openapi":"delete /organizations/{organization}/databases/{database}/branches/{branch}/neki-changes/{id}","href":"/api/reference/cancel_neki_change_request"}]},{"group":"Routers","pages":[{"title":"List router size SKUs for a branch","openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/router-size-skus","href":"/api/reference/list_router_size_skus"},{"title":"List routers for a branch","openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/routers","href":"/api/reference/list_routers"},{"title":"Create a router for a branch","openapi":"post /organizations/{organization}/databases/{database}/branches/{branch}/routers","href":"/api/reference/create_router"},{"title":"Get a router for a branch","openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/routers/{router}","href":"/api/reference/get_router"},{"title":"Update a router for a branch","openapi":"patch /organizations/{organization}/databases/{database}/branches/{branch}/routers/{router}","href":"/api/reference/update_router"},{"title":"Delete a router from a branch","openapi":"delete /organizations/{organization}/databases/{database}/branches/{branch}/routers/{router}","href":"/api/reference/delete_router"},{"title":"List change requests for a router","openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/routers/{router}/changes","href":"/api/reference/list_router_change_requests"},{"title":"Get a change request for a router","openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/routers/{router}/changes/{id}","href":"/api/reference/get_router_change_request"},{"title":"Cancel a change request for a router","openapi":"delete /organizations/{organization}/databases/{database}/branches/{branch}/routers/{router}/changes/{id}","href":"/api/reference/cancel_router_change_request"},{"title":"List parameters for a router","openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/routers/{router}/parameters","href":"/api/reference/list_router_parameters"}]},{"group":"Shards","pages":[{"title":"List shards for a branch","openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/shards","href":"/api/reference/list_shards"},{"title":"Add shards to a branch","openapi":"post /organizations/{organization}/databases/{database}/branches/{branch}/shards","href":"/api/reference/create_shard"},{"title":"Get a shard for a branch","openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/shards/{id}","href":"/api/reference/get_shard"},{"title":"Update a shard for a branch","openapi":"patch /organizations/{organization}/databases/{database}/branches/{branch}/shards/{id}","href":"/api/reference/update_shard"},{"title":"Remove a shard from a branch","openapi":"delete /organizations/{organization}/databases/{database}/branches/{branch}/shards/{id}","href":"/api/reference/delete_shard"}]}]},{"group":"Vitess API endpoints","pages":[{"group":"Branch cluster size","pages":[{"openapi":"patch /organizations/{organization}/databases/{database}/branches/{branch}/cluster","title":"Change a branch cluster configuration","href":"/api/reference/update_branch_cluster_config"}]},{"group":"Branch promotion","pages":[{"openapi":"post /organizations/{organization}/databases/{database}/branches/{branch}/demote","title":"Demote a branch","href":"/api/reference/demote_branch"},{"openapi":"post /organizations/{organization}/databases/{database}/branches/{branch}/promote","title":"Promote a branch","href":"/api/reference/promote_branch"}]},{"group":"Branch schema","pages":[{"openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/schema","title":"Get a branch schema","href":"/api/reference/get_branch_schema"},{"openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/schema/lint","title":"Lint a branch schema","href":"/api/reference/lint_branch_schema"}]},{"group":"Database branch keyspaces","pages":[{"openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/keyspaces","title":"Get keyspaces","href":"/api/reference/list_keyspaces"},{"openapi":"post /organizations/{organization}/databases/{database}/branches/{branch}/keyspaces","title":"Create a keyspace","href":"/api/reference/create_keyspace"},{"openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/keyspaces/{keyspace}","title":"Get a keyspace","href":"/api/reference/get_keyspace"},{"openapi":"delete /organizations/{organization}/databases/{database}/branches/{branch}/keyspaces/{keyspace}","title":"Delete a keyspace","href":"/api/reference/delete_keyspace"},{"openapi":"patch /organizations/{organization}/databases/{database}/branches/{branch}/keyspaces/{keyspace}","title":"Configure keyspace settings","href":"/api/reference/update_keyspace"},{"openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/keyspaces/{keyspace}/rollout-status","title":"Get keyspace rollout status","href":"/api/reference/get_keyspace_rollout_status"}]},{"group":"Database branch passwords","pages":[{"openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/passwords","title":"List passwords","href":"/api/reference/list_passwords"},{"openapi":"post /organizations/{organization}/databases/{database}/branches/{branch}/passwords","title":"Create a password","href":"/api/reference/create_password"},{"openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/passwords/{id}","title":"Get a password","href":"/api/reference/get_password"},{"openapi":"patch /organizations/{organization}/databases/{database}/branches/{branch}/passwords/{id}","title":"Update a password","href":"/api/reference/update_password"},{"openapi":"delete /organizations/{organization}/databases/{database}/branches/{branch}/passwords/{id}","title":"Delete a password","href":"/api/reference/delete_password"},{"openapi":"post /organizations/{organization}/databases/{database}/branches/{branch}/passwords/{id}/renew","title":"Renew a password","href":"/api/reference/renew_password"}]},{"group":"Deploy request throttling","pages":[{"openapi":"get /organizations/{organization}/databases/{database}/throttler","title":"Get database throttler configurations","href":"/api/reference/get_database_throttler"},{"openapi":"patch /organizations/{organization}/databases/{database}/throttler","title":"Update database throttler configurations","href":"/api/reference/update_database_throttler"}]},{"group":"Deploy requests","pages":[{"openapi":"get /organizations/{organization}/databases/{database}/deploy-queue","title":"Get the deploy queue","href":"/api/reference/get_deploy_queue"},{"openapi":"get /organizations/{organization}/databases/{database}/deploy-requests","title":"List deploy requests","href":"/api/reference/list_deploy_requests"},{"openapi":"post /organizations/{organization}/databases/{database}/deploy-requests","title":"Create a deploy request","href":"/api/reference/create_deploy_request"},{"openapi":"get /organizations/{organization}/databases/{database}/deploy-requests/{number}","title":"Get a deploy request","href":"/api/reference/get_deploy_request"},{"openapi":"patch /organizations/{organization}/databases/{database}/deploy-requests/{number}","title":"Close a deploy request","href":"/api/reference/close_deploy_request"},{"openapi":"post /organizations/{organization}/databases/{database}/deploy-requests/{number}/apply-deploy","title":"Complete a gated deploy request","href":"/api/reference/complete_gated_deploy_request"},{"openapi":"put /organizations/{organization}/databases/{database}/deploy-requests/{number}/auto-apply","title":"Update auto-apply for deploy request","href":"/api/reference/update_auto_apply"},{"openapi":"put /organizations/{organization}/databases/{database}/deploy-requests/{number}/auto-delete-branch","title":"Update auto-delete branch for deploy request","href":"/api/reference/update_auto_delete_branch"},{"openapi":"post /organizations/{organization}/databases/{database}/deploy-requests/{number}/cancel","title":"Cancel a queued deploy request","href":"/api/reference/cancel_deploy_request"},{"openapi":"post /organizations/{organization}/databases/{database}/deploy-requests/{number}/complete-deploy","title":"Complete an errored deploy","href":"/api/reference/complete_errored_deploy"},{"openapi":"post /organizations/{organization}/databases/{database}/deploy-requests/{number}/deploy","title":"Queue a deploy request","href":"/api/reference/queue_deploy_request"},{"openapi":"get /organizations/{organization}/databases/{database}/deploy-requests/{number}/deployment","title":"Get a deployment","href":"/api/reference/get_deployment"},{"openapi":"get /organizations/{organization}/databases/{database}/deploy-requests/{number}/operations","title":"List deploy operations","href":"/api/reference/list_deploy_operations"},{"openapi":"post /organizations/{organization}/databases/{database}/deploy-requests/{number}/revert","title":"Complete a revert","href":"/api/reference/complete_revert"},{"openapi":"get /organizations/{organization}/databases/{database}/deploy-requests/{number}/reviews","title":"List deploy request reviews","href":"/api/reference/list_deploy_request_reviews"},{"openapi":"post /organizations/{organization}/databases/{database}/deploy-requests/{number}/reviews","title":"Review a deploy request","href":"/api/reference/review_deploy_request"},{"openapi":"post /organizations/{organization}/databases/{database}/deploy-requests/{number}/skip-revert","title":"Skip revert period","href":"/api/reference/skip_revert_period"},{"openapi":"get /organizations/{organization}/databases/{database}/deploy-requests/{number}/storage-check","title":"Check deploy request storage","href":"/api/reference/check_deploy_request_storage"},{"openapi":"post /organizations/{organization}/databases/{database}/deploy-requests/{number}/force-cutover","title":"Enable force cutover for a deploy request","href":"/api/reference/force_cutover_deploy_request"},{"openapi":"get /organizations/{organization}/databases/{database}/deploy-requests/{number}/throttler","title":"Get deploy request throttler configurations","href":"/api/reference/get_deploy_request_throttler"},{"openapi":"patch /organizations/{organization}/databases/{database}/deploy-requests/{number}/throttler","title":"Update deploy request throttler configurations","href":"/api/reference/update_deploy_request_throttler"}]},{"group":"Keyspace VSchemas","pages":[{"openapi":"get /organizations/{organization}/databases/{database}/branches/{branch}/keyspaces/{keyspace}/vschema","title":"Get the VSchema for the keyspace","href":"/api/reference/get_keyspace_vschema"},{"openapi":"patch /organizations/{organization}/databases/{database}/branches/{branch}/keyspaces/{keyspace}/vschema","title":"Update the VSchema for the keyspace","href":"/api/reference/update_keyspace_vschema"}]},{"group":"Maintenance schedules","pages":[{"openapi":"get /organizations/{organization}/databases/{database}/maintenance-schedules","title":"List maintenance schedules","href":"/api/reference/list_maintenance_schedules"},{"openapi":"get /organizations/{organization}/databases/{database}/maintenance-schedules/{id}","title":"Get a maintenance schedule","href":"/api/reference/get_maintenance_schedule"},{"openapi":"get /organizations/{organization}/databases/{database}/maintenance-schedules/{id}/windows","title":"List maintenance windows","href":"/api/reference/list_maintenance_windows"}]},{"group":"Safe migrations","pages":[{"openapi":"post /organizations/{organization}/databases/{database}/branches/{branch}/safe-migrations","title":"Enable safe migrations for a branch","href":"/api/reference/enable_safe_migrations"},{"openapi":"delete /organizations/{organization}/databases/{database}/branches/{branch}/safe-migrations","title":"Disable safe migrations for a branch","href":"/api/reference/disable_safe_migrations"}]},{"group":"Workflows","pages":[{"openapi":"get /organizations/{organization}/databases/{database}/workflows","title":null,"href":"/api/reference/list_workflows"},{"openapi":"post /organizations/{organization}/databases/{database}/workflows","title":null,"href":"/api/reference/create_workflow"},{"openapi":"get /organizations/{organization}/databases/{database}/workflows/{number}","title":null,"href":"/api/reference/get_workflow"},{"openapi":"delete /organizations/{organization}/databases/{database}/workflows/{number}","title":null,"href":"/api/reference/workflow_cancel"},{"openapi":"patch /organizations/{organization}/databases/{database}/workflows/{number}/complete","title":null,"href":"/api/reference/workflow_complete"},{"openapi":"patch /organizations/{organization}/databases/{database}/workflows/{number}/cutover","title":null,"href":"/api/reference/workflow_cutover"},{"openapi":"patch /organizations/{organization}/databases/{database}/workflows/{number}/retry","title":null,"href":"/api/reference/workflow_retry"},{"openapi":"patch /organizations/{organization}/databases/{database}/workflows/{number}/reverse-cutover","title":null,"href":"/api/reference/workflow_reverse_cutover"},{"openapi":"patch /organizations/{organization}/databases/{database}/workflows/{number}/reverse-traffic","title":null,"href":"/api/reference/workflow_reverse_traffic"},{"openapi":"patch /organizations/{organization}/databases/{database}/workflows/{number}/switch-primaries","title":null,"href":"/api/reference/workflow_switch_primaries"},{"openapi":"patch /organizations/{organization}/databases/{database}/workflows/{number}/switch-replicas","title":null,"href":"/api/reference/workflow_switch_replicas"},{"openapi":"patch /organizations/{organization}/databases/{database}/workflows/{number}/verify-data","title":null,"href":"/api/reference/verify_workflow"}]}]}]},{"tab":"CLI Reference","pages":[{"title":"CLI Reference","href":"/cli"}]}]},"title":"Service tokens - PlanetScale","buildId":"dpl_3rfzHPCtRhDFBbetXZ3oLkN5tjmA","deploymentId":"dpl_3rfzHPCtRhDFBbetXZ3oLkN5tjmA","dynamics":["07c022d89b","a74be98ba7"],"chunks":["Frame-Dit-D9cD.js","DynamicMarkdown-B3juXLG8.js","zoom-image-lightbox-D2y4WbiL.js","lightbox-handle-r17bVUz3.js"]}