Rotate a webhook endpoint's secret
Last updated:
Request
Synthetic example for the production API. Replace YOUR_API_KEY and the ids. Do not send it against a live account until you mean to.
curl -X POST "https://api.fxapis.com/v1/webhooks/ACCOUNT_ID/rotate" \
-H "Authorization: Bearer YOUR_API_KEY"Issues a new secret, returned once. For 24 hours every delivery is signed with both the new and the old secret — two v1= values in fxapis-signature — so you can deploy the new one without missing an event.
Authorization
apiKey Authorization: Bearer fx_live_<id>_<secret>.
A key is shown once, at creation. We cannot show it again or recover it for you.
Keys carry a label (live or test) in the key itself, so each configuration is easy to tell
apart. Both reach real brokers: test with a broker demo account.
Scopes are per key. A key without accounts:write can read accounts and nothing else.
In: header
Path Parameters
uuidResponse Body
application/json
application/json
application/json
application/json
curl -X POST "https://api.fxapis.com/v1/webhooks/497f6eca-6276-4993-bfeb-53cbbbba6f08/rotate"{ "data": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "url": "https://example.com/fxapis/webhooks", "description": "Copier", "events": [ "order.filled" ], "enabled": true, "disabledAt": null, "disabledReason": "20 deliveries in a row failed", "consecutiveFailures": 0, "secretHint": "whsec_…Qx4w", "previousSecretExpiresAt": null, "problem": null, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "secret": "whsec_3q2-7ZkT0d8m1sQe9yVbW4nX6pLr5aHcUgJf0oKxQx4w" }}Replay events to an endpoint POST
Queues this window's events, of the types this endpoint receives, oldest first, with their original ids. By default (`include: "failed"`) only events it did not receive — deliveries it gave up on, and events recorded while it was switched off — so repeating a call sends nothing twice. `include: "all"` also re-sends what it already received: deduplicate on `id` first. Types follow the endpoint's events now: if you added a type later, its events recorded since the endpoint was created are sent too — never sent to it before, but older than what it has received. Up to 10,000 per call; `nextSince` says where to continue. Events written at one exact moment are never split across calls, so in the rare case of more than that at one moment, a call queues them all. For code that catches up by itself, read `GET /v1/events?after=<last listed id>` instead.
Send a test event POST
Sends a `webhook.test` event to this endpoint only, within a few seconds. Check the delivery log for the result.