Documentation menu

Webhook endpoints

Where the calling key's environment's events are sent.

signed POSTs to your backend when something happens (a balance runs low, a credit lands, a key is revoked), so you react without polling. Each delivery is signed with the endpoint's secret (hixel-signature); see the webhooks of this document for every event.

OperationMethodSDK
List webhook endpointsGEThixel.webhookEndpoints.list
Create a webhook endpointPOSThixel.webhookEndpoints.create
Get a webhook endpointGEThixel.webhookEndpoints.get
Update a webhook endpointPATCHhixel.webhookEndpoints.update
Delete a webhook endpointDELETEhixel.webhookEndpoints.delete
Rotate a webhook endpoint's secretPOSThixel.webhookEndpoints.rotateSecret
Send a test eventPOSThixel.webhookEndpoints.test
List an endpoint's deliveriesGEThixel.webhookEndpoints.listDeliveries
Redeliver a failed deliveryPOSThixel.webhookEndpoints.redeliver

List webhook endpoints#

GET/v1/webhook_endpointshixel.webhookEndpoints.list

A page of the environment's webhook endpoints (at most 16 in all), oldest first.

Takes an environment key with the management scope, or a project key with the member role or higher, naming the environment in x-hixel-environment.

Parameters

NameInTypeDescription
cursorquerystringThe next_cursor of the previous page, to read the next one; left out for the first page. Pass the same filters with it.
limitqueryintegerHow many items the page holds: an integer from 1 to 100; 50 when left out.

Response 200: WebhookEndpointList

FieldTypeDescription
data requiredarray of WebhookEndpoint
data[].id requiredstringThe id of a webhook endpoint (we_…).
data[].organization_id requiredstringThe id of your organization (org_…).
data[].project_id requiredstringThe id of a project (proj_…).
data[].environment_id requiredstringThe id of an environment (env_…).
data[].url requiredstringWhere events are sent.
data[].description requiredstring | nullA note of yours; null for none.
data[].event_types requiredarray of "*" | "wallet.balance_low" | "wallet.depleted" | "wallet.credited" | "wallet.grant_expired" | "wallet.credit_rejected" | …The event types the endpoint receives; * is every type but usage.recorded, which an endpoint receives only by naming it.
data[].enabled requiredbooleanWhether events are sent to it.
data[].disabled_reason required"manual" | "failing" | nullfailing when the platform disabled it after failing continuously; null while enabled.
data[].disabled_at requiredstring | nullWhen it was disabled; null while enabled.
data[].failing_since requiredstring | nullThe first failed attempt since the last success; null while it succeeds.
data[].consecutive_failures requiredintegerAttempts failed in a row since the last success.
data[].last_succeeded_at requiredstring | nullWhen a delivery to it last succeeded; null before the first.
data[].secret_last_four requiredstringThe signing secret's last four characters, to tell secrets apart.
data[].previous_secret_expires_at requiredstring | nullUntil when the secret replaced by the last rotation still signs too; null for none.
data[].created_at requiredstring (date-time)
data[].updated_at requiredstring (date-time)
next_cursor requiredstring | nullPass back as cursor for the next page; null on the last page.

Errors

  • 400
    • invalid_request: The request is malformed or fails validation; param names the field.
    • invalid_cursor: The cursor is not one this list gave.
    • environment_required: a project key was sent without x-hixel-environment.
    • invalid_query: the request's path, query or body does not match its schema, or the body is not JSON or is over 1 MiB.
  • 401 api_key_required, invalid_api_key, expired_api_key: no key was sent; the key is unknown or revoked, or its project or environment is archived; or it has expired.
  • 403
    • key_inactive: the key was revoked or expired while the request ran, or an environment's key lost the management scope.
    • management_scope_required: the environment's key does not have the management scope.
  • 404 environment_not_found: x-hixel-environment names an environment outside the project key's project, an archived one, or another than the environment key's own.
  • 500 internal: an unexpected failure on the platform's side (internal_error); the details are logged, never returned.
  • 503 database_unavailable: A dependency, such as the database or Stripe, cannot be reached; retry later.
