Update Webhook

PATCH {{endpoint}}/webhooks/:webhookId

Updates a new webhook

Optional properties:

  • name string with a minimum length of 1
  • projectId string
  • url url string
  • topics list of topics, should include at least one topic (minimum length of 1)
    • You can fetch all the available topics using our Webhook Topics route
  • httpMethod string, should be a valid HTTP method, default to "POST"
  • customHeaders object containing optional headers that will be added to the webhook's request
  • status string, should be either "live" or "paused"
    • If the status is paused then no events will be sent to the webhook

Returns

  • 200 if webhook was updated successfully
  • 401 if authentication fails
  • 403 if user has insufficient roles (users with user and admin roles can update a webhook, users with viewer role cannot)
  • 404 if webhook doesn't exist

Request Body

{"name"=>"OPTIONAL_WEBHOOK_NAME", "url"=>"OPTIONAL_WEBHOOK_URL", "topics"=>["api-key.created", "api-key.deleted", "api-key.updated", "api-key.firstUsed", "access-key.created", "access-key.updated", "access-key.deleted", "project.updated"], "httpMethod"=>"HTTP_METHOD", "status"=>"WEBHOOKS_STATUS"}

RESPONSES

status: OK

{"id":"06af9398-428d-424f-80dd-4ec8b0428ce4","accountId":null,"projectId":"e3be2c12-a842-4cfd-a4d1-2b1846edd875","createdBy":"57626077-d74d-4449-ae3e-4a31c05a62fe","createdByType":"ACCESS_KEY","customHeaders":{"isFromTheAuthAPI":true},"httpMethod":"DELETE","name":"Updated webhook name","topics":["api-key.created"],"url":"https://theauthapi.com/api/webhooks/e3be2c12","status":"paused","isActive":true,"secret":"whsec_0NTKuUQ331uNvLEaf8tvPxTIRVJ9J7aw96M61","createdAt":"2022-08-23T22:17:49.436Z"}