ExBifrost.Api.Webhooks (ex_bifrost v0.1.0)

Copy Markdown View Source

API calls for all endpoints tagged Webhooks.

Summary

Functions

Create a webhook endpoint Creates a webhook endpoint. The signing secret is generated by the server and returned once in the response — it cannot be supplied and cannot be retrieved again afterwards.

List delivery history Returns one page of delivery-attempt history for an endpoint, newest first.

List webhook endpoints Returns webhook endpoints, optionally filtered by search text, subscribed event, and disabled status. Signing secrets are never included and custom header values are redacted.

Re-queue a delivery Re-queues the delivery a history record belongs to, under its original webhook-id so receivers can deduplicate the replay.

Rotate a webhook signing secret Generates a new signing secret for the endpoint and returns it once. The previous secret stops verifying immediately — there is no grace window, so update your receiver in the same change.

Send a test delivery Sends a sample signed delivery for the chosen event through the production signing path.

Update a webhook endpoint Updates a webhook endpoint. The signing secret is immutable here — use the rotate-secret endpoint to change it.

Functions

create_webhook_endpoint(connection, webhook_endpoint_request, opts \\ [])

Create a webhook endpoint Creates a webhook endpoint. The signing secret is generated by the server and returned once in the response — it cannot be supplied and cannot be retrieved again afterwards.

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • webhook_endpoint_request (WebhookEndpointRequest):
  • opts (keyword): Optional parameters

Returns

  • {:ok, ExBifrost.Model.WebhookEndpointWithSecret.t} on success
  • {:error, Tesla.Env.t} on failure

delete_webhook_endpoint(connection, id, opts \\ [])

@spec delete_webhook_endpoint(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, ExBifrost.Model.WebhookStatusResponse.t()}
  | {:ok, ExBifrost.Model.BifrostError.t()}
  | {:error, Tesla.Env.t()}

Delete a webhook endpoint

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • id (String.t): The webhook endpoint id.
  • opts (keyword): Optional parameters

Returns

  • {:ok, ExBifrost.Model.WebhookStatusResponse.t} on success
  • {:error, Tesla.Env.t} on failure

get_webhook_endpoint(connection, id, opts \\ [])

@spec get_webhook_endpoint(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, ExBifrost.Model.BifrostError.t()}
  | {:ok, ExBifrost.Model.WebhookEndpoint.t()}
  | {:error, Tesla.Env.t()}

Get a webhook endpoint

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • id (String.t): The webhook endpoint id.
  • opts (keyword): Optional parameters

Returns

  • {:ok, ExBifrost.Model.WebhookEndpoint.t} on success
  • {:error, Tesla.Env.t} on failure

list_webhook_deliveries(connection, id, opts \\ [])

@spec list_webhook_deliveries(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, ExBifrost.Model.WebhookDeliveryList.t()}
  | {:ok, ExBifrost.Model.BifrostError.t()}
  | {:error, Tesla.Env.t()}

List delivery history Returns one page of delivery-attempt history for an endpoint, newest first.

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • id (String.t): The webhook endpoint id.
  • opts (keyword): Optional parameters
    • :limit (integer()):
    • :offset (integer()):

Returns

  • {:ok, ExBifrost.Model.WebhookDeliveryList.t} on success
  • {:error, Tesla.Env.t} on failure

list_webhook_endpoints(connection, opts \\ [])

@spec list_webhook_endpoints(
  Tesla.Env.client(),
  keyword()
) ::
  {:ok, ExBifrost.Model.BifrostError.t()}
  | {:ok, ExBifrost.Model.WebhookEndpointList.t()}
  | {:error, Tesla.Env.t()}

List webhook endpoints Returns webhook endpoints, optionally filtered by search text, subscribed event, and disabled status. Signing secrets are never included and custom header values are redacted.

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :search (String.t): Case-insensitive match against endpoint name or URL.
    • :event (String.t): Comma-separated events; returns endpoints subscribed to any of them.
    • :disabled (boolean()): Filter by disabled status. Omit for no filter.
    • :limit (integer()):
    • :offset (integer()):

Returns

  • {:ok, ExBifrost.Model.WebhookEndpointList.t} on success
  • {:error, Tesla.Env.t} on failure

redeliver_webhook(connection, id, opts \\ [])

@spec redeliver_webhook(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, ExBifrost.Model.RedeliverWebhookResponse.t()}
  | {:ok, ExBifrost.Model.BifrostError.t()}
  | {:error, Tesla.Env.t()}

Re-queue a delivery Re-queues the delivery a history record belongs to, under its original webhook-id so receivers can deduplicate the replay.

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • id (String.t): The delivery history record id to re-queue.
  • opts (keyword): Optional parameters

Returns

  • {:ok, ExBifrost.Model.RedeliverWebhookResponse.t} on success
  • {:error, Tesla.Env.t} on failure

rotate_webhook_endpoint_secret(connection, id, opts \\ [])

@spec rotate_webhook_endpoint_secret(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, ExBifrost.Model.WebhookEndpointWithSecret.t()}
  | {:ok, ExBifrost.Model.BifrostError.t()}
  | {:error, Tesla.Env.t()}

Rotate a webhook signing secret Generates a new signing secret for the endpoint and returns it once. The previous secret stops verifying immediately — there is no grace window, so update your receiver in the same change.

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • id (String.t): The webhook endpoint id.
  • opts (keyword): Optional parameters

Returns

  • {:ok, ExBifrost.Model.WebhookEndpointWithSecret.t} on success
  • {:error, Tesla.Env.t} on failure

test_webhook_endpoint(connection, id, test_webhook_request, opts \\ [])

Send a test delivery Sends a sample signed delivery for the chosen event through the production signing path.

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • id (String.t): The webhook endpoint id.
  • test_webhook_request (TestWebhookRequest):
  • opts (keyword): Optional parameters

Returns

  • {:ok, ExBifrost.Model.TestWebhookResponse.t} on success
  • {:error, Tesla.Env.t} on failure

update_webhook_endpoint(connection, id, webhook_endpoint_request, opts \\ [])

Update a webhook endpoint Updates a webhook endpoint. The signing secret is immutable here — use the rotate-secret endpoint to change it.

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • id (String.t): The webhook endpoint id.
  • webhook_endpoint_request (WebhookEndpointRequest):
  • opts (keyword): Optional parameters

Returns

  • {:ok, ExBifrost.Model.WebhookEndpoint.t} on success
  • {:error, Tesla.Env.t} on failure