Create a webhook endpoint
const url = 'https://api-staging.asqary.com/v1/webhooks';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"url":"https://lender.example.com/asqary/webhooks","description":"example","events":["*"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api-staging.asqary.com/v1/webhooks \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "url": "https://lender.example.com/asqary/webhooks", "description": "example", "events": [ "*" ] }'Registers an HTTPS URL to receive events in the key’s environment
(at most 10 per environment). The response includes the signing
secret; store it, as it is never shown again. Requires
webhooks:manage.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
HTTPS URL on a public address.
Example
https://lender.example.com/asqary/webhooksResponses
Section titled “Responses”Created, with its signing secret
object
When deliveries started failing. The endpoint is disabled after three days of failures.
Set after a rotation while the old secret still signs deliveries.
Signing secret. Shown only once.
Example
{ "events": [ "*" ], "status": "enabled", "environment": "live"}Malformed request (invalid_request), including unknown fields.
object
Invalid_request, unauthorized, key_expired, key_revoked, forbidden, ip_not_allowed, quota_exceeded, not_found, method_not_allowed, conflict, policy_in_use, policy_active, policy_archived, idempotency_key_reused, validation_failed, rule_not_available, backtest_invalid_rows, backtest_too_large, rate_limited, internal_error
object
object
Example generated
{ "error_code": "example", "message": "example", "retryable": true, "request_id": "example", "details": {}}Missing scope or role, IP not allowed, or monthly quota exceeded (quota_exceeded).
object
Invalid_request, unauthorized, key_expired, key_revoked, forbidden, ip_not_allowed, quota_exceeded, not_found, method_not_allowed, conflict, policy_in_use, policy_active, policy_archived, idempotency_key_reused, validation_failed, rule_not_available, backtest_invalid_rows, backtest_too_large, rate_limited, internal_error
object
object
Example generated
{ "error_code": "example", "message": "example", "retryable": true, "request_id": "example", "details": {}}validation_failed (details: field errors), rule_not_available, or backtest_invalid_rows.
object
Invalid_request, unauthorized, key_expired, key_revoked, forbidden, ip_not_allowed, quota_exceeded, not_found, method_not_allowed, conflict, policy_in_use, policy_active, policy_archived, idempotency_key_reused, validation_failed, rule_not_available, backtest_invalid_rows, backtest_too_large, rate_limited, internal_error
object
object
Example generated
{ "error_code": "example", "message": "example", "retryable": true, "request_id": "example", "details": {}}