unPLUGDevelopers

Webhook endpoints API

Create a webhook endpoint

POST/v1/webhook_endpoints

Registers a URL and returns its signing secret. Store the secret right away: it isn't shown again. You can have up to 10 endpoints per environment.

Permissions: Secret key with webhooks:manage.

Request headers#

  • Idempotency-Keystring
    Any string up to 255 characters; use a UUID v4. Kept 24 hours per key (or member) and endpoint. Same key and body replays the first response with Idempotent-Replayed: true.
    Max Length 255

Request body#

  • urlstring (uri)Required
    HTTPS URL on a public hostname. IP addresses, localhost and private networks are refused.
  • event_typesarray of stringRequired
    Event types to send, or ["*"] for all.
    Min Items 1
  • descriptionstring
    Your label, up to 255 characters.
    Max Length 255

Response fields#

Returns 201 with WebhookEndpoint

  • idstring (uuid)
    The endpoint's id.
  • urlstring (uri)
    Where events are sent. HTTPS on a public hostname.
  • descriptionstringNullable
    Your label, up to 255 characters.
    Max Length 255
  • event_typesarray of string
    Types this endpoint gets, or ["*"] for all types, including types added later. See Webhook event types.
  • statusstring
    enabled or disabled. unPLUG sets disabled after 3 days of failed deliveries.
    One of enabled, disabled
  • secretstring
    The signing secret, whsec_ followed by base64. Returned only when you create the endpoint or rotate the secret.
  • created_atstring (date-time)
    When the endpoint was created.
  • updated_atstring (date-time)
    When the endpoint last changed.

Error descriptions#

400Bad request
missing_param

url or event_types is missing.

400Bad request
invalid_param

The URL isn't HTTPS on a public hostname, or an event type doesn't exist. param names the field.

400Bad request
invalid_request

You already have 10 endpoints in this environment.

Any endpoint can also return the common errors.