Skip to main content
Documentation for version v74

Action Hook Message Structure

General hook message structure for all event types:

ParameterTypeExampleDescription
event_typestring"click"Event name from the events table
event_datestring"2018-03-04T13:13:19.034315796Z"Event timestamp in RFC 3339 format
profile_idstring"abcdefgh12345678"Profile ID of the recipient
_xxhstring"ad1850e0d1d9481e"Email XXHash used for profile identification in Altcraft
_md5string"145bb30f7ddf1184cb560bc4b7705646"MD5 hash of the subscriber's email
list_idint111Database ID in which the event occurred
account_idint23Account ID under which the event occurred
sends_trying_numint2Number of message sending attempts (present only if the number of attempts is greater than 0)
is_testboolfalseIndicates whether the event was triggered by test sending
is_staticboolfalseWhether dynamic substitutions were used in the message content
subscription_hash_idstring"0a4b910312345"Subscription hash
custom_dataJSON object{"alice@example.org"}Custom data set defined in the action hook settings interface
event_dataJSON object{"browser": "Firefox"}Event-specific data (can be tracking or delivery event data)
subscriptionarray
[
  {
    "resource_id": 123,
    "channel": "email",
    "email": "user@example.com",
    "phone": "+79991234567",
    "subscription_id": "abc123",
    "provider": "androidfirebase",
    "priority": 1,
    "status": "subscribed",
    "ccsub": {
      "custom_key": "custom_value"
    }
  }
]
An array with subscription details including information about the resource, communication channel, recipient, and subscription status. The structure is described below.
Note

When exporting historical events, message content is not transferred. Events are sent in the same format as in real time, and null is passed for deleted profiles.

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.
ParameterTypeExampleDescription
message_idint17Message template ID in Altcraft
campaign_idint973Campaign ID
scampaign_idint973Campaign ID in Altcraft system
segment_idint0Segment ID if available
resource_idint3Resource ID
ipstring"10.9.0.14"Subscriber's IPv4 address
countrystring".us"
".ru"
Country top-level domain
citystring"New York"
"Moscow"
Subscriber's city
postal_codestring"101000"Postal code
regionstring"Ohio"
"Moskovskaya oblast"
Region
tzstring"Europe/Vaduz"Time zone
latfloat55.244075Latitude
lonfloat55.244075Longitude
user_agentstring"Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0"User-Agent string
osstring"Linux x86_64"Operating system
browserstring"Firefox"Browser and version
devicestring"web"Device
link_urlstring"http://www.example.com"Redirect link
launch_idstring"00000017000003cd5a9bf01a"Campaign launch ID
send_message_idstring"5a9bf01a17_3cd_11_6f_0_2.5a8c045fc1dde44cbf718f78"SendMessageID
full_message_idstring"fQIQs4FgAAEBIcARAxDxAQAAEJECFQADuZJygDTgWXpQ_BVrkejVzu2bsMzQ3NDkxODlKR8-gA"Full SendMessageID
email_message_idstring"mzi5c1~+9vqekqmy63mh8xhgt2qjwfkad6lmiafbyn-0te1_uzckfqyi4ry"Email-safe SendMessageID (email events only)
extra_uidstring"ew4Sgf41Qwjq8_2_2E_w_k___t.2SDvJv8bvBYQFtSDx_7bTV2f.2_2E_4Sgf41DXc7Z_D"Extra UID (for push events only)
providerstring"YandexAppMetricaDeviceIDAndroid"Provider
prev_stint1Group identifier: 1 - test group, 2 - control group

Messaging events

For event types:

  • send, deliv, suppress, complain,
  • send_sms, deliv_sms,
  • send_push, deliv_push.
ParameterTypeExampleDescription
message_idint17Message template ID in Altcraft
campaign_idint973Campaign ID
segment_idint0Segment ID if available
resource_idint3Resource ID in Altcraft
launch_idstring"00000017000003cd5a9bf01a"Launch ID
send_message_idstring"5a9bf01a17_3cd_11_6f_0_2.5a8c045fc1dde44cbf718f78"SendMessageID
full_message_idstring"fQIQs4FgAAEBIcARAxDxAQAAEJECFQADuZJygDTgWXpQ_BVrkejVzu2bsMzQ3NDkxODlKR8-gA"Full SendMessageID
email_message_idstring"mzi5c1~+9vqekqmy63mh8xhgt2qjwfkad6lmiafbyn-0te1_uzckfqyi4ry"Email-safe SendMessageID (email events only)
extra_uidstring"ew4Sgf41Qwjq8_2_2E_w_k___t.2SDvJv8bvBYQFtSDx_7bTV2f.2_2E_4Sgf41DXc7Z_D"Extra UID (for push events only)
providerstring"YandexAppMetricaDeviceIDAndroid"Provider

