Ir al contenido

API de consola: custhook

Esta página se genera a partir de server/api/openapi.yaml. Su contenido está en inglés; no la edites a mano.

Customer webhook endpoints, deliveries and redelivery (V3 R5). Handlers: internal/console/custhook.

List webhook endpoints

operationId custhookList · auth: orgSession

Requires owner or admin.

Status Meaning Body
200 OK application/json CusthookEndpointList
default Error envelope. The HTTP status follows the error kind. application/json Error

Response 200 application/json — CusthookEndpointList

  • data (array of CusthookEndpoint, required)
    • id (string, required)
    • url (string, required)
    • description (string, required)
    • events (array of CusthookEventType, required)
    • status (CusthookEndpointStatus, required)
    • disabled_reason (“manual” | “failing” | “creator_removed” | null, required, nullable) — failing: disabled automatically after repeated failed deliveries (the organisation billing contacts were emailed). creator_removed: the member who registered it left or was removed from the organisation, suspended or erased.
    • disabled_at (string, required, nullable)
    • balance_threshold_nano (string, required, pattern: ”^-?[0-9]+$”, nullable) — Threshold of balance.low (nano-USD); required when that event is subscribed.
    • consecutive_failures (integer, required)
    • previous_secret_expires_at (string, required, nullable) — Until then deliveries are also signed with the previous secret.
    • created_at (string, required)
    • updated_at (string, required)

Create a webhook endpoint

operationId custhookCreate · auth: orgSession

Requires owner or admin. The URL must be https:// on the default port and resolve to public addresses only (unsafe_url otherwise); it is checked again before every delivery and redirects are never followed. The signing secret (whsec_…) is in this response only. At most 10 endpoints per organisation.

Request body (required) application/json — CusthookEndpointInput

  • url (string, required, maxLength: 2048)
  • description (string, maxLength: 500)
  • events (array of CusthookEventType, required, minItems: 1)
  • balance_threshold_nano (string, pattern: ”^-?[0-9]+$”, nullable)
Status Meaning Body
201 OK application/json CusthookEndpointCreated
default Error envelope. The HTTP status follows the error kind. application/json Error

Response 201 application/json — CusthookEndpointCreated

  • endpoint (CusthookEndpoint, required)
    • id (string, required)
    • url (string, required)
    • description (string, required)
    • events (array of CusthookEventType, required)
    • status (CusthookEndpointStatus, required)
    • disabled_reason (“manual” | “failing” | “creator_removed” | null, required, nullable) — failing: disabled automatically after repeated failed deliveries (the organisation billing contacts were emailed). creator_removed: the member who registered it left or was removed from the organisation, suspended or erased.
    • disabled_at (string, required, nullable)
    • balance_threshold_nano (string, required, pattern: ”^-?[0-9]+$”, nullable) — Threshold of balance.low (nano-USD); required when that event is subscribed.
    • consecutive_failures (integer, required)
    • previous_secret_expires_at (string, required, nullable) — Until then deliveries are also signed with the previous secret.
    • created_at (string, required)
    • updated_at (string, required)
  • secret (string, required) — The signing secret (whsec_…). Returned once, never again.

Get a webhook endpoint

operationId custhookGet · auth: orgSession

Parameter In Type Required Description
endpoint_id path string<uuid> yes
Status Meaning Body
200 OK application/json CusthookEndpoint
default Error envelope. The HTTP status follows the error kind. application/json Error

Response 200 application/json — CusthookEndpoint

  • id (string, required)
  • url (string, required)
  • description (string, required)
  • events (array of CusthookEventType, required)
  • status (CusthookEndpointStatus, required)
  • disabled_reason (“manual” | “failing” | “creator_removed” | null, required, nullable) — failing: disabled automatically after repeated failed deliveries (the organisation billing contacts were emailed). creator_removed: the member who registered it left or was removed from the organisation, suspended or erased.
  • disabled_at (string, required, nullable)
  • balance_threshold_nano (string, required, pattern: ”^-?[0-9]+$”, nullable) — Threshold of balance.low (nano-USD); required when that event is subscribed.
  • consecutive_failures (integer, required)
  • previous_secret_expires_at (string, required, nullable) — Until then deliveries are also signed with the previous secret.
  • created_at (string, required)
  • updated_at (string, required)

Replace a webhook endpoint’s settings

operationId custhookUpdate · auth: orgSession

Same rules as create. The secret and the status do not change.

Parameter In Type Required Description
endpoint_id path string<uuid> yes

Request body (required) application/json — CusthookEndpointInput

  • url (string, required, maxLength: 2048)
  • description (string, maxLength: 500)
  • events (array of CusthookEventType, required, minItems: 1)
  • balance_threshold_nano (string, pattern: ”^-?[0-9]+$”, nullable)
Status Meaning Body
200 OK application/json CusthookEndpoint
default Error envelope. The HTTP status follows the error kind. application/json Error

