PATCH
/
organizations
/
{organization}
/
databases
/
{database}
/
webhooks
/
{id}
Update a webhook
curl --request PATCH \
  --url https://api.planetscale.com/v1/organizations/{organization}/databases/{database}/webhooks/{id} \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
  "url": "<string>",
  "enabled": true,
  "events": [
    "<string>"
  ]
}'
{
  "id": "<string>",
  "url": "<string>",
  "secret": "<string>",
  "enabled": true,
  "last_sent_result": "<string>",
  "last_sent_success": true,
  "last_sent_at": "<string>",
  "created_at": "<string>",
  "updated_at": "<string>",
  "events": [
    "branch.ready"
  ]
}

Authorizations

Authorization
string
header
required

Path Parameters

organization
string
required

The name of the organization

database
string
required

The name of the database

id
string
required

The ID of the webhook

Body

application/json
url
string

The URL the webhook will send events to

enabled
boolean

Whether the webhook should be enabled

events
string[]

The events this webhook should subscribe to

Response

Returns the updated webhook

id
string
required

The ID of the webhook

url
string
required

The URL the webhook will send events to

secret
string
required

The secret used to sign the webhook payloads

enabled
boolean
required

Whether the webhook is enabled

last_sent_result
string
required

The last result sent by the webhook

last_sent_success
boolean
required

Whether the last sent was successful

last_sent_at
string
required

When the last event was sent

created_at
string
required

When the webhook was created

updated_at
string
required

When the webhook was updated

events
enum<string>[]
required

The events this webhook subscribes to