curl "https://api.hixel.dev/v1/webhook_endpoints" \
  -H "Authorization: Bearer $HIXEL_API_KEY"

Create a webhook endpoint#

POST/v1/webhook_endpointshixel.webhookEndpoints.create

Adds an endpoint the environment's events are sent to, at most 16, and answers its signing secret, which is never shown again.

Takes an environment key with the management scope, or a project key with the admin role, naming the environment in x-hixel-environment. Accepts an Idempotency-Key header: a retry with the same key runs once.

Request body: CreateWebhookEndpointBody

FieldTypeDescription
url requiredstringWhere events are sent: https:// on a public host name, without user information, query or fragment.
descriptionstring
event_typesarray of string["*"] when left out: every event but usage.recorded.

Response 200: WebhookEndpointWithSecret

FieldTypeDescription
endpoint requiredWebhookEndpointWhere the environment's events are sent, as every read shows it: never its signing secret.
endpoint.id requiredstringThe id of a webhook endpoint (we_…).
endpoint.organization_id requiredstringThe id of your organization (org_…).
endpoint.project_id requiredstringThe id of a project (proj_…).
endpoint.environment_id requiredstringThe id of an environment (env_…).
endpoint.url requiredstringWhere events are sent.
endpoint.description requiredstring | nullA note of yours; null for none.
endpoint.event_types requiredarray of "*" | "wallet.balance_low" | "wallet.depleted" | "wallet.credited" | "wallet.grant_expired" | "wallet.credit_rejected" | …The event types the endpoint receives; * is every type but usage.recorded, which an endpoint receives only by naming it.
endpoint.enabled requiredbooleanWhether events are sent to it.
endpoint.disabled_reason required"manual" | "failing" | nullfailing when the platform disabled it after failing continuously; null while enabled.
endpoint.disabled_at requiredstring | nullWhen it was disabled; null while enabled.
endpoint.failing_since requiredstring | nullThe first failed attempt since the last success; null while it succeeds.
endpoint.consecutive_failures requiredintegerAttempts failed in a row since the last success.
endpoint.last_succeeded_at requiredstring | nullWhen a delivery to it last succeeded; null before the first.
endpoint.secret_last_four requiredstringThe signing secret's last four characters, to tell secrets apart.
endpoint.previous_secret_expires_at requiredstring | nullUntil when the secret replaced by the last rotation still signs too; null for none.
endpoint.created_at requiredstring (date-time)
endpoint.updated_at requiredstring (date-time)
secret requiredstring | nullThe endpoint's signing secret, whsec_…: store it now, it is never shown again. null in a response replayed for an Idempotency-Key.

Errors

  • 400
    • invalid_parameter, invalid_url: The request is malformed or fails validation; param names the field.
    • invalid_idempotency_key: an Idempotency-Key is 1 to 255 characters of visible ASCII.
    • environment_required: a project key was sent without x-hixel-environment.
    • invalid_payload, malformed_body, body_too_large: the request's path, query or body does not match its schema, or the body is not JSON or is over 1 MiB.
  • 401 api_key_required, invalid_api_key, expired_api_key: no key was sent; the key is unknown or revoked, or its project or environment is archived; or it has expired.
  • 403
    • key_inactive: the key was revoked or expired while the request ran, or an environment's key lost the management scope.
    • management_scope_required: the environment's key does not have the management scope.
    • role_not_allowed: the project key's member role does not allow this; it takes admin.
  • 404 environment_not_found: x-hixel-environment names an environment outside the project key's project, an archived one, or another than the environment key's own.
  • 409
    • project_archived: This project is archived.
    • environment_archived: This environment is archived.
    • webhook_endpoint_limit_reached: This environment has the most webhook endpoints it may have (16). Delete one first.
    • idempotency_key_reused, idempotency_key_in_use: the key was used for another request (method, path or body), or the first request with it is still running.
  • 500 internal: an unexpected failure on the platform's side (internal_error); the details are logged, never returned.
  • 503
    • database_unavailable: A dependency, such as the database or Stripe, cannot be reached; retry later.
    • database_unavailable: the stored response to the key could not be read or written; retry later.
