Execute Custom Action
curl --request POST \
--url https://api.your-domain.com/example/zaymo/custom-action \
--header 'Content-Type: application/json' \
--header 'X-Zaymo-API-Key: <api-key>' \
--data '
{
"email": "customer@example.com",
"action_id": "claim_discount_10off"
}
'import requests
url = "https://api.your-domain.com/example/zaymo/custom-action"
payload = {
"email": "customer@example.com",
"action_id": "claim_discount_10off"
}
headers = {
"X-Zaymo-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Zaymo-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({email: 'customer@example.com', action_id: 'claim_discount_10off'})
};
fetch('https://api.your-domain.com/example/zaymo/custom-action', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"success": true
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>"
}
}Custom Actions
Execute Custom Action
Execute a custom action when a customer clicks a custom button in email. Receives the customer’s email and the action ID to process any custom business logic.
POST
/
zaymo
/
custom-action
Execute Custom Action
curl --request POST \
--url https://api.your-domain.com/example/zaymo/custom-action \
--header 'Content-Type: application/json' \
--header 'X-Zaymo-API-Key: <api-key>' \
--data '
{
"email": "customer@example.com",
"action_id": "claim_discount_10off"
}
'import requests
url = "https://api.your-domain.com/example/zaymo/custom-action"
payload = {
"email": "customer@example.com",
"action_id": "claim_discount_10off"
}
headers = {
"X-Zaymo-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Zaymo-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({email: 'customer@example.com', action_id: 'claim_discount_10off'})
};
fetch('https://api.your-domain.com/example/zaymo/custom-action', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"success": true
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>"
}
}Authorizations
Zaymo will authenticate requests using the API key you provide
Body
application/json
Custom action request with customer email and action identifier
The email address of the customer who clicked the button
Example:
"customer@example.com"
Unique identifier for the specific action that was triggered. You can use any action_id that makes sense for your business. Example action_ids: 'claim_discount_10off', 'join_waitlist_product_123', 'change_to_quarterly', 'register_webinar_march'
Example:
"claim_discount_10off"
Response
Custom action executed successfully
Indicates if the custom action was executed successfully
Example:
true
Was this page helpful?