PlanetScale

Databases Service token

Manage PlanetScale databases, branches, deploy requests and backups from any Windmill script, flow or app.

Set up in 3 steps

1

Create a service token

In the PlanetScale dashboard, open your organization settings then Service tokens. Create one, grant it access to the databases your scripts touch, and note both halves — the id and the token itself.

2

Add the resource in Windmill

Open Resources, add a resource of type planetscale, and fill serviceTokenId and serviceToken.

3

Run your first script

Fork any script below and read before writing anything. There are dozens here, so search by the verb you need.

Scripts

Building blocks, if none of the projects above fit. Fork one, run it, or call it as a step inside your own flow.

Update deploy request throttler configurations

Script planetscale Verified

Update database throttler configurations

Script planetscale Verified

Update database settings

Script planetscale Verified

Update auto-apply for deploy request

Script planetscale Verified

Update an organization

Script planetscale Verified

Update a password

Script planetscale Verified

Update a backup

Script planetscale Verified

Skip revert period

Script planetscale Verified

Show the status of a query patterns report

Script planetscale Verified

Review a deploy request

Script planetscale Verified

Renew a password

Script planetscale Verified

Queue a deploy request

Script planetscale Verified

Promote a branch

Script planetscale Verified

List regions for an organization

Script planetscale Verified

List read-only regions

Script planetscale Verified

List public regions

Script planetscale Verified

List passwords

Script planetscale Verified

List organizations

Script planetscale Verified

List generated query patterns reports

Script planetscale Verified

List deploy requests

Script planetscale Verified

List deploy request reviews

Script planetscale Verified

List deploy operations

Script planetscale Verified

List databases

Script planetscale Verified

List database regions

Script planetscale Verified

List branches

Script planetscale Verified

List backups

Script planetscale Verified

List audit logs

Script planetscale Verified

List OAuth applications

Script planetscale Verified

Lint a branch schema

Script planetscale Verified

Get the deploy queue

Script planetscale Verified

Resource type

planetscale — the shape of the credential every script on this page expects.

View raw schema →
FieldTypeRequiredWhat it is
serviceTokenstringNoThe OAuth token to use for authentication (https://api-docs.planetscale.com/reference/oauth)
serviceTokenIdstringNoThe OAuth token ID to use for authentication (https://api-docs.planetscale.com/reference/oauth)

Questions

Why two fields?

PlanetScale sends the id and the token together as the authorization value. The token alone is not enough to identify which service token it is.

A database is not found

Service tokens are granted access per database, not per organization. Add the database to the token in the dashboard.

Is my token stored on the hub?

Never. It lives only in your own Windmill workspace, encrypted at rest.