curl -X POST "https://api.hixel.dev/v1/webhook_endpoints" \
  -H "Authorization: Bearer $HIXEL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://app.example.com/webhooks/gateway"
  }'

Get a webhook endpoint#

GET/v1/webhook_endpoints/{id}hixel.webhookEndpoints.get

The endpoint, never its signing secret.

Takes an environment key with the management scope, or a project key with the member role or higher, naming the environment in x-hixel-environment.

Parameters

NameInTypeDescription
id requiredpathstringThe endpoint's id (we_…).

Response 200: WebhookEndpoint

FieldTypeDescription
id requiredstringThe id of a webhook endpoint (we_…).
organization_id requiredstringThe id of your organization (org_…).
project_id requiredstringThe id of a project (proj_…).
environment_id requiredstringThe id of an environment (env_…).
url requiredstringWhere events are sent.
description requiredstring | nullA note of yours; null for none.
event_types requiredarray of "*" | "wallet.balance_low" | "wallet.depleted" | "wallet.credited" | "wallet.grant_expired" | "wallet.credit_rejected" | …The event types the endpoint receives; * is every type but usage.recorded, which an endpoint receives only by naming it.
enabled requiredbooleanWhether events are sent to it.
disabled_reason required"manual" | "failing" | nullfailing when the platform disabled it after failing continuously; null while enabled.
disabled_at requiredstring | nullWhen it was disabled; null while enabled.
failing_since requiredstring | nullThe first failed attempt since the last success; null while it succeeds.
consecutive_failures requiredintegerAttempts failed in a row since the last success.
last_succeeded_at requiredstring | nullWhen a delivery to it last succeeded; null before the first.
secret_last_four requiredstringThe signing secret's last four characters, to tell secrets apart.
previous_secret_expires_at requiredstring | nullUntil when the secret replaced by the last rotation still signs too; null for none.
created_at requiredstring (date-time)
updated_at requiredstring (date-time)

Errors

  • 400
    • invalid_request: The request is malformed or fails validation; param names the field.
    • environment_required: a project key was sent without x-hixel-environment.
    • invalid_params: the request's path, query or body does not match its schema, or the body is not JSON or is over 1 MiB.
  • 401 api_key_required, invalid_api_key, expired_api_key: no key was sent; the key is unknown or revoked, or its project or environment is archived; or it has expired.
  • 403
    • key_inactive: the key was revoked or expired while the request ran, or an environment's key lost the management scope.
    • management_scope_required: the environment's key does not have the management scope.
  • 404
    • webhook_endpoint_not_found: The resource does not exist in the key's environment; a resource outside it reads the same.
    • environment_not_found: x-hixel-environment names an environment outside the project key's project, an archived one, or another than the environment key's own.
  • 500 internal: an unexpected failure on the platform's side (internal_error); the details are logged, never returned.
  • 503 database_unavailable: A dependency, such as the database or Stripe, cannot be reached; retry later.
curl "https://api.hixel.dev/v1/webhook_endpoints/we_123" \
  -H "Authorization: Bearer $HIXEL_API_KEY"

Update a webhook endpoint#

PATCH/v1/webhook_endpoints/{id}hixel.webhookEndpoints.update

Changes the fields given. enabled: false disables the endpoint; enabled: true enables it again and clears its failures.

Takes an environment key with the management scope, or a project key with the admin role, naming the environment in x-hixel-environment. Accepts an Idempotency-Key header: a retry with the same key runs once.

Parameters

NameInTypeDescription
id requiredpathstringThe endpoint's id (we_…).

Request body: UpdateWebhookEndpointBody

FieldTypeDescription
urlstring
descriptionstring | null
event_typesarray of string
enabledbooleanfalse disables the endpoint; true enables it again and clears its failures.

Response 200: WebhookEndpoint

