Webhooks
Rotate webhook endpoint secret
Gives the endpoint a new signing `secret` and returns it once.
Esta página aún no está disponible en tu idioma.
https://api.maple.inc/v1/webhook_endpoints/{endpointId}/rotate_secret API keyThe old secret keeps signing deliveries for expires_in seconds (default 24 hours, at most 7 days), so each delivery carries two v1 signatures until previous_secret_expires; expires_in: 0 stops the old secret at once. Rotating again during that time stops the oldest secret at once. Needs the read scope of every event type the endpoint holds, as an update does; if its enabled_events change while the rotation runs, it answers 409 webhook_endpoint_changed and rotates nothing.
Authorization
Send your API key as Authorization: Bearer <key>: mpk_test_… for test mode, mpk_live_… for live mode. Both use https://api.maple.inc/v1. See Authentication. The samples read the key from MAPLE_KEY and the base URL from MAPLE_BASE, as set up in the Quickstart.
Parameters
-
endpointIdstring required -
Idempotency-KeystringYour unique key for this request, such as a UUID. A retry with the same key and the same body within 24 hours returns the first response, with
Idempotent-Replayed: true, and does not run again. See https://docs.maple.inc/developer-api/concepts/idempotency Up to 255 characters. -
Maple-VersionstringThe API version your code expects. A version Maple does not serve answers 400
invalid_requestwithparamMaple-Version. See https://docs.maple.inc/developer-api/concepts/versioning Always2026-11-27.
Request body
application/json.
Option 1
expires_ininteger or null
Responses
200 OK
A webhook endpoint as its rotate call returns it, with its new signing secret and previous_secret_expires.
-
objectstring requiredAlways
webhook_endpoint. -
idstring required -
livemodeboolean requiredTrue for an endpoint in the live environment; false for test mode.
-
urlstring requiredThe HTTPS URL Maple sends events to.
-
api_versionstring requiredThe API version this endpoint’s events are rendered in, a date (
YYYY-MM-DD). Fixed when the endpoint is created. -
enabled_eventsstring[] requiredThe event types Maple sends to
url. -
statusstring requiredOne of
enabled,disabled. -
createdinteger required -
updatedinteger required -
secretstring requiredThe new HMAC-SHA256 signing secret (
mwhsec_…). Only this response carries it: store it now. -
previous_secret_expiresinteger or null requiredUnix timestamp in seconds when the old secret stops signing deliveries. Until then, each delivery carries a
v1signature for each secret. Null when the old secret stopped at once.
Errors
-
400Bad request -
401Unauthorized -
403Forbidden -
404Not found -
409Conflict -
415 -
429Too many requests -
500Server error
Every error body is one error object: branch on its type and code; message is for people, param names the field at fault, and doc_url links the code on Errors.
A 429 also sends Retry-After: Seconds to wait before retrying; also returned as error.retry_after in the body.