1. Docs
  2. API Reference
  3. Create a webhook subscription

Create a webhook subscription

POST/api/v1/webhooks

Authentication

  • Bearer Token Authorization

    JWT access token

  • API Key X-API-Key

    API key for management-tier access

Request body

  • urlstring*
  • event_typesstring[]*
  • descriptionstring

Code samples

cURLJavaScriptPythonGo
curl -X POST "https://api.canopy.dev/api/v1/webhooks" \
  -H "X-API-Key: $CANOPY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "string",
    "event_types": [
      "string"
    ],
    "description": "string"
  }'

Responses

201 Webhook created — secret is only shown once
{
  "id": "string",
  "url": "string",
  "event_types": [
    "string"
  ],
  "description": "string",
  "is_active": false,
  "created_at": "2026-04-20T12:00:00.000Z"
}

application/json

  • idstring*
  • urlstring*
  • event_typesstring[]*
  • descriptionstring
  • is_activeboolean*
  • created_atstring (date-time)*
401 Invalid or expired token
403 This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa)

Returned object

On this page

Related endpoints

GETList webhook subscriptions
GETGet a webhook subscription
PATCHUpdate a webhook subscription
DELETEDelete a webhook subscription