FieldTypeDescription
id requiredstringThe id of a webhook endpoint (we_…).
organization_id requiredstringThe id of your organization (org_…).
project_id requiredstringThe id of a project (proj_…).
environment_id requiredstringThe id of an environment (env_…).
url requiredstringWhere events are sent.
description requiredstring | nullA note of yours; null for none.
event_types requiredarray of "*" | "wallet.balance_low" | "wallet.depleted" | "wallet.credited" | "wallet.grant_expired" | "wallet.credit_rejected" | …The event types the endpoint receives; * is every type but usage.recorded, which an endpoint receives only by naming it.
enabled requiredbooleanWhether events are sent to it.
disabled_reason required"manual" | "failing" | nullfailing when the platform disabled it after failing continuously; null while enabled.
disabled_at requiredstring | nullWhen it was disabled; null while enabled.
failing_since requiredstring | nullThe first failed attempt since the last success; null while it succeeds.
consecutive_failures requiredintegerAttempts failed in a row since the last success.
last_succeeded_at requiredstring | nullWhen a delivery to it last succeeded; null before the first.
secret_last_four requiredstringThe signing secret's last four characters, to tell secrets apart.
previous_secret_expires_at requiredstring | nullUntil when the secret replaced by the last rotation still signs too; null for none.
created_at requiredstring (date-time)
updated_at requiredstring (date-time)

Errors

  • 400
    • invalid_parameter, invalid_url: The request is malformed or fails validation; param names the field.
    • invalid_idempotency_key: an Idempotency-Key is 1 to 255 characters of visible ASCII.
    • environment_required: a project key was sent without x-hixel-environment.
    • invalid_params, invalid_payload, malformed_body, body_too_large: the request's path, query or body does not match its schema, or the body is not JSON or is over 1 MiB.
  • 401 api_key_required, invalid_api_key, expired_api_key: no key was sent; the key is unknown or revoked, or its project or environment is archived; or it has expired.
  • 403
    • key_inactive: the key was revoked or expired while the request ran, or an environment's key lost the management scope.
    • management_scope_required: the environment's key does not have the management scope.
    • role_not_allowed: the project key's member role does not allow this; it takes admin.
  • 404
    • webhook_endpoint_not_found: The resource does not exist in the key's environment; a resource outside it reads the same.
    • environment_not_found: x-hixel-environment names an environment outside the project key's project, an archived one, or another than the environment key's own.
  • 409
    • project_archived: This project is archived.
    • environment_archived: This environment is archived.
    • idempotency_key_reused, idempotency_key_in_use: the key was used for another request (method, path or body), or the first request with it is still running.
  • 500 internal: an unexpected failure on the platform's side (internal_error); the details are logged, never returned.
  • 503
    • database_unavailable: A dependency, such as the database or Stripe, cannot be reached; retry later.
    • database_unavailable: the stored response to the key could not be read or written; retry later.
curl -X PATCH "https://api.hixel.dev/v1/webhook_endpoints/we_123" \
  -H "Authorization: Bearer $HIXEL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://app.example.com/webhooks/gateway"
  }'

Delete a webhook endpoint#

DELETE/v1/webhook_endpoints/{id}hixel.webhookEndpoints.delete

Deletes the endpoint; events are no longer sent to it. Answers 204 with no body.

Takes an environment key with the management scope, or a project key with the admin role, naming the environment in x-hixel-environment. Accepts an Idempotency-Key header: a retry with the same key runs once.

Parameters

NameInTypeDescription
id requiredpathstringThe endpoint's id (we_…).

Response 204

No body.

