Skip to main content

Getting Started

Make sure to first set up your PlanetScale developer environment. Once you’ve installed the pscale 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 flags

Available flags

Global flags

Examples

List webhooks for a database

Command:
This lists all webhooks configured for the specified database. Output:
Or if webhooks exist:

Create a webhook

Command:
This creates a new webhook for the specified database with the selected events. The webhook will be disabled by default until you enable it with the update command. Output:
When 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:
This displays detailed information about a specific webhook, including its ID, URL, secret, events, enabled status, and timestamps. Output:
The 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:
This enables an existing webhook. To disable a webhook, use --enabled=false. You can also use this command to update other webhook settings like events and URL. Output:

Test a webhook

Command:
This sends a test event to the webhook URL to verify it’s configured correctly. You can only send one test event every 20 seconds per webhook. Output:

Delete a webhook

Command:
This permanently deletes the webhook from the database. Output:

Need help?

Get help from the PlanetScale Support team, or join our Discord community to see how others are using PlanetScale.