Webhook endpoint registration and management.
Requires webhook-endpoints scope.
Setup
{:ok, client} = Tink.Auth.client_credentials(scope: "webhook-endpoints")
{:ok, endpoint} = Tink.Webhooks.create(client, %{
"url" => "https://yourapp.com/tink/events",
"enabledEvents" => [
"account.updated",
"credentials.updated",
"transaction.updated",
"consent.revoked"
]
})Handling events
See Tink.WebhookHandler for event dispatch and Tink.WebhookVerifier for signature verification.
Summary
Functions
Create a webhook endpoint. Requires webhook-endpoints.
Delete a webhook endpoint. Requires webhook-endpoints.
Get a webhook endpoint by ID. Requires webhook-endpoints.
List all registered webhook endpoints. Requires webhook-endpoints.
Update a webhook endpoint. Requires webhook-endpoints.
Functions
@spec create(Tink.Client.t(), map()) :: {:ok, map()} | {:error, Tink.Error.t()}
Create a webhook endpoint. Requires webhook-endpoints.
@spec delete(Tink.Client.t(), String.t()) :: :ok | {:error, Tink.Error.t()}
Delete a webhook endpoint. Requires webhook-endpoints.
@spec get(Tink.Client.t(), String.t()) :: {:ok, map()} | {:error, Tink.Error.t()}
Get a webhook endpoint by ID. Requires webhook-endpoints.
@spec list(Tink.Client.t()) :: {:ok, map()} | {:error, Tink.Error.t()}
List all registered webhook endpoints. Requires webhook-endpoints.
@spec update(Tink.Client.t(), String.t(), map()) :: {:ok, map()} | {:error, Tink.Error.t()}
Update a webhook endpoint. Requires webhook-endpoints.