Errors

  • 400
    • invalid_request: The request is malformed or fails validation; param names the field.
    • invalid_idempotency_key: an Idempotency-Key is 1 to 255 characters of visible ASCII.
    • environment_required: a project key was sent without x-hixel-environment.
    • invalid_params: the request's path, query or body does not match its schema, or the body is not JSON or is over 1 MiB.
  • 401 api_key_required, invalid_api_key, expired_api_key: no key was sent; the key is unknown or revoked, or its project or environment is archived; or it has expired.
  • 403
    • key_inactive: the key was revoked or expired while the request ran, or an environment's key lost the management scope.
    • management_scope_required: the environment's key does not have the management scope.
    • role_not_allowed: the project key's member role does not allow this; it takes admin.
  • 404
    • webhook_endpoint_not_found: The resource does not exist in the key's environment; a resource outside it reads the same.
    • environment_not_found: x-hixel-environment names an environment outside the project key's project, an archived one, or another than the environment key's own.
  • 409
    • project_archived: This project is archived.
    • environment_archived: This environment is archived.
    • idempotency_key_reused, idempotency_key_in_use: the key was used for another request (method, path or body), or the first request with it is still running.
  • 500 internal: an unexpected failure on the platform's side (internal_error); the details are logged, never returned.
  • 503
    • database_unavailable: A dependency, such as the database or Stripe, cannot be reached; retry later.
    • database_unavailable: the stored response to the key could not be read or written; retry later.
curl -X DELETE "https://api.hixel.dev/v1/webhook_endpoints/we_123" \
  -H "Authorization: Bearer $HIXEL_API_KEY"

Rotate a webhook endpoint's secret#

POST/v1/webhook_endpoints/{id}/rotate_secrethixel.webhookEndpoints.rotateSecret

A new signing secret, shown once. The old one keeps signing beside it for grace_period_seconds (24 hours when left out, 0 to 7 days), so a delivery carries a signature of each. The body may be empty.

Takes an environment key with the management scope, or a project key with the admin role, naming the environment in x-hixel-environment. Accepts an Idempotency-Key header: a retry with the same key runs once.

Parameters

NameInTypeDescription
id requiredpathstringThe endpoint's id (we_…).

Request body: RotateWebhookSecretBody

FieldTypeDescription
grace_period_secondsinteger

Response 200: WebhookEndpointWithSecret

FieldTypeDescription
endpoint requiredWebhookEndpointWhere the environment's events are sent, as every read shows it: never its signing secret.
endpoint.id requiredstringThe id of a webhook endpoint (we_…).
endpoint.organization_id requiredstringThe id of your organization (org_…).
endpoint.project_id requiredstringThe id of a project (proj_…).
endpoint.environment_id requiredstringThe id of an environment (env_…).
endpoint.url requiredstringWhere events are sent.
endpoint.description requiredstring | nullA note of yours; null for none.
endpoint.event_types requiredarray of "*" | "wallet.balance_low" | "wallet.depleted" | "wallet.credited" | "wallet.grant_expired" | "wallet.credit_rejected" | …The event types the endpoint receives; * is every type but usage.recorded, which an endpoint receives only by naming it.
endpoint.enabled requiredbooleanWhether events are sent to it.
endpoint.disabled_reason required"manual" | "failing" | nullfailing when the platform disabled it after failing continuously; null while enabled.
endpoint.disabled_at requiredstring | nullWhen it was disabled; null while enabled.
endpoint.failing_since requiredstring | nullThe first failed attempt since the last success; null while it succeeds.
endpoint.consecutive_failures requiredintegerAttempts failed in a row since the last success.
endpoint.last_succeeded_at requiredstring | nullWhen a delivery to it last succeeded; null before the first.
endpoint.secret_last_four requiredstringThe signing secret's last four characters, to tell secrets apart.
endpoint.previous_secret_expires_at requiredstring | nullUntil when the secret replaced by the last rotation still signs too; null for none.
endpoint.created_at requiredstring (date-time)
endpoint.updated_at requiredstring (date-time)
secret requiredstring | nullThe endpoint's signing secret, whsec_…: store it now, it is never shown again. null in a response replayed for an Idempotency-Key.

