Webhooks

Setup & Management

Register, test and manage your webhook endpoints from the API or the Dashboard.

This guide explains how to manage your webhook endpoints through the Tonder API: create, update, and manage endpoints to receive real-time notifications.

Security requirements: use a secure (HTTPS) URL, configure an authentication method (BEARER, API_TOKEN, or BASIC_AUTH) to verify requests come from Tonder, and validate the event structure and content before processing.

Step 1: create an endpoint

Register a new URL with the /webhooks/ endpoint. You can configure authentication to secure your endpoint:

curl -X POST https://stage.tonder.io/api/v1/webhooks/ \
  -H "Authorization: Token YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://your-site.com/webhook-handler",
    "auth_method": "BEARER",
    "credentials": {
      "token": "a-secure-bearer-token-you-generate"
    }
  }'

The response confirms the created endpoint:

{
  "id": 123,
  "url": "https://your-site.com/webhook-handler",
  "status": "active",
  "auth_method": "BEARER",
  "credentials": {
    "token": "a-secure-bearer-token-you-generate"
  }
}
FieldTypeDescription
idintegerUnique identifier for the endpoint.
urlstringThe URL you registered.
statusstringWebhook status (active, inactive).
auth_methodstringAuthentication method (BEARER, API_TOKEN, BASIC_AUTH).
credentialsobjectAssociated authentication credentials.

Save the webhook id for management operations.

Step 2: manage webhooks

OperationMethodEndpointPurpose
ListGET/webhooks/Retrieves all configured endpoints.
UpdatePUT/webhooks/{webhook_id}/Updates an endpoint's configuration.
DeleteDELETE/webhooks/{webhook_id}/Removes an endpoint (it stops receiving notifications).
curl -X GET https://stage.tonder.io/api/v1/webhooks/ \
  -H "Authorization: Token YOUR_API_KEY"
curl -X PUT https://stage.tonder.io/api/v1/webhooks/123/ \
  -H "Authorization: Token YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "url": "https://your-updated-site.com/webhook-handler" }'
curl -X DELETE https://stage.tonder.io/api/v1/webhooks/123/ \
  -H "Authorization: Token YOUR_API_KEY"

Troubleshooting

  • Authentication errors when creating webhooks: verify your credentials are correct and have permissions; test authentication locally before registering the webhook.
  • Endpoint not receiving events after setup: verify it's publicly accessible via HTTPS and responds with a 2xx within 30 seconds.

Next steps

Was this page helpful?

On this page