unPLUGDevelopers

Webhook endpoints API

Rotate the signing secret

POST/v1/webhook_endpoints/{id}/rotate_secret

Creates a new signing secret and returns it once. Until the current secret expires, every request is signed with both secrets, so webhook-signature carries two v1 entries. See Rotate the signing secret in the guide.

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

Path parameters#

  • idstring (uuid)Required

Request body#

  • expire_current_in_hoursinteger
    How long the current secret keeps signing. Default 24. Use 0 if the secret leaked.
    Min 0Default 24

Response fields#

Returns 200 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
invalid_param

expire_current_in_hours is negative or not a whole number.

404Not found
not_found

No endpoint with this id in this environment.

Any endpoint can also return the common errors.