Errors

  • 400
    • invalid_request: The request is malformed or fails validation; param names the field.
    • invalid_idempotency_key: an Idempotency-Key is 1 to 255 characters of visible ASCII.
    • environment_required: a project key was sent without x-hixel-environment.
    • invalid_params, invalid_payload, malformed_body, body_too_large: the request's path, query or body does not match its schema, or the body is not JSON or is over 1 MiB.
  • 401 api_key_required, invalid_api_key, expired_api_key: no key was sent; the key is unknown or revoked, or its project or environment is archived; or it has expired.
  • 403
    • key_inactive: the key was revoked or expired while the request ran, or an environment's key lost the management scope.
    • management_scope_required: the environment's key does not have the management scope.
    • role_not_allowed: the project key's member role does not allow this; it takes admin.
  • 404
    • webhook_endpoint_not_found: The resource does not exist in the key's environment; a resource outside it reads the same.
    • environment_not_found: x-hixel-environment names an environment outside the project key's project, an archived one, or another than the environment key's own.
  • 409
    • project_archived: This project is archived.
    • environment_archived: This environment is archived.
    • idempotency_key_reused, idempotency_key_in_use: the key was used for another request (method, path or body), or the first request with it is still running.
  • 500 internal: an unexpected failure on the platform's side (internal_error); the details are logged, never returned.
  • 503
    • database_unavailable: A dependency, such as the database or Stripe, cannot be reached; retry later.
    • database_unavailable: the stored response to the key could not be read or written; retry later.
curl -X POST "https://api.hixel.dev/v1/webhook_endpoints/we_123/rotate_secret" \
  -H "Authorization: Bearer $HIXEL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "grace_period_seconds": 3600
  }'

Send a test event#

POST/v1/webhook_endpoints/{id}/testhixel.webhookEndpoints.test

Sends a webhook.test event to this endpoint alone, whatever it subscribes to, to check that it receives and verifies deliveries.

Takes an environment key with the management scope, or a project key with the admin role, naming the environment in x-hixel-environment. Accepts an Idempotency-Key header: a retry with the same key runs once.

Parameters

NameInTypeDescription
id requiredpathstringThe endpoint's id (we_…).

Response 200: WebhookTestSent

