Create webhook
curl --request POST \
--url https://api.moonemail.co/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"endpoint": "<string>",
"events": []
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({endpoint: '<string>', events: []})
};
fetch('https://api.moonemail.co/webhooks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.moonemail.co/webhooks"
payload = {
"endpoint": "<string>",
"events": []
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"object": "webhook",
"id": "<string>",
"signing_secret": "<string>"
}{
"statusCode": 123,
"name": "<string>",
"message": "<string>"
}Webhooks
Create webhook
Create an event destination. Returns a signing secret once: store it securely, never include it in reports.
Required permission: webhooks:write.
POST
/
webhooks
Create webhook
curl --request POST \
--url https://api.moonemail.co/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"endpoint": "<string>",
"events": []
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({endpoint: '<string>', events: []})
};
fetch('https://api.moonemail.co/webhooks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.moonemail.co/webhooks"
payload = {
"endpoint": "<string>",
"events": []
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"object": "webhook",
"id": "<string>",
"signing_secret": "<string>"
}{
"statusCode": 123,
"name": "<string>",
"message": "<string>"
}Authorizations
Moonemail API key; x-required-scope applies.
Body
application/json
Maximum string length:
2048Minimum array length:
1Available options:
email.sent, email.delivered, email.delivery_delayed, email.complained, email.bounced, email.opened, email.clicked, email.failed, email.received, email.receiving_quarantined, email.scheduled, email.canceled, email.suppressed