For events sbounce, hbounce, sbounce_push, hbounce_push:

ParameterTypeExampleDescription
bounce_codeint500Server response code
bounce_messagestring"No such email"Server response message

For undeliv, undeliv_sms, undeliv_push events:

ParameterTypeExampleDescription
undeliv_codeint400Error code
undeliv_messagestring"Invalid Caller ID"Error message

Pixel events

For pixel_open events:

ParameterTypeExampleDescription
ipstring"10.9.0.14"Subscriber's IPv4 address
countrystring".ru"Country top-level domain
citystring"Moscow"City
pixel_idint41Pixel ID
postal_codestring"390000"Postal code
regionstring"Ryazanskaya oblast"Region
tzstring"Europe/Vaduz"Time zone
latfloat55.244075Latitude
lonfloat55.244075Longitude
user_agentstring"Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0"User-Agent string
osstring"Linux x86_64"Operating system
browserstring"Firefox"Browser and version
devicestring"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:

ParameterTypeExampleDescription
popup_idint123Popup ID
refererstring"api.example.com"HTTP Referer header
smidstring"fGmXiWU9Y4NSIpCwl4QQQQEQEAABCRA"Sent message identifier
utm_campaignstring"utm_campaign"UTM campaign tag
utm_contentstring"utm_content"UTM content tag
utm_sourcestring"utm_source"UTM source tag

Some events include unique parameters:

ParameterTypeExampleDescription
popup_post
post_uidstring"7bc142b5-7f38-4272-bc7e-7539f70b25b1"Unique form submission ID
popup_click
namestring"main_block"Name of the clicked element
urlstring"example.com/page"href attribute value of the clicked element
popup_error, popup_bounce
errorstring"object_not_found"Error text
error_categoryint404Error code

Promocode events

For promocode_attach, promocode_detach, promocode_activate events:

ParameterTypeExampleDescription
attachedstring"2020-10-25T13:28:52Z"Date and time the promocode was attached
detachedstring"2020-10-25T13:28:52Z"Date and time the promocode was detached
activatedstring"2020-10-25T13:28:52Z"Date and time the promocode was activated
codestring"TEST-XOUH-KBJM-J5K9-24I1"Promocode
db_idint123456Profile database ID
loyalty_idint9Loyalty program ID
profile_idstring"000000000000000000000000"Profile ID

All timestamps are in RFC 3339 format.

Segment events

For segs_add and segs_remove events:

ParameterTypeExampleDescription
campaign_idint9Campaign ID
launch_idstring""Launch ID
message_idint0Message template ID
segment_idint80Segment ID
send_message_idstring""Sent message ID
full_message_idstring"fQIQs4FgAAEBIcARAxDxAQAAEJECFQADuZJygDTgWXpQ_BVrkejVzu2bsMzQ3NDkxODlKR8-gA"Full SendMessageID

Profile merge and split events

For profile_merge and profile_split events:

ParameterTypeExampleDescription
destinationarray
[
   {
      "custom_data": {
         "age": 25
      },
      "db_id": 94,
      "profile_id": "608a8960e3224a6be26a71df"
   }
]
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.
sourcearray
[
   {
      "custom_data": {
         "age": 25
      },
      "db_id": 94,
      "profile_id": "608a8960e3224a6be26a71df"
   }
]
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
ParameterTypeExampleDescription
campaign_idint9Campaign ID
launch_idstring""Launch ID
message_idint0Message ID
resource_idint3Resource ID
segment_idint80Segment ID
send_message_idstring""Sent message ID
full_message_idstring"fQIQs4FgAAEBIcARAxDxAQAAEJECFQADuZJygDTgWXpQ_BVrkejVzu2bsMzQ3NDkxODlKR8-gA"Full SendMessageID
citystring"Moscow"City
browserstring"Firefox"Browser
countrystring".ru"Country TLD
devicestring"web"Device
ipstring"10.9.0.14"IPv4 address
latfloat55.244075Latitude
link_urlstring"http://www.example.com"Redirect link
lonfloat55.244075Longitude
osstring"Linux x86_64"Operating system
postal_codestring"390000"Postal code
regionstring"Ryazanskaya oblast"Region
tzstring"Europe/Vaduz"Time zone
undeliv_codeint500Undelivery error code
undeliv_messagestring"Content is required"Error message

Campaign error events

For camp_error events:

