Polarex.Webhooks (Polarex v0.3.1)

Copy Markdown View Source

Provides API endpoints related to webhooks

Summary

Functions

webhooks_create_webhook_endpoint(body, opts \\ [])

@spec webhooks_create_webhook_endpoint(
  body :: Polarex.WebhookEndpointCreate.t(),
  opts :: keyword()
) ::
  {:ok, Polarex.WebhookEndpoint.t()} | {:error, Polarex.HTTPValidationError.t()}

Create Webhook Endpoint

Create a webhook endpoint.

Scopes: webhooks:write

Request Body

Content Types: application/json

webhooks_delete_webhook_endpoint(id, opts \\ [])

@spec webhooks_delete_webhook_endpoint(id :: String.t(), opts :: keyword()) ::
  :ok | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}

Delete Webhook Endpoint

Delete a webhook endpoint.

Scopes: webhooks:write

webhooks_get_webhook_endpoint(id, opts \\ [])

@spec webhooks_get_webhook_endpoint(id :: String.t(), opts :: keyword()) ::
  {:ok, Polarex.WebhookEndpoint.t()}
  | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}

Get Webhook Endpoint

Get a webhook endpoint by ID.

Scopes: webhooks:read webhooks:write

webhooks_list_webhook_deliveries(opts \\ [])

@spec webhooks_list_webhook_deliveries(opts :: keyword()) ::
  {:ok, Polarex.ListResourceWebhookDelivery.t()}
  | {:error, Polarex.HTTPValidationError.t()}

List Webhook Deliveries

List webhook deliveries.

Deliveries are all the attempts to deliver a webhook event to an endpoint.

Scopes: webhooks:read webhooks:write

Options

  • endpoint_id: Filter by webhook endpoint ID.
  • start_timestamp: Filter deliveries after this timestamp.
  • end_timestamp: Filter deliveries before this timestamp.
  • succeeded: Filter by delivery success status.
  • query: Query to filter webhook deliveries.
  • http_code_class: Filter by HTTP response code class (2xx, 3xx, 4xx, 5xx).
  • event_type: Filter by webhook event type.
  • page: Page number, defaults to 1.
  • limit: Size of a page, defaults to 10. Maximum is 100.

webhooks_list_webhook_endpoints(opts \\ [])

@spec webhooks_list_webhook_endpoints(opts :: keyword()) ::
  {:ok, Polarex.ListResourceWebhookEndpoint.t()}
  | {:error, Polarex.HTTPValidationError.t()}

List Webhook Endpoints

List webhook endpoints.

Scopes: webhooks:read webhooks:write

Options

  • organization_id: Filter by organization ID.
  • page: Page number, defaults to 1.
  • limit: Size of a page, defaults to 10. Maximum is 100.

webhooks_redeliver_webhook_event(id, opts \\ [])

@spec webhooks_redeliver_webhook_event(id :: String.t(), opts :: keyword()) ::
  {:ok, map()}
  | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}

Redeliver Webhook Event

Schedule the re-delivery of a webhook event.

Scopes: webhooks:write

webhooks_reset_webhook_endpoint_secret(id, opts \\ [])

@spec webhooks_reset_webhook_endpoint_secret(id :: String.t(), opts :: keyword()) ::
  {:ok, Polarex.WebhookEndpoint.t()}
  | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}

Reset Webhook Endpoint Secret

Regenerate a webhook endpoint secret.

Scopes: webhooks:write

webhooks_update_webhook_endpoint(id, body, opts \\ [])

@spec webhooks_update_webhook_endpoint(
  id :: String.t(),
  body :: Polarex.WebhookEndpointUpdate.t(),
  opts :: keyword()
) ::
  {:ok, Polarex.WebhookEndpoint.t()}
  | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}

Update Webhook Endpoint

Update a webhook endpoint.

Scopes: webhooks:write

Request Body

Content Types: application/json