Create a webhook subscription

Creates a webhook subscription owned by the caller and returns the signing secret once

OAuth scopes
  • openid
Body
required
application/json
  • eventTypes
    Type: array string[] 1…
    min length:  
    1
    required

    Event types the subscription is interested in

  • url
    Type: string
    max length:  
    2048
    Format: uri
    required

    HTTPS endpoint deliveries are POSTed to

Responses
  • application/json
Request Example for post/webhooks/v1/subscriptions
curl https://api.specs.wseng.ai/webhooks/v1/subscriptions \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --data '{
  "url": "https://example.com/webhooks/spec-viewer",
  "eventTypes": [
    "specification.updated",
    "comment.created"
  ]
}'
{
  "subscriptionId": "sub_01HQXYZ",
  "url": "https://example.com/webhooks/spec-viewer",
  "eventTypes": [
    "specification.updated",
    "comment.created"
  ],
  "status": "active",
  "createdAt": "2024-06-15T10:30:00.000Z",
  "signingSecret": "whsec_01HQXYZabcdef"
}