Response 200 application/json — CusthookEndpoint

  • id (string, required)
  • url (string, required)
  • description (string, required)
  • events (array of CusthookEventType, required)
  • status (CusthookEndpointStatus, required)
  • disabled_reason (“manual” | “failing” | “creator_removed” | null, required, nullable) — failing: disabled automatically after repeated failed deliveries (the organisation billing contacts were emailed). creator_removed: the member who registered it left or was removed from the organisation, suspended or erased.
  • disabled_at (string, required, nullable)
  • balance_threshold_nano (string, required, pattern: ”^-?[0-9]+$”, nullable) — Threshold of balance.low (nano-USD); required when that event is subscribed.
  • consecutive_failures (integer, required)
  • previous_secret_expires_at (string, required, nullable) — Until then deliveries are also signed with the previous secret.
  • created_at (string, required)
  • updated_at (string, required)

Delete a webhook endpoint and its delivery log

operationId custhookDelete · auth: orgSession

Parameter In Type Required Description
endpoint_id path string<uuid> yes
Status Meaning Body
204 Deleted —
default Error envelope. The HTTP status follows the error kind. application/json Error

POST /api/v1/org/webhooks/{endpoint_id}/enable

Sección titulada «POST /api/v1/org/webhooks/{endpoint_id}/enable»

Enable a webhook endpoint

operationId custhookEnable · auth: orgSession

Also re-enables an endpoint that was disabled automatically; its failure count starts again at zero. Deliveries cancelled by the disable are not resent (use redeliver).

Parameter In Type Required Description
endpoint_id path string<uuid> yes
Status Meaning Body
200 OK application/json CusthookEndpoint
default Error envelope. The HTTP status follows the error kind. application/json Error

Response 200 application/json — CusthookEndpoint

  • id (string, required)
  • url (string, required)
  • description (string, required)
  • events (array of CusthookEventType, required)
  • status (CusthookEndpointStatus, required)
  • disabled_reason (“manual” | “failing” | “creator_removed” | null, required, nullable) — failing: disabled automatically after repeated failed deliveries (the organisation billing contacts were emailed). creator_removed: the member who registered it left or was removed from the organisation, suspended or erased.
  • disabled_at (string, required, nullable)
  • balance_threshold_nano (string, required, pattern: ”^-?[0-9]+$”, nullable) — Threshold of balance.low (nano-USD); required when that event is subscribed.
  • consecutive_failures (integer, required)
  • previous_secret_expires_at (string, required, nullable) — Until then deliveries are also signed with the previous secret.
  • created_at (string, required)
  • updated_at (string, required)

POST /api/v1/org/webhooks/{endpoint_id}/disable

Sección titulada «POST /api/v1/org/webhooks/{endpoint_id}/disable»

Disable a webhook endpoint

operationId custhookDisable · auth: orgSession

Pending deliveries are cancelled (status failed, error endpoint_disabled).

Parameter In Type Required Description
endpoint_id path string<uuid> yes
Status Meaning Body
200 OK application/json CusthookEndpoint
default Error envelope. The HTTP status follows the error kind. application/json Error

Response 200 application/json — CusthookEndpoint

  • id (string, required)
  • url (string, required)
  • description (string, required)
  • events (array of CusthookEventType, required)
  • status (CusthookEndpointStatus, required)
  • disabled_reason (“manual” | “failing” | “creator_removed” | null, required, nullable) — failing: disabled automatically after repeated failed deliveries (the organisation billing contacts were emailed). creator_removed: the member who registered it left or was removed from the organisation, suspended or erased.
  • disabled_at (string, required, nullable)
  • balance_threshold_nano (string, required, pattern: ”^-?[0-9]+$”, nullable) — Threshold of balance.low (nano-USD); required when that event is subscribed.
  • consecutive_failures (integer, required)
  • previous_secret_expires_at (string, required, nullable) — Until then deliveries are also signed with the previous secret.
  • created_at (string, required)
  • updated_at (string, required)

POST /api/v1/org/webhooks/{endpoint_id}/rotate-secret

Sección titulada «POST /api/v1/org/webhooks/{endpoint_id}/rotate-secret»

Rotate the signing secret

operationId custhookRotateSecret · auth: orgSession

Returns the new secret once. For grace_hours (default 24, 0 to 72) deliveries carry a second v1= signature made with the previous secret, so receivers can switch without dropping events.

Parameter In Type Required Description
endpoint_id path string<uuid> yes

Request body application/json — CusthookRotateRequest

  • grace_hours (integer, minimum: 0, maximum: 72)
Status Meaning Body
200 OK application/json CusthookSecret
default Error envelope. The HTTP status follows the error kind. application/json Error

Response 200 application/json — CusthookSecret

  • secret (string, required)
  • previous_expires_at (string, required, nullable)

POST /api/v1/org/webhooks/{endpoint_id}/test

