Create endpoint
curl --request POST \
--url https://api.atoa.me/api/webhook/v2/endpoints \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"url": "https://your-server.com/webhooks",
"events": ["PAYMENTS_STATUS", "REFUND_STATUS"],
"description": "Production orders endpoint"
}'
{
"id": "4a124f25-fe8d-47a0-92c8-16d94cbfe24c",
"url": "https://your-server.com/webhooks",
"description": "Production orders endpoint",
"environment": "PRODUCTION",
"events": [
{ "event": "PAYMENTS_STATUS", "label": "Payment Status" },
{ "event": "REFUND_STATUS", "label": "Refund Status" }
],
"hasAuthentication": false,
"authenticationType": null,
"failureCount": 0,
"lastDeliveredAt": null
}
Register a webhook endpoint and subscribe to one or more event types in a single call. Use List event types to get the full list of available event type names.
Initial registration only. Use this endpoint to register a new URL with its initial event subscriptions. To change events or authentication on an existing endpoint, use Update endpoint. To change the URL, delete the endpoint and create a new one.
Authorization
Bearer <token>
Request Body Schema
The HTTPS endpoint URL that will receive webhook deliveries. Must return HTTP 200 on success — failures are retried with exponential back-off for up to 24 hours. This URL cannot be changed after creation — to use a different URL, delete the endpoint and create a new one.
One or more event types to subscribe to. Valid values: PAYMENTS_STATUS, EXPIRED_STATUS, REFUND_STATUS, POS_PAYMENT_STATUS. Subscribing to POS_PAYMENT_STATUS requires a webhook signing key to be generated first.
Each event type supports a maximum of 3 registered endpoints. If an event type already has 3 endpoints, adding another endpoint subscribed to that event returns a 400 error. Use List endpoints to check current registrations before creating.
Optional label for this endpoint (max 100 characters). Shown in the Atoa Dashboard to help identify the endpoint.
Optional. Credentials Atoa will include in every webhook delivery to authenticate against your server. Two methods are supported — choose one. Fields from different methods cannot be mixed.
Response
Unique identifier for the endpoint.
The registered endpoint URL.
The endpoint description, or null if not set.
SANDBOX or PRODUCTION, derived from the API key used.
Subscribed event types.
Whether endpoint authentication is configured.
BASIC, OAUTH2, or null if no authentication is configured.
Consecutive failed deliveries since the last successful delivery. Resets to 0 on success.
ISO 8601 timestamp of the last successful delivery, or null if never delivered.
curl --request POST \
--url https://api.atoa.me/api/webhook/v2/endpoints \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"url": "https://your-server.com/webhooks",
"events": ["PAYMENTS_STATUS", "REFUND_STATUS"],
"description": "Production orders endpoint"
}'
{
"id": "4a124f25-fe8d-47a0-92c8-16d94cbfe24c",
"url": "https://your-server.com/webhooks",
"description": "Production orders endpoint",
"environment": "PRODUCTION",
"events": [
{ "event": "PAYMENTS_STATUS", "label": "Payment Status" },
{ "event": "REFUND_STATUS", "label": "Refund Status" }
],
"hasAuthentication": false,
"authenticationType": null,
"failureCount": 0,
"lastDeliveredAt": null
}