ParameterTypeExampleDescription
campaign_idint9Campaign ID
error_codeint500Error code
error_textstring"LOG_INTERNAL_ERROR"Error message
launch_idstring""Launch ID
message_idint0Message template ID
resource_idint3Resource ID
segment_idint80Segment ID
send_message_idstring""Sent message ID
full_message_idstring"fQIQs4FgAAEBIcARAxDxAQAAEJECFQADuZJygDTgWXpQ_BVrkejVzu2bsMzQ3NDkxODlKR8-gA"Full SendMessageID

campaign_launch structure

General campaign_launch structure:

ParameterTypeExampleDescription
event_typestring"campaign_launch"Event type
event_datestring"2018-03-25T13:13:19.034315796Z"Timestamp in RFC 3339 format
account_idint23Platform account ID
is_testboolfalseIndicates test launch
event_dataJSON object{}Object with campaign metadata

Campaign launch event_data structure

ParameterTypeExampleDescription
campaign_idint42Campaign ID
campaign_typestring"broadcast"Campaign type
campaign_namestring"name"Campaign name
campaign_sub_idstring"x11"Campaign sub ID
data_typestring"segment"Audience source type
data_idint3Audience source ID
launch_idstring"00000017000003cd5a9bf01a"Launch ID
contentJSON 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:

ParameterTypeExampleDescription
Common for all channels
resource_idint12Resource ID
channelstring"email"Communication channel
priorityint0Subscription priority
statusstring"subscribed"Subscription status
For email channel
emailstring"john@example.com"Subscriber's email
For SMS channel
post_uidstring"+79991112233"Subscriber's phone
For push channel
providerstring"YandexAppMetricaDeviceIDAndroid"Push provider
subscription_idstring"123ab667960efec47b1afe64b56bfa386a3"Provider subscription ID

Message content structure

If the "Add messages content" option is enabled in the webhook settings, the general message structure will include a content field.

tip

Links to web versions are always passed with the hook, regardless of whether the option is enabled or not. The only exception is campaign_launch, since it has no web versions.

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"
}
}
ParameterTypeExampleDescription
ampstring<html amp4email></html>AMP version of the email
from_emailstring"no-reply@altcraft.com"Sender's email
from_namestring"Altcraft"Sender's name
htmlstring<html></html>HTML version of the email
replyto_emailstring"example@example.com"Reply-to email address
replyto_namestring"Altcraft"Reply-to name
subjectstring"Weather alert"Email subject
textstring"Text version is important..."Text version of the email
to_emailstring"profile@example.com"Recipient's email
to_namestring"Fname Lname"Recipient's name
webversion_email_htmlstringhttp://click.altkraft.comWeb version HTML link
webversion_email_textstringhttp://click.altkraft.comWeb 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"
}
}
ParameterTypeExampleDescription
fromnamesmsstring"abcdefghijklmnqrstuvwxyz"Caller ID
smsstring"Follow the link and claim your bonus!"Message body
webversion_sms_textstringhttp://click.altkraft.comWeb 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,
"soundless": true,
"actions": [
{
"label": "Open",
"action": "https://example.com"
}
]
},
"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"
}
}
ParameterTypeDescription
bodystringPush message body
click_urlstringClick-through URL
custom_push_jsonJSON objectCustom JSON block for push
iconstringPush icon path
titlestringPush title
result_contentJSON objectStructure sent to the push service
webversion_push_bodystringWeb version of the push message
app_push_settingsJSON objectMobile push advanced settings
web_push_settingsJSON objectBrowser push advanced settings

app_push_settings structure

ParameterTypeExampleDescription
background_colorstring#00CED1Push background color
badgesint0Badge indicator
bannerstringhttp://example.com/path.imgPath to banner image
critical_pushboolfalseCritical mode flag
deliver_priorint0,1Delivery priority
expir_timeint604800Push TTL in seconds
ledstring#00CED2LED indicator color
mediastringhttp://example.com/pathPath to local media file
silent_pushboolfalseSilent push flag
soundstring/sound/sound.mp3Path to local sound file
subtitlestring"Just for you!"Message subtitle (iOS)
vibrobooltrueVibration on push
soundlessbooltrueSpecifies whether the push message will be accompanied by sound (used by providers: android firebase, android huawei, android rustore)
actionsarray
[
   {
  "label": "Open",
  "action": "https://example.com"
}
]
Buttons in push notifications

web_push_settings structure

ParameterTypeExampleDescription
actionsJSON object[]Push buttons (action + label)
button_labelstring"Sure"Button label (Safari only)
large_imagestring"https://altkraft.com/284834790/1/664c6da207767c769a/image.png"Banner image path
expir_timestring604800Push TTL in seconds
large_imagestring"https://click.example.com"Path to local banner image
info

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.