Action Hook Message Structure
General hook message structure for all event types:
Parameter | Type | Example | Description |
---|---|---|---|
event_type | string | "click" | Event name from the events table |
event_date | string | "2018-03-04T13:13:19.034315796Z" | Event timestamp in RFC 3339 format |
profile_id | string | "abcdefgh12345678" | Profile ID of the recipient |
_xxh | string | "ad1850e0d1d9481e" | Email XXHash used for profile identification in Altcraft |
_md5 | string | "145bb30f7ddf1184cb560bc4b7705646" | MD5 hash of the subscriber’s email |
list_id | int | 111 | Database ID in which the event occurred |
account_id | int | 23 | Account ID under which the event occurred |
sends_trying_num | int | 2 | Number of message sending attempts |
is_test | bool | false | Indicates whether the event was triggered by test sending |
is_static | bool | false | Whether dynamic substitutions were used in the message content |
subscription_hash_id | string | "0a4b910312345" | Subscription hash |
custom_data | JSON object | {"alice@example.org"} | Custom data set defined in the action hook settings interface |
event_data | JSON object | {"browser": "Firefox"} | Event-specific data (can be tracking or delivery event data) |
event_data structure
Tracking events
These event types are considered tracking events:
- uopen, open, uclick, click, confirm, confirmsub, unsub, read, glanced, skimmed,
- uclick_sms, click_sms, uclick_sms, unsub_sms,
- uopen_push, open_push, click_push, uclick_push.
Parameter | Type | Example | Description |
---|---|---|---|
message_id | int | 17 | Message template ID in Altcraft |
campaign_id | int | 973 | Campaign ID |
segment_id | int | 0 | Segment ID if available |
resource_id | int | 3 | Resource ID |
ip | string | "10.9.0.14" | Subscriber’s IPv4 address |
country | string | ".us" ".ru" | Country top-level domain |
city | string | "New York" "Moscow" | Subscriber’s city |
postal_code | string | "101000" | Postal code |
region | string | "Ohio" "Moskovskaya oblast" | Region |
tz | string | "Europe/Vaduz" | Time zone |
lat | float | 55.244075 | Latitude |
lon | float | 55.244075 | Longitude |
user_agent | string | "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" | User-Agent string |
os | string | "Linux x86_64" | Operating system |
browser | string | "Firefox" | Browser and version |
device | string | "web" | Device |
link_url | string | "http://www.example.com" | Redirect link |
launch_id | string | "00000017000003cd5a9bf01a" | Campaign launch ID |
send_message_id | string | "5a9bf01a17_3cd_11_6f_0_2.5a8c045fc1dde44cbf718f78" | SendMessageID |
full_message_id | string | "fQIQs4FgAAEBIcARAxDxAQAAEJECFQADuZJygDTgWXpQ_BVrkejVzu2bsMzQ3NDkxODlKR8-gA" | Full SendMessageID |
email_message_id | string | "mzi5c1~+9vqekqmy63mh8xhgt2qjwfkad6lmiafbyn-0te1_uzckfqyi4ry" | Email-safe SendMessageID (email events only) |
extra_uid | string | "ew4Sgf41Qwjq8_2_2E_w_k___t.2SDvJv8bvBYQFtSDx_7bTV2f.2_2E_4Sgf41DXc7Z_D" | Extra UID (for push events only) |
Messaging events
For event types:
- send, deliv, suppress, complain,
- send_sms, deliv_sms,
- send_push, deliv_push.
Parameter | Type | Example | Description |
---|---|---|---|
message_id | int | 17 | Message template ID in Altcraft |
campaign_id | int | 973 | Campaign ID |
segment_id | int | 0 | Segment ID if available |
resource_id | int | 3 | Resource ID in Altcraft |
launch_id | string | "00000017000003cd5a9bf01a" | Launch ID |
send_message_id | string | "5a9bf01a17_3cd_11_6f_0_2.5a8c045fc1dde44cbf718f78" | SendMessageID |
full_message_id | string | "fQIQs4FgAAEBIcARAxDxAQAAEJECFQADuZJygDTgWXpQ_BVrkejVzu2bsMzQ3NDkxODlKR8-gA" | Full SendMessageID |
email_message_id | string | "mzi5c1~+9vqekqmy63mh8xhgt2qjwfkad6lmiafbyn-0te1_uzckfqyi4ry" | Email-safe SendMessageID (email events only) |
extra_uid | string | "ew4Sgf41Qwjq8_2_2E_w_k___t.2SDvJv8bvBYQFtSDx_7bTV2f.2_2E_4Sgf41DXc7Z_D" | Extra UID (for push events only) |
For events sbounce, hbounce, sbounce_push, hbounce_push:
Parameter | Type | Example | Description |
---|---|---|---|
bounce_code | int | 500 | Server response code |
bounce_message | string | "No such email" | Server response message |
For undeliv, undeliv_sms events:
Parameter | Type | Example | Description |
---|---|---|---|
undeliv_code | int | 400 | Error code |
undeliv_message | string | "Invalid Caller ID" | Error message |
Pixel events
For pixel_open events:
Parameter | Type | Example | Description |
---|---|---|---|
ip | string | "10.9.0.14" | Subscriber’s IPv4 address |
country | string | ".ru" | Country top-level domain |
city | string | "Moscow" | City |
pixel_id | int | 41 | Pixel ID |
postal_code | string | "390000" | Postal code |
region | string | "Ryazanskaya oblast" | Region |
tz | string | "Europe/Vaduz" | Time zone |
lat | float | 55.244075 | Latitude |
lon | float | 55.244075 | Longitude |
user_agent | string | "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" | User-Agent string |
os | string | "Linux x86_64" | Operating system |
browser | string | "Firefox" | Browser and version |
device | string | "web" | Device |
The full list of possible parameters is available in this article.
Popup events
For the following event types: popup_post, popup_click, popup_error, popup_bounce, popup_close, popup_open:
Parameter | Type | Example | Description |
---|---|---|---|
popup_id | int | 123 | Popup ID |
referer | string | "api.example.com" | HTTP Referer header |
smid | string | "fGmXiWU9Y4NSIpCwl4QQQQEQEAABCRA" | Sent message identifier |
utm_campaign | string | "utm_campaign" | UTM campaign tag |
utm_content | string | "utm_content" | UTM content tag |
utm_source | string | "utm_source" | UTM source tag |
Some events include unique parameters:
Parameter | Type | Example | Description |
popup_post | |||
post_uid | string | "7bc142b5-7f38-4272-bc7e-7539f70b25b1" | Unique form submission ID |
popup_click | |||
name | string | "main_block" | Name of the clicked element |
url | string | "example.com/page" | href attribute value of the clicked element |
popup_error, popup_bounce | |||
error | string | "object_not_found" | Error text |
error_category | int | 404 | Error code |
Promocode events
For promocode_attach, promocode_detach, promocode_activate events:
Parameter | Type | Example | Description |
---|---|---|---|
attached | string | "2020-10-25T13:28:52Z" | Date and time the promocode was attached |
detached | string | "2020-10-25T13:28:52Z" | Date and time the promocode was detached |
activated | string | "2020-10-25T13:28:52Z" | Date and time the promocode was activated |
code | string | "TEST-XOUH-KBJM-J5K9-24I1" | Promocode |
db_id | int | 123456 | Profile database ID |
loyalty_id | int | 9 | Loyalty program ID |
profile_id | string | "000000000000000000000000" | Profile ID |
All timestamps are in RFC 3339 format.
Segment events
For segs_add and segs_remove events:
Parameter | Type | Example | Description |
---|---|---|---|
campaign_id | int | 9 | Campaign ID |
launch_id | string | "" | Launch ID |
message_id | int | 0 | Message template ID |
segment_id | int | 80 | Segment ID |
send_message_id | string | "" | Sent message ID |
full_message_id | string | "fQIQs4FgAAEBIcARAxDxAQAAEJECFQADuZJygDTgWXpQ_BVrkejVzu2bsMzQ3NDkxODlKR8-gA" | Full SendMessageID |
Profile merge and split events
For profile_merge and profile_split events:
Parameter | Type | Example | Description |
---|---|---|---|
destination | array | [ | If profile merging occurs, this contains the profile matching data resulting from the merge. If profile splitting occurs, this contains the profile matching data resulting from the split. |
source | array | [ | When profiles are merged, this contains the matching data of the profiles to be merged. When a profile is split, this contains the matching data of the profile to be split. |
Channel events
Supported channels:
- Telegram:
telegram_bot_send
,telegram_bot_deliv
,telegram_bot_click
,telegram_bot_uclick
,telegram_bot_undeliv
,telegram_group_send
,telegram_group_deliv
,telegram_group_click
,telegram_group_undeliv
- WhatsApp*:
whatsapp_deliv
,whatsapp_undeliv
,whatsapp_send
,whatsapp_click
,whatsapp_uclick
,whatsapp_subscribe
,whatsapp_read
,whatsapp_unsub
- Viber*:
viber_deliv
,viber_undeliv
,viber_send
,viber_click
,viber_uclick
,viber_subscribe
,viber_read
,viber_unsub
,viber_complain
- Notify:
notify_deliv
,notify_undeliv
,notify_send
,notify_click
,notify_uclick
,notify_subscribe
,notify_read
,notify_unsub
,notify_complain
Parameter | Type | Example | Description |
---|---|---|---|
campaign_id | int | 9 | Campaign ID |
launch_id | string | "" | Launch ID |
message_id | int | 0 | Message ID |
resource_id | int | 3 | Resource ID |
segment_id | int | 80 | Segment ID |
send_message_id | string | "" | Sent message ID |
full_message_id | string | "fQIQs4FgAAEBIcARAxDxAQAAEJECFQADuZJygDTgWXpQ_BVrkejVzu2bsMzQ3NDkxODlKR8-gA" | Full SendMessageID |
city | string | "Moscow" | City |
browser | string | "Firefox" | Browser |
country | string | ".ru" | Country TLD |
device | string | "web" | Device |
ip | string | "10.9.0.14" | IPv4 address |
lat | float | 55.244075 | Latitude |
link_url | string | "http://www.example.com" | Redirect link |
lon | float | 55.244075 | Longitude |
os | string | "Linux x86_64" | Operating system |
postal_code | string | "390000" | Postal code |
region | string | "Ryazanskaya oblast" | Region |
tz | string | "Europe/Vaduz" | Time zone |
undeliv_code | int | 500 | Undelivery error code |
undeliv_message | string | "Content is required" | Error message |
Campaign error events
For camp_error events:
Parameter | Type | Example | Description |
---|---|---|---|
campaign_id | int | 9 | Campaign ID |
error_code | int | 500 | Error code |
error_text | string | "LOG_INTERNAL_ERROR" | Error message |
launch_id | string | "" | Launch ID |
message_id | int | 0 | Message template ID |
resource_id | int | 3 | Resource ID |
segment_id | int | 80 | Segment ID |
send_message_id | string | "" | Sent message ID |
full_message_id | string | "fQIQs4FgAAEBIcARAxDxAQAAEJECFQADuZJygDTgWXpQ_BVrkejVzu2bsMzQ3NDkxODlKR8-gA" | Full SendMessageID |
campaign_launch structure
General campaign_launch structure:
Parameter | Type | Example | Description |
---|---|---|---|
event_type | string | "campaign_launch" | Event type |
event_date | string | "2018-03-25T13:13:19.034315796Z" | Timestamp in RFC 3339 format |
account_id | int | 23 | Platform account ID |
is_test | bool | false | Indicates test launch |
event_data | JSON object | {} | Object with campaign metadata |
Campaign launch event_data structure
Parameter | Type | Example | Description |
---|---|---|---|
campaign_id | int | 42 | Campaign ID |
campaign_type | string | "broadcast" | Campaign type |
campaign_name | string | "name" | Campaign name |
campaign_sub_id | string | "x11" | Campaign sub ID |
data_type | string | "segment" | Audience source type |
data_id | int | 3 | Audience source ID |
launch_id | string | "00000017000003cd5a9bf01a" | Launch ID |
content | JSON object | {} | Message template metadata |
Campaign launch event example
{
"event_type": "campaign_launch",
"event_date": "2016-12-09T10:11:24.934079204Z",
"is_test": false,
"account_id": 161,
"event_data": {
"campaign_id": 1472,
"campaign_type": "broadcast",
"campaign_name": "Campaugn Launch Hook",
"campaign_sub_id": "x11",
"data_type": "segment",
"data_id": 1221,
"launch_id": "000000a1000005c0584a834c",
"content": [
{
"message_name": "Hello",
"message_id": 1412,
"suppress_id": 271,
"replyto_email": "",
"replyto_name": "",
"text": "текстовая версия письма",
"html": "<html> html версия письма </html>",
"from_name": "",
"from_email": "",
"attach_links": [],
"subject": "Hello, {your_name}!"
},
{
"message_name": "Hi",
"message_id": 1413,
"suppress_id": 272,
"replyto_email": "monty@altcraft.com",
"replyto_name": "Monty",
"text": "текстовая версия письма",
"html": "<html> html версия письма </html>",
"from_name": "",
"from_email": "",
"attach_links": [
{
"name": "text_file.txt",
"url": "http://test.altcraft.com/api/attach/link/text_file.txt?token=eyJh..."
},
{
"name": "picture_file.png",
"url": "http://test.altcraft.com/api/attach/link/picture_file.png?token=eyJh..."
}
],
"subject": "Hi, {your_name}!"
}
]
}
}
Subscription structure
This object contains subscription metadata for the resource used to deliver the message:
Parameter | Type | Example | Description |
---|---|---|---|
resource_id | int | 12 | Resource ID |
channel | string | "email" | Communication channel |
priority | int | 0 | Subscription priority |
status | string | "subscribed" | Subscription status |
string | "john@example.com" | Subscriber’s email (email only) | |
post_uid | string | "+79991112233" | Subscriber’s phone (SMS only) |
provider | string | "YandexAppMetricaDeviceIDAndroid" | Push provider (push only) |
subscription_id | string | "123ab667960efec47b1afe64b56bfa386a3" | Provider subscription ID (push) |
Message content structure
If the "Add messages content" option is enabled in the webhook settings, the general message structure will include a content
field.
Email
{
"content": {
"amp": "<html amp4email></html>",
"from_email": "no-reply@altcraft.com",
"from_name": "Altcraft",
"html": "<html></html>",
"replyto_email": "example@example.com",
"replyto_name": "Altcraft",
"subject": "Weather alert",
"text": "Text version",
"to_email": "profile@example.com",
"to_name": "Fname Lname",
"webversion_email_html": "http://click.altkraft.com/0000/path.html",
"webversion_email_text": "http://click.altkraft.com/0000/path.txt"
}
}
Parameter | Type | Example | Description |
---|---|---|---|
amp | string | <html amp4email></html> | AMP version of the email |
from_email | string | "no-reply@altcraft.com" | Sender’s email |
from_name | string | "Altcraft" | Sender’s name |
html | string | <html></html> | HTML version of the email |
replyto_email | string | "example@example.com" | Reply-to email address |
replyto_name | string | "Altcraft" | Reply-to name |
subject | string | "Weather alert" | Email subject |
text | string | "Text version is important..." | Text version of the email |
to_email | string | "profile@example.com" | Recipient’s email |
to_name | string | "Fname Lname" | Recipient’s name |
webversion_email_html | string | http://click.altkraft.com | Web version HTML link |
webversion_email_text | string | http://click.altkraft.com | Web version text link |
SMS
{
"content": {
"fromnamesms": "abcdefghijklmnqrstuvwxyz",
"sms": "Hello, Aaron! See the new items for you: http://click.altkraft.com/s/path",
"webversion_sms_text": "http://click.altkraft.com/000000/path.txt"
}
}
Parameter | Type | Example | Description |
---|---|---|---|
fromnamesms | string | "abcdefghijklmnqrstuvwxyz" | Caller ID |
sms | string | "Follow the link and claim your bonus!" | Message body |
webversion_sms_text | string | http://click.altkraft.com | Web version of the message |
Push
{
"content": {
"app_push_settings": {
"background_color": "#00CED1",
"badges": 0,
"banner": "",
"critical_push": false,
"deliver_prior": 0,
"expir_time": 604800,
"led": "",
"media": "",
"silent_push": false,
"sound": "",
"subtitle": "",
"vibro": false
},
"body": "See if our new items are fit to make you even more awesome!",
"click_url": "https://click.altkraft.com/0000000",
"custom_push_json": {},
"icon": "",
"result_content": {
"content_available": true,
"data": {
"hub_link": {
"ack": "https://pxl.altkraft.com/crypto_post_events?/bFOoNcxW7lpDA",
"open": "https://pxl.altkraft.com/crypto_post_events?/LbFOoNcxW7lpDA"
},
"image": "",
"launch_id": "2_3J_4Z2ZTRaQr7p",
"mediaUrl": "",
"message": "See if our new items are fit to make you even more awesome!",
"uid": "fATFSGbgLjinkRE59ZXDOSd0BcAABARnhIxDBBAAAEbAQowRH"
},
"mutable_content": true,
"notification": {
"body": "See if our new items are fit to make you even more awesome!",
"click_action": "https://click.altkraft.com/0000000/abcdefghijklmnqrstuvwxyz",
"color": "",
"icon": "",
"sound": "default"
},
"title": "Just look, Alex! These are awesome!",
"priority": "normal",
"time_to_live": 604800,
"to": "5dbDUxVXHV"
},
"title": "Just look, Alex! These are awesome!",
"webversion_push_body": "http://click.altkraft.com/000000/path.txt"
}
}
Parameter | Type | Description |
---|---|---|
body | string | Push message body |
click_url | string | Click-through URL |
custom_push_json | JSON object | Custom JSON block for push |
icon | string | Push icon path |
title | string | Push title |
result_content | JSON object | Structure sent to the push service |
webversion_push_body | string | Web version of the push message |
app_push_settings | JSON object | Mobile push advanced settings |
web_push_settings | JSON object | Browser push advanced settings |
app_push_settings structure
Parameter | Type | Example | Description |
---|---|---|---|
background_color | string | #00CED1 | Push background color |
badges | int | 0 | Badge indicator |
banner | string | http://example.com/path.img | Path to banner image |
critical_push | bool | false | Critical mode flag |
deliver_prior | int | 0,1 | Delivery priority |
expir_time | int | 604800 | Push TTL in seconds |
led | string | #00CED2 | LED indicator color |
media | string | http://example.com/path | Path to local media file |
silent_push | bool | false | Silent push flag |
sound | string | /sound/sound.mp3 | Path to local sound file |
subtitle | string | "Just for you!" | Message subtitle (iOS) |
vibro | bool | true | Vibration on push |
web_push_settings structure
Parameter | Type | Example | Description |
---|---|---|---|
actions | JSON object | [] | Push buttons (action + label) |
button_label | string | "Sure" | Button label (Safari only) |
large_image | string | "https://altkraft.com/284834790/1/664c6da207767c769a/image.png" | Banner image path |
expir_time | string | 604800 | Push TTL in seconds |
large_image | string | "https://click.example.com" | Path to local banner image |
The webversion_link
field is included in the content
object only for send events in email, SMS, and push channels. For other events and for the send event in custom channels, webversion_link
will be an empty string:
"content": {
"webversion_link": ""
}
*Meta Platforms Inc., the company behind Instagram, Facebook, and WhatsApp, has been designated as an extremist organization and is banned in the Russian Federation.
**Viber is a trademark of Rakuten Group, Inc. and is blocked in the Russian Federation.