> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stackone.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect PlanetScale with Service Token – StackOne Hub

> Link a PlanetScale account in the StackOne Hub using Service Token. End-user guide to authorize the integration and start using PlanetScale actions.

## Create a service token

A service token has no permissions until you grant them, so the token needs organization and database permissions before it can be used.

**1. Create the token**

Sign in to your [PlanetScale account](https://app.planetscale.com), then open **Settings** > **Service tokens**.

<ul>
  <li>Click **New service token**.</li>
  <li>**Name**: `StackOne Integration`</li>
  <li>Click **Create service token**.</li>
</ul>

![The New service token dialog in PlanetScale with the Name field and the Create service token button highlighted](https://mintcdn.com/stackone-60/6FmyPeYVuoCy9TaE/connectors/planetscale/images/service_token-config-create-token.png?fit=max\&auto=format\&n=6FmyPeYVuoCy9TaE\&q=85\&s=4d05dd8a10a9402a78fedb402380e804)

**2. Copy the token**

Copy the **Token** across to **Service Token**.

<ul>
  <li>The token is only displayed once and cannot be retrieved later.</li>
  <li>Click **Continue to token permissions**.</li>
</ul>

![The new service token dialog in PlanetScale with the copy button for the Token highlighted](https://mintcdn.com/stackone-60/6FmyPeYVuoCy9TaE/connectors/planetscale/images/service_token-config-copy-token.png?fit=max\&auto=format\&n=6FmyPeYVuoCy9TaE\&q=85\&s=24e1a26eaaf00e405417102d375692b8)

**3. Grant organization permissions**

Under **Organization access**, click **Add organization permissions**.

<ul>
  <li>Select **read\_organization**.</li>
  <li>Select **read\_databases**.</li>
  <li>Select **create\_databases**.</li>
  <li>Click **Save permissions**.</li>
</ul>

![The Organization access permissions dialog in PlanetScale with read\_organization, read\_databases and create\_databases selected](https://mintcdn.com/stackone-60/6FmyPeYVuoCy9TaE/connectors/planetscale/images/service_token-config-organization-permissions.png?fit=max\&auto=format\&n=6FmyPeYVuoCy9TaE\&q=85\&s=69859b1b3f377dc7a2390356fce0a191)

**4. Grant database permissions**

Under **Database access**, in **Permissions for all databases**, click **Select permissions**.

<ul>
  <li>Select every permission in the list.</li>
  <li>Click **Save permissions**.</li>
</ul>

![The Permissions for all databases dialog in PlanetScale with every permission selected](https://mintcdn.com/stackone-60/6FmyPeYVuoCy9TaE/connectors/planetscale/images/service_token-config-database-permissions.png?fit=max\&auto=format\&n=6FmyPeYVuoCy9TaE\&q=85\&s=5fd490b9b7d9f17a3df33468606b8009)

## Troubleshooting

PlanetScale answers with a 404 Not Found, not a 403, when the token is missing a permission for the database or the action. Add the missing permission on the token's page in **Settings** > **Service tokens**.

## Link the Account

**1. Connect**

<ul>
  <li>Click **Connect**.</li>
  <li>If applicable, the provider will redirect you to a sign-in or authorization page. Complete the provider's authorization flow.</li>
  <li>Once authorization is successful, you will see a confirmation popup.</li>
</ul>

**2. Use Actions**

Connect an AI platform to the linked account's actions. See [AI Platforms](https://docs.stackone.com/ai-platforms/overview.md).

Other ways to call actions are listed in [Protocols & SDKs](https://docs.stackone.com/connect/protocols-and-sdks.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.