Sección titulada «POST /api/v1/org/webhooks/{endpoint_id}/test»

Send a test event

operationId custhookSendTest · auth: orgSession

Queues a ping event for this endpoint only (also when it is disabled). Delivered by the worker like any other event.

Parameter In Type Required Description
endpoint_id path string<uuid> yes
Status Meaning Body
202 Queued application/json CusthookDelivery
default Error envelope. The HTTP status follows the error kind. application/json Error

Response 202 application/json — CusthookDelivery

  • id (string, required)
  • endpoint_id (string, required)
  • event_id (string, required)
  • event_type (string, required)
  • status (CusthookDeliveryStatus, required)
  • attempts (integer, required)
  • next_attempt_at (string, required, nullable) — When the next attempt is due; null once the delivery is final.
  • last_attempt_at (string, required, nullable)
  • last_status_code (integer, required, nullable)
  • last_error (string, required, nullable)
  • redelivery_of (string, required, nullable)
  • created_at (string, required)

GET /api/v1/org/webhooks/{endpoint_id}/deliveries

Sección titulada «GET /api/v1/org/webhooks/{endpoint_id}/deliveries»

Delivery log of an endpoint

operationId custhookListDeliveries · auth: orgSession

Newest first. Deliveries are kept for 30 days.

Parameter In Type Required Description
endpoint_id path string<uuid> yes
cursor query string no Opaque cursor from a previous page’s next_cursor.
limit query integer<int32> no (minimum: 1, maximum: 200, default: 50)
status query CusthookDeliveryStatus no
Status Meaning Body
200 OK application/json CusthookDeliveryList
default Error envelope. The HTTP status follows the error kind. application/json Error

Response 200 application/json — CusthookDeliveryList

  • data (array of CusthookDelivery, required)
    • id (string, required)
    • endpoint_id (string, required)
    • event_id (string, required)
    • event_type (string, required)
    • status (CusthookDeliveryStatus, required)
    • attempts (integer, required)
    • next_attempt_at (string, required, nullable) — When the next attempt is due; null once the delivery is final.
    • last_attempt_at (string, required, nullable)
    • last_status_code (integer, required, nullable)
    • last_error (string, required, nullable)
    • redelivery_of (string, required, nullable)
    • created_at (string, required)
  • next_cursor (string, required, nullable)
  • has_more (boolean, required)

GET /api/v1/org/webhook-deliveries/{delivery_id}

Sección titulada «GET /api/v1/org/webhook-deliveries/{delivery_id}»

A delivery with its body and every attempt

operationId custhookGetDelivery · auth: orgSession

Parameter In Type Required Description
delivery_id path string<uuid> yes
Status Meaning Body
200 OK application/json CusthookDeliveryDetail
default Error envelope. The HTTP status follows the error kind. application/json Error

Response 200 application/json — CusthookDeliveryDetail

  • delivery (CusthookDelivery, required)
    • id (string, required)
    • endpoint_id (string, required)
    • event_id (string, required)
    • event_type (string, required)
    • status (CusthookDeliveryStatus, required)
    • attempts (integer, required)
    • next_attempt_at (string, required, nullable) — When the next attempt is due; null once the delivery is final.
    • last_attempt_at (string, required, nullable)
    • last_status_code (integer, required, nullable)
    • last_error (string, required, nullable)
    • redelivery_of (string, required, nullable)
    • created_at (string, required)
  • body (string, required) — The exact JSON body that is signed and sent.
  • attempts (array of CusthookAttempt, required)
    • attempt (integer, required)
    • started_at (string, required)
    • duration_ms (integer, required)
    • status_code (integer, required, nullable)
    • succeeded (boolean, required)
    • error (string, required, nullable)
    • response_excerpt (string, required, nullable)

POST /api/v1/org/webhook-deliveries/{delivery_id}/redeliver

Sección titulada «POST /api/v1/org/webhook-deliveries/{delivery_id}/redeliver»

Send a delivery again

operationId custhookRedeliver · auth: orgSession

Creates a new delivery of the same event (same event id, so receivers can deduplicate) to the same endpoint, which must be enabled. At most 10 manual redeliveries per event and endpoint.

Parameter In Type Required Description
delivery_id path string<uuid> yes
Status Meaning Body
202 Queued application/json CusthookDelivery
default Error envelope. The HTTP status follows the error kind. application/json Error

Response 202 application/json — CusthookDelivery

  • id (string, required)
  • endpoint_id (string, required)
  • event_id (string, required)
  • event_type (string, required)
  • status (CusthookDeliveryStatus, required)
  • attempts (integer, required)
  • next_attempt_at (string, required, nullable) — When the next attempt is due; null once the delivery is final.
  • last_attempt_at (string, required, nullable)
  • last_status_code (integer, required, nullable)
  • last_error (string, required, nullable)
  • redelivery_of (string, required, nullable)
  • created_at (string, required)