FieldTypeDescription
event_id requiredstringThe id of an event (evt_…): the same in every delivery of it.
delivery requiredWebhookDeliveryOne event's delivery to one endpoint: never the request's signature.
delivery.id requiredstringThe id of one event's delivery to one endpoint (whd_…).
delivery.endpoint_id requiredstringThe id of a webhook endpoint (we_…).
delivery.event_id requiredstringThe id of an event (evt_…): the same in every delivery of it.
delivery.event_type required"wallet.balance_low" | "wallet.depleted" | "wallet.credited" | "wallet.grant_expired" | "wallet.credit_rejected" | "wallet.spend_limit_reached" | …
delivery.status required"pending" | "succeeded" | "failed"pending while attempts remain, then succeeded or failed.
delivery.attempts requiredintegerAttempts made so far.
delivery.next_attempt_at requiredstring | nullWhen the next attempt is due; null once the delivery succeeded or failed.
delivery.last_attempt_at requiredstring | nullWhen it was last attempted; null before the first.
delivery.last_response_status requiredinteger | nullThe HTTP status of the last answer; null when none came (last_error says why).
delivery.last_response_body requiredstring | nullThe start of the last answer's body: at most 1024 characters.
delivery.last_error required"timeout" | "network" | "redirect" | "http_status" | "internal" | string | nullWhy the last attempt failed: timeout, network, redirect, http_status, or internal (a fault on the platform's side, not counted against the endpoint).
delivery.completed_at requiredstring | nullWhen it succeeded or failed for good; null while pending.
delivery.created_at requiredstring (date-time)

Errors

  • 400
    • invalid_request: The request is malformed or fails validation; param names the field.
    • invalid_idempotency_key: an Idempotency-Key is 1 to 255 characters of visible ASCII.
    • environment_required: a project key was sent without x-hixel-environment.
    • invalid_params: the request's path, query or body does not match its schema, or the body is not JSON or is over 1 MiB.
  • 401 api_key_required, invalid_api_key, expired_api_key: no key was sent; the key is unknown or revoked, or its project or environment is archived; or it has expired.
  • 403
    • key_inactive: the key was revoked or expired while the request ran, or an environment's key lost the management scope.
    • management_scope_required: the environment's key does not have the management scope.
    • role_not_allowed: the project key's member role does not allow this; it takes admin.
  • 404
    • webhook_endpoint_not_found: The resource does not exist in the key's environment; a resource outside it reads the same.
    • environment_not_found: x-hixel-environment names an environment outside the project key's project, an archived one, or another than the environment key's own.
  • 409
    • project_archived: This project is archived.
    • environment_archived: This environment is archived.
    • webhook_endpoint_disabled: This webhook endpoint is disabled. Enable it first.
    • idempotency_key_reused, idempotency_key_in_use: the key was used for another request (method, path or body), or the first request with it is still running.
  • 500 internal: an unexpected failure on the platform's side (internal_error); the details are logged, never returned.
  • 503
    • database_unavailable: A dependency, such as the database or Stripe, cannot be reached; retry later.
    • database_unavailable: the stored response to the key could not be read or written; retry later.
curl -X POST "https://api.hixel.dev/v1/webhook_endpoints/we_123/test" \
  -H "Authorization: Bearer $HIXEL_API_KEY"

List an endpoint's deliveries#

GET/v1/webhook_endpoints/{id}/deliverieshixel.webhookEndpoints.listDeliveries

A page of the endpoint's deliveries, newest first.

Takes an environment key with the management scope, or a project key with the member role or higher, naming the environment in x-hixel-environment.

Parameters

NameInTypeDescription
id requiredpathstringThe endpoint's id (we_…).
statusquery"pending" | "succeeded" | "failed"Only deliveries with this status.
event_idquerystringOnly the deliveries of this event (evt_…).
cursorquerystringThe next_cursor of the previous page, to read the next one; left out for the first page. Pass the same filters with it.
limitqueryintegerHow many items the page holds: an integer from 1 to 100; 50 when left out.

Response 200: WebhookDeliveryList

FieldTypeDescription
data requiredarray of WebhookDelivery
data[].id requiredstringThe id of one event's delivery to one endpoint (whd_…).
data[].endpoint_id requiredstringThe id of a webhook endpoint (we_…).
data[].event_id requiredstringThe id of an event (evt_…): the same in every delivery of it.
data[].event_type required"wallet.balance_low" | "wallet.depleted" | "wallet.credited" | "wallet.grant_expired" | "wallet.credit_rejected" | "wallet.spend_limit_reached" | …
data[].status required"pending" | "succeeded" | "failed"pending while attempts remain, then succeeded or failed.
data[].attempts requiredintegerAttempts made so far.
data[].next_attempt_at requiredstring | nullWhen the next attempt is due; null once the delivery succeeded or failed.
data[].last_attempt_at requiredstring | nullWhen it was last attempted; null before the first.
data[].last_response_status requiredinteger | nullThe HTTP status of the last answer; null when none came (last_error says why).
data[].last_response_body requiredstring | nullThe start of the last answer's body: at most 1024 characters.
data[].last_error required"timeout" | "network" | "redirect" | "http_status" | "internal" | string | nullWhy the last attempt failed: timeout, network, redirect, http_status, or internal (a fault on the platform's side, not counted against the endpoint).
data[].completed_at requiredstring | nullWhen it succeeded or failed for good; null while pending.
data[].created_at requiredstring (date-time)
next_cursor requiredstring | nullPass back as cursor for the next page; null on the last page.

Errors

  • 400
    • invalid_request: The request is malformed or fails validation; param names the field.
    • invalid_cursor: The cursor is not one this list gave.
    • environment_required: a project key was sent without x-hixel-environment.
    • invalid_params, invalid_query: the request's path, query or body does not match its schema, or the body is not JSON or is over 1 MiB.
  • 401 api_key_required, invalid_api_key, expired_api_key: no key was sent; the key is unknown or revoked, or its project or environment is archived; or it has expired.
  • 403
    • key_inactive: the key was revoked or expired while the request ran, or an environment's key lost the management scope.
    • management_scope_required: the environment's key does not have the management scope.
  • 404
    • webhook_endpoint_not_found: The resource does not exist in the key's environment; a resource outside it reads the same.
    • environment_not_found: x-hixel-environment names an environment outside the project key's project, an archived one, or another than the environment key's own.
  • 500 internal: an unexpected failure on the platform's side (internal_error); the details are logged, never returned.
  • 503 database_unavailable: A dependency, such as the database or Stripe, cannot be reached; retry later.
curl "https://api.hixel.dev/v1/webhook_endpoints/we_123/deliveries" \
  -H "Authorization: Bearer $HIXEL_API_KEY"

Redeliver a failed delivery#

POST/v1/webhook_endpoints/{id}/deliveries/{delivery_id}/redeliverhixel.webhookEndpoints.redeliver

Sends a failed delivery again, with a fresh retry schedule.

Takes an environment key with the management scope, or a project key with the admin role, naming the environment in x-hixel-environment. Accepts an Idempotency-Key header: a retry with the same key runs once.

Parameters

NameInTypeDescription
id requiredpathstringThe endpoint's id (we_…).
delivery_id requiredpathstringThe delivery's id (whd_…).

Response 200: WebhookDelivery

FieldTypeDescription
id requiredstringThe id of one event's delivery to one endpoint (whd_…).
endpoint_id requiredstringThe id of a webhook endpoint (we_…).
event_id requiredstringThe id of an event (evt_…): the same in every delivery of it.
event_type required"wallet.balance_low" | "wallet.depleted" | "wallet.credited" | "wallet.grant_expired" | "wallet.credit_rejected" | "wallet.spend_limit_reached" | …
status required"pending" | "succeeded" | "failed"pending while attempts remain, then succeeded or failed.
attempts requiredintegerAttempts made so far.
next_attempt_at requiredstring | nullWhen the next attempt is due; null once the delivery succeeded or failed.
last_attempt_at requiredstring | nullWhen it was last attempted; null before the first.
last_response_status requiredinteger | nullThe HTTP status of the last answer; null when none came (last_error says why).
last_response_body requiredstring | nullThe start of the last answer's body: at most 1024 characters.
last_error required"timeout" | "network" | "redirect" | "http_status" | "internal" | string | nullWhy the last attempt failed: timeout, network, redirect, http_status, or internal (a fault on the platform's side, not counted against the endpoint).
completed_at requiredstring | nullWhen it succeeded or failed for good; null while pending.
created_at requiredstring (date-time)

Errors

  • 400
    • invalid_request: The request is malformed or fails validation; param names the field.
    • invalid_idempotency_key: an Idempotency-Key is 1 to 255 characters of visible ASCII.
    • environment_required: a project key was sent without x-hixel-environment.
    • invalid_params: the request's path, query or body does not match its schema, or the body is not JSON or is over 1 MiB.
  • 401 api_key_required, invalid_api_key, expired_api_key: no key was sent; the key is unknown or revoked, or its project or environment is archived; or it has expired.
  • 403
    • key_inactive: the key was revoked or expired while the request ran, or an environment's key lost the management scope.
    • management_scope_required: the environment's key does not have the management scope.
    • role_not_allowed: the project key's member role does not allow this; it takes admin.
  • 404
    • webhook_endpoint_not_found, webhook_delivery_not_found: The resource does not exist in the key's environment; a resource outside it reads the same.
    • environment_not_found: x-hixel-environment names an environment outside the project key's project, an archived one, or another than the environment key's own.
  • 409
    • project_archived: This project is archived.
    • environment_archived: This environment is archived.
    • webhook_endpoint_disabled: This webhook endpoint is disabled. Enable it first.
    • webhook_delivery_not_failed: Only a delivery that failed can be redelivered.
    • idempotency_key_reused, idempotency_key_in_use: the key was used for another request (method, path or body), or the first request with it is still running.
  • 500 internal: an unexpected failure on the platform's side (internal_error); the details are logged, never returned.
  • 503
    • database_unavailable: A dependency, such as the database or Stripe, cannot be reached; retry later.
    • database_unavailable: the stored response to the key could not be read or written; retry later.
curl -X POST "https://api.hixel.dev/v1/webhook_endpoints/we_123/deliveries/whd_123/redeliver" \
  -H "Authorization: Bearer $HIXEL_API_KEY"