Send an event
const url = 'https://api.mayottehub.com/v1/webhooks';const options = { method: 'POST', headers: { 'X-Mayotte-Timestamp': '1762862400', 'X-Mayotte-Signature': 'v1=<64 lowercase hex characters>', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"id":"evt_8f2c1a","type":"booking.created","created_at":"2026-11-11T12:00:00Z","data":{}}'};
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.mayottehub.com/v1/webhooks \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'X-Mayotte-Signature: v1=<64 lowercase hex characters>' \ --header 'X-Mayotte-Timestamp: 1762862400' \ --data '{ "id": "evt_8f2c1a", "type": "booking.created", "created_at": "2026-11-11T12:00:00Z", "data": {} }'One event per call, signed with your key’s signing secret: X-Mayotte-Signature is v1= and the lowercase
hex HMAC-SHA256 of <timestamp>.<body>, the body exactly as sent. Each event is kept once per key and id.
Needs the webhooks scope.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”The time you signed, in Unix seconds. Within 5 minutes of our clock.
v1= and 64 lowercase hex characters. Two, separated by a comma, while you change secrets.
Your event’s id, when the body has no id.
Request Bodyrequired
Section titled “Request Bodyrequired”object
Your event’s own id. The same each time you send it again.
What happened.
When it happened in your system.
Depends on the type; its fields are agreed with Mayotte Hub.
object
Responses
Section titled “Responses”The event is kept (or was already kept, then duplicate is true).
object
True when this key already sent an event with this id.
Example
{ "ok": true}The body is not a JSON object (bad_json) or has no valid id or type (bad_event).
object
Words for a person. They may change.
What your program should read.
Example
{ "code": "bad_json"}No key (no_key), a key that is not valid (bad_key), revoked (revoked) or ended (expired); for an event
also a missing or old time (no_timestamp, old_timestamp) or a missing or wrong signature (no_signature,
bad_signature).
object
Words for a person. They may change.
What your program should read.
Example
{ "code": "bad_json"}The key may not do this (scope), or the call came from an address it does not allow (ip).
object
Words for a person. They may change.
What your program should read.
Example
{ "code": "bad_json"}The body is over 1 MB (too_large).
object
Words for a person. They may change.
What your program should read.
Example
{ "code": "bad_json"}Too many calls (rate). Wait for the retry-after header, in seconds.
object
Words for a person. They may change.
What your program should read.
Example
{ "code": "bad_json"}