Rotate webhook secret
Rotate the signing secret of a webhook endpoint; the new secret is returned once.
- The previous secret stays valid for 24 hours (previous_secret_valid_until).
- Rotating again within five minutes returns 422 business_rule_violation (subcode webhook_secret_recently_rotated); nothing changes.
Request
- Base URL: https://api.factuarea.com/v1
- URL: https://api.factuarea.com/v1/companies/{company}/webhook-endpoints/{webhook_endpoint}/rotate-secret
- 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).
Public identifier (UUID v7) of the webhook endpoint.
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. Required on this operation: repeating it delivers an effect that cannot be taken back (an email sent, a file generated, a third-party call, a charge), so a request without this header is rejected with 422 idempotency_key_required before any business logic runs.
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.
Response
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.