Skip to content
Sign in Create account

Create a webhook endpoint

POST /api/v1/webhooks/endpoints

Creates an active webhook endpoint for the authenticated organization. Requires webhooks.manage and the write ability. url must be a publicly reachable HTTPS endpoint on port 443 without URL credentials; private, loopback, reserved, and metadata destinations return 422. Redirects are not followed during delivery. url is limited to 512 characters. events is optional; when supplied it must be a non-empty list of registered event names, *, or a registered namespace wildcard such as receipt.*. The HMAC secret is returned once and must be stored by the caller.

Authenticate with a portal session token.

Request body

application/json object

  • events array of string
    Items: at least 1 items
  • url string (uri) required

    Publicly reachable HTTPS URL on port 443; private, loopback, reserved, and metadata targets are rejected.

    Length: at most 512 characters

Example

{
  "events": [
    "receipt.signed"
  ],
  "url": "https://hooks.example.com/cloakapi"
}

Responses

201 Endpoint created; secret is returned once.

application/json object

  • events array of string required
  • id integer required
  • is_active boolean required
    Value: true
  • message string required
  • secret string required
    Write only
  • url string (uri) required

Generated sample

{
  "events": [
    "string"
  ],
  "id": 0,
  "is_active": true,
  "message": "string",
  "secret": "string",
  "url": "https://example.com"
}
401 Missing or invalid bearer token.

application/json object

Any keys are accepted.

403 The authenticated user has not verified their email or accepted the Terms of Service and Privacy Policy, or lacks the required write ability or webhooks.manage permission.

application/json object

Any keys are accepted.

422 Validation failed or the destination URL is unsafe.

application/json GenericError

  • error any

    One of

    • string
    • object

      Any keys are accepted.

  • error_code string
  • code string
  • message string
  • detail string
  • status any

    One of

    • string
    • integer
  • errors object

    Any keys are accepted.

429 The request was rate limited. API-generated responses are JSON;

Response headers

  • Retry-After string header

    Seconds to wait before retrying, when provided.

  • X-RateLimit-Scope string header

    Identifies the scope of the request limit, when provided.

application/json GenericError

  • error any

    One of

    • string
    • object

      Any keys are accepted.

  • error_code string
  • code string
  • message string
  • detail string
  • status any

    One of

    • string
    • integer
  • errors object

    Any keys are accepted.

text/html string