Getting Started
Make sure to first set up your PlanetScale developer environment. Once you’ve installed thepscale CLI, you can interact with PlanetScale and manage your databases straight from the command line.
The webhook command
This command allows you to create, list, update, test, and delete webhooks for your database.
Usage:
Available sub-commands
| Sub-command | Description | Product |
|---|---|---|
create <DATABASE_NAME> | Create a new webhook for a database | Vitess, Postgres |
delete <DATABASE_NAME> <WEBHOOK_ID> | Delete a webhook from a database | Vitess, Postgres |
list <DATABASE_NAME> | List all webhooks for a database | Vitess, Postgres |
show <DATABASE_NAME> <WEBHOOK_ID> | Show details for a specific webhook | Vitess, Postgres |
test <DATABASE_NAME> <WEBHOOK_ID> | Send a test event to a webhook | Vitess, Postgres |
update <DATABASE_NAME> <WEBHOOK_ID> | Update an existing webhook | Vitess, Postgres |
Sub-command flags
| Sub-command flag | Description | Applicable sub-commands |
|---|---|---|
--events <EVENTS> | Comma-separated list of events to trigger the webhook. See webhook events for available events. | create, update |
--url <URL> | The HTTPS URL where webhook events will be sent | create, update |
--enabled | Enable or disable the webhook. Use --enabled or --enabled=true to enable, --enabled=false to disable. Webhooks are disabled by default when created. | update |
Available flags
| Flag | Description |
|---|---|
-h, --help | View help for webhook command |
--org <ORGANIZATION_NAME> | The organization for the current user |
Global flags
| Command | Description |
|---|---|
--api-token <TOKEN> | The API token to use for authenticating against the PlanetScale API. |
--api-url <URL> | The base URL for the PlanetScale API. Default is https://api.planetscale.com/. |
--config <CONFIG_FILE> | Config file. Default is $HOME/.config/planetscale/pscale.yml. |
--debug | Enable debug mode. |
-f, --format <FORMAT> | Show output in a specific format. Possible values: human (default), json, csv. |
--no-color | Disable color output. |
--service-token <TOKEN> | The service token for authenticating. |
--service-token-id <TOKEN_ID> | The service token ID for authenticating. |
Examples
List webhooks for a database
Command:Create a webhook
Command:update command.
Output:
NoteWhen you create a webhook, a secret is generated and displayed only once in the output. Store this secret securely as you’ll need it to validate webhook signatures. You can also view the secret later from the database settings page in the dashboard.
Show webhook details
Command:NoteThe
show command displays the webhook secret, which is useful if you need to retrieve it after creation. Store this secret securely as you’ll need it to validate webhook signatures.Update a webhook
Command:--enabled=false. You can also use this command to update other webhook settings like events and URL.
Output:

