Create a webhook endpoint
Create a webhook endpoint that receives event notifications via HTTPS callbacks. The signing secret is returned once in this response and never again — store it securely.
Request
- Base URL: https://api.factuarea.com/v1
- URL: https://api.factuarea.com/v1/companies/{company}/webhook-endpoints
- Auth: one of:
- HTTP bearer
- API key in header X-API-Key
Path parameters
Public identifier (UUID v7) of the company. Get it from GET /v1/me (data.scope[].id).
Headers
Client-generated opaque key (up to 255 characters; UUID v7 recommended) that makes retries safe: the first response is cached and replayed for repeats without re-executing the mutation. Reusing a key with a different body returns 422 idempotency_key_reused; the values of secret fields (password, secret…) count as part of the body, so retrying with a corrected secret under the same key is a different request, never the replay of the earlier answer. See the Idempotency guide.
Pin the API version (YYYY-MM-DD, Stripe-style date versioning) for this request; omit to use the key's pinned version, or the latest if none. Unsupported version → 400 unsupported_api_version; malformed → 400 parameter_invalid_format. The effective version is echoed in the Factuarea-Version response header. See the Versioning guide.
Request body
Example request
{
"metadata": {
"erp_code": "IVA-GEN",
"ledger_account": "477000"
},
"custom_headers": {
"Authorization": "Bearer integration-token",
"X-Custom-Auth": "tenant-a"
}
}Response
Webhook endpoint created successfully. The Location header contains the canonical URL of the newly created resource.
Example response
{
"data": {
"id": "01931b3e-7c4a-7f2e-9a8b-3c5d6e7f8a0b",
"object": "webhook_endpoint",
"url": "https://example.com/webhooks/factuarea",
"description": "Webhook principal de producción.",
"enabled_events": [
"invoice.created",
"invoice.paid",
"quote.approved"
],
"status": "active",
"ip_allowlist": [
"203.0.113.10",
"198.51.100.0/24"
],
"delivery_success_rate_24h": 99.5,
"last_delivery_at": "2026-01-25T18:00:00Z",
"last_failure_at": "2026-01-20T09:14:33Z",
"previous_secret_valid_until": "2026-01-26T18:00:00Z",
"created_at": "2025-12-15T12:00:00Z",
"updated_at": "2026-01-25T18:00:00Z",
"api_version": "2026-10-01",
"metadata": {
"erp_code": "IVA-GEN",
"ledger_account": "477000"
},
"custom_headers": {
"Authorization": "Bearer integration-token",
"X-Custom-Auth": "tenant-a"
},
"timeout_seconds": 10,
"degraded_since": "2026-01-24T07:30:00Z",
"secret": "whsec_01HKQS5N8VR7QXJ9K3T6BWPMZA9876543210ABCDEF"
}
}Changes
No recorded changes to this operation across all 1 revision of this API.