Email webhooks

The article provides information on various types of webhooks, including the list of parameters and examples in JSON format.

created

The user was added to our database.

event (string)  
user_id (int)  
project_id (int)  
reg_type  
event_id (int)  
ts (int)  
split_group(int)  
client_user_id (int)  
project (string)  
meta --optional (array)  
user --optional (array)  
email --optional (string)
{  
  "0": {  
    "event": "created",  
    "user_id": 899899,  
    "project_id": 99,  
    "reg_type": "sys_letter",  
    "event_id": 290290,  
    "meta": {  
      "relay": "domain.com",  
      "from_email": "[email protected]",  
      "sender_id": null,  
      "action_type": 32,  
      "project_id": 99,  
      "partner_id": "1832",  
      "receiver_id": 899891,  
      "mail_id": 2222229009,  
      "track_id": null,  
      "channel": "domain_channel.com",  
      "title_type": null,  
      "campaign": null,  
      "subject_id": 15,  
      "predict_id": null,  
      "split_group": null,  
      "login_partner": 15599,  
      "unsub_domain": "some.com",  
      "domain_content": "some.com"  
    },  
    "ts": 1549382627,  
    "split_group": null,  
    "client_user_id": "991",  
    "project": "SomeProject",  
    "email": "[email protected]",  
    "user": {  
      "id": 899899,  
      "project_id": 99,  
      "email": "[email protected]",  
      "name": "Some Name",  
      "language": "en",  
      "last_online": 0,  
      "last_mailed": 0,  
      "last_reaction": 0  
    }  
  }  
}
  • ts – time when the webhook was sent in Unix timestamp format;
  • reg_type – registration type. By default, it has the value "sys_letter";
  • split_group – identifier of the user's split group used for conducting split tests on the Sendios side;
  • meta – additional information from the client's side necessary for better metric analysis;
  • user – basic information about the user in JSON format.

sent

The emails were sent to the user.

🚧

If you received only the "sent" webhook, it means that the email was successfully sent to the user. If after the webhook "sent", you also received the webhook "lost", it means the email was not delivered to the user.

event (string)
mail_id (int)
user_id (int)
project_id (int)
mail_source_id (int)
server (string)
source_id (int)
template_id (int)
ts (int)
split_group(int)
project (string)
event_id --optional (int)
client_user_id --optional (int)
user --optional
campaign_id --optional (int)
type_id --optional (int)
category_id --optional (int)
email --optional (string)
{
  "0": {
     "event": "sent",
     "mail_id": 2222229009,
     "user_id": 899899,
     "project_id": 99,
     "server": "mail10",
     "event_id": 290290,
     "source_id": 4,
     "template_id": 3110,
     "ts": 1549382420,
     "split_group": 416,
     "client_user_id": null,
     "project": "SomeProject",
     "email": "[email protected]",
     "user": {
        "id": 899899,
        "project_id": 99,
        "email": "[email protected]",
        "name": "Some Name",
        "language": "en",
        "last_online": "1549248554",
        "last_mailed": "1549347648",
        "last_reaction": "1549071762"
     },
     "msg": {
        "mail_id": 2222229009,
        "category_id": "2",
        "source_id": 4,
        "type_id": 8,
        "type_sig": "message",
        "server": "mail10"
     },
     "meta": {
        "type_id": 8,
        "id_custom": null,
        "id_stat": 229009
     },
     "type_id": 8,
     "category_id": 2
  }
}
  • server – name of the mail server from which the email was sent;
  • ts – time when the webhook was sent in Unix timestamp format;
  • split_group – identifier of the user's split group used for conducting split tests on the Sendios side;
  • mail_source_id – the identifier of the logic through which the sending was performed (recommendation system);
  • user – basic information about the user in JSON format.

open

The user opened the email.

📘

This also includes re-openings of the email if more than 5 minutes have passed since the previous opening.

event (string)
user_id (int)
mail_id (int)
project_id (int)
mail_source_id (int)
source_id (int)
template_id (int)
ts (int)
split_group(int)
client_user_id (int)
project (string)
user --optional
campaign_id --optional (int)
type_id --optional (int)
category_id --optional (int)
email --optional (string)
{
  "0": {
     "event": "open",
     "user_id": 899899,
     "mail_id": 2222229009,
     "project_id": 99,
     "source_id": 4,
     "template_id": 3421,
     "ts": 1549382463,
     "split_group": 417,
     "client_user_id": null,
     "project": "SomeProject",
     "email": "[email protected]",
     "user": {
        "id": 899899,
        "project_id": 99,
        "email": "[email protected]",
        "name": "Some Name",
        "language": "en",
        "last_online": "1549382268",
        "last_mailed": "1549381895",
        "last_reaction": "1549382285"
     },
     "msg": {
        "mail_id": 2222229009,
        "category_id": "2",
        "source_id": 4,
        "type_id": 8,
        "type_sig": "favorite",
        "server": "mail10"
     },
     "meta": {
        "type_id": 8,
        "id_custom": null,
        "id_stat": 229009
     },
     "type_id": 8,
     "category_id": 2,
     "event_id": 290290
  }
}
  • ts – time when the webhook was sent in Unix timestamp format;
  • split_group – identifier of the user's split group used for conducting split tests on the Sendios side;
  • mail_source_id – the identifier of the logic through which the sending was performed (recommendation system);
  • user – basic information about the user in JSON format.

confirm

The first time the user clicked on any clickable element in the email template (link, logo, image, etc.).

event (string)
user_id (int)
project_id (int)
reg_type
event_id (int)
ts (int)
split_group(int)
client_user_id (int)
project (string)
meta --optional (array)
user --optional (array)
email --optional (string)
{  
   "0": {  
     "event": "confirm",  
     "user_id": 899899,  
     "mail_id": 2222229009,  
     "type_id": 8,  
     "project_id": 99,  
     "server": "mail10",  
     "source_id": 4,  
     "browser": "Firefox",  
     "template_id": 791,  
     "ts": 1549382688,  
     "split_group": 356,  
     "client_user_id": "991",  
     "project": "SomeProject",  
     "email": "[email protected]",  
     "user": {  
        "id": 899899,  
        "project_id": 99,  
        "email": "[email protected]",  
        "name": "Some Name",  
        "language": "en",  
        "last_online": "1549382688",  
        "last_mailed": "1549382680",  
        "last_reaction": "1549382688"  
     },  
     "msg": {  
        "mail_id": 2222229009,  
        "category_id": "1",  
        "source_id": 4,  
        "type_id": 8,  
        "type_sig": "welcome",  
        "server": "mail10"  
     },  
     "meta": \[],  
     "category_id": 1,  
     "event_id": 290290  
  }  
}
  • ts – time when the webhook was sent in Unix timestamp format;
  • reg_type – registration type. By default, it has the value "sys_letter";
  • split_group – identifier of the user's split group used for conducting split tests on the Sendios side;
  • meta – additional information from the client's side necessary for better metric analysis;
  • user – basic information about the user in JSON format.

click

The user clicked on any clickable element in the email template (link, logo, image, etc.).

📘

This includes repeated clicks if more than 5 minutes have passed since the previous clicking.

event (string)
user_id (int)
mail_id (int)
type_id (int)
project_id (int)
server (string)
mail_source_id (int)
source_id (int)
template_id (int)
ts (int)
split_group(int)
client_user_id (int)
project (string)
browser --optional
user --optional
campaign_id --optional (int)
type_id --optional (int)
category_id --optional (int)
email --optional (string)
{
  "0": {
     "event": "click",
     "user_id": 899899,
     "mail_id": 2222229009,
     "type_id": 8,
     "project_id": 99,
     "server": "mail10",
     "source_id": 4,
     "browser": "iPhone",
     "template_id": 3410,
     "ts": 1549382495,
     "split_group": 417,
     "client_user_id": null,
     "project": "SomeProject",
     "email": "[email protected]",
     "user": {
        "id": 899899,
        "project_id": 99,
        "email": "[email protected]",
        "name": "Some Name",
        "language": "en",
        "last_online": "1549382200",
        "last_mailed": "1549381199",
        "last_reaction": "1549382494"
     },
     "msg": {
        "mail_id": 2222229009,
        "category_id": "2",
        "source_id": 4,
        "type_id": 8,
        "type_sig": "visit",
        "server": "mail10"
     },
     "meta": {
        "type_id": 8,
        "id_custom": null,
        "id_stat": 229009
     },
     "category_id": 2,
     "event_id": 290290
  }
}
  • ts – time when the webhook was sent in Unix timestamp format;
  • split_group – identifier of the user's split group used for conducting split tests on the Sendios side;
  • redirect_link – link the user followed;
  • user – basic information about the user in JSON format.

reject

The email was rejected from sending.

event (string)
user_id (int)
project_id (int)
type_id (int)
reject_reason
ts (int)
split_group(int)
client_user_id (int)
project (string)
meta --optional
email --optional
event_id --optional (int)
source_id --optional (int)
template_id --optional (int)
error_message --optional
user --optional (array)
email --optional (string)
{
  "0": {
     "event": "reject",
     "user_id": 899899,
     "project_id": 99,
     "type_id": 8,
     "reject_reason": "often_duplicate",
     "meta": {
        "type_id": 8,
        "id_custom": null,
        "id_stat": 229009
     },
     "source_id": 4,
     "ts": 1549382344,
     "split_group": 358,
     "client_user_id": null,
     "project": "SomeProject",
     "email": "[email protected]",
     "user": {
        "id": 899899,
        "project_id": 99,
        "email": "[email protected]",
        "name": "Some Name",
        "language": "en",
        "last_online": "1549381819",
        "last_mailed": "1549382344",
        "last_reaction": "1549382339"
     }
  }
}
  • ts – time when the webhook was sent in Unix timestamp format;
  • split_group – identifier of the user's split group used for conducting split tests on the Sendios side;
  • meta – additional information from the client's side necessary for better metric analysis;
  • user – basic information about the user in JSON format.

lost

The email was sent but had not been delivered.

event (string)
user_id (int)
project_id (int)
type_id (int)
mail_id (int)
lost_reason (string)
lost_reason_id (int)
reject_reason (string)
reject_reason_id (int)
ts (int)
split_group(int)
client_user_id (int)
project (string)
source_id --optional (int)
template_id --optional (int)
email --optional (string)
event_id --optional (int)
{
  "0": {
    "event": "lost",
    "user_id": 1593206891,
    "project_id": 17125,
    "type_id": 2,
    "lost_reason": "User invalid",
    "lost_reason_id": 2,
    "reject_reason": "does_not_exist",
    "reject_reason_id": 550,
    "email": "[email protected]",
    "source_id": 0,
    "template_id": 42610,
    "event_id": 98929656070,
    "mail_id": 21727892269,
    "ts": 1661854585,
    "split_group": null,
    "client_user_id": null,
    "project": "SomeProject",
    "user": {
      "id": 1593206891,
      "project_id": 17125,
      "email": "[email protected]",
      "name": "Some Name",
      "language": "en",
      "last_online": "0",
      "last_mailed": "1661854225",
      "last_reaction": "0"
    },
    "msg": {
      "mail_id": "21727892269",
      "category_id": "1",
      "source_id": "0",
      "type_id": 2,
      "type_sig": "System_Mailtype",
      "server": "mail250"
    },
    "category_id": 1
  }
}
  • ts – time when the webhook was sent in Unix timestamp format;
  • split_group – identifier of the user's split group used for conducting split tests on the Sendios side.

unsub

The user unsubscribed from the already sent email.

event (string)
user_id (int)
mail_id (int)
project_id (int)
server (string)
unsub_source_id (int)
template_id (int)
ts (int)
split_group(int)
client_user_id (int)
project (string)
source_id --optional (int)
unsub_source --optional
user --optional
campaign_id --optional (int)
type_id --optional (int)
category_id --optional (int)
email --optional (string)
{
  "0": {
     "event": "unsub",
     "user_id": 899899,
     "mail_id": null,
     "project_id": 99,
     "server": "unknown",
     "unsub_source_id": 108,
     "source_id": false,
     "template_id": null,
     "ts": 1549382568,
     "split_group": 351,
     "client_user_id": "991",
     "project": "SomeProject",
     "unsub_source": "admin",
     "email": "[email protected]",
     "user": {
        "id": 899899,
        "project_id": 99,
        "email": "[email protected]",
        "name": "Some Name",
        "language": "en",
        "last_online": "1549382430",
        "last_mailed": "1549382475",
        "last_reaction": "1549380725"
     },
     "event_id": 290290
  }
}
  • ts – time when the webhook was sent in Unix timestamp format;
  • split_group – identifier of the user's split group used for conducting split tests on the Sendios side;
  • server – name of the mail server from which the email was sent;
  • user – basic information about the user in JSON format.

abuse

The user complained via the mail client.

event (string)
user_id (int)
mail_id (int)
project_id (int)
server (string)
result
template_id (int)
ts (int)
split_group(int)
client_user_id (int)
project (string)
mail_source_id --optional (int)
source_id --optional (int)
user --optional
campaign_id --optional (int)
type_id --optional (int)
category_id --optional (int)
email --optional (string)
{
  "0": {
     "event": "abuse",
     "user_id": 899899,
     "mail_id": 2222229009,
     "project_id": 99,
     "server": "mail10",
     "result": "already_unsub",
     "source_id": 4,
     "template_id": 2671,
     "ts": 1549382596,
     "split_group": 375,
     "client_user_id": "991",
     "project": "SomeProject",
     "email": "[email protected]",
     "user": {
        "id": 899899,
        "project_id": 99,
        "email": "[email protected]",
        "name": "Some Name",
        "language": "en",
        "last_online": "1549382579",
        "last_mailed": "1549372446",
        "last_reaction": "1548235847"
     },
     "msg": {
        "mail_id": 2222229009,
        "category_id": "2",
        "source_id": 4,
        "type_id": 8,
        "type_sig": "search_you_m",
        "server": "mail10"
     },
     "meta": [],
     "type_id": 8,
     "category_id": 2,
     "event_id": 290290
  }
}
  • result – outcome of the complaint processing. It returns the value "unsub" or "already_unsub" if the user has already been unsubscribed;
  • ts – time when the webhook was sent in Unix timestamp format;
  • split_group – identifier of the user's split group used for conducting split tests on the Sendios side;
  • server – name of the mail server from which the email was sent;
  • user – basic information about the user in JSON format.

request

Sendios recommendation system's request to the Client.

event (string)
user_id (int)
project_id (int)
type_id (int)
mail_source
event_id (int)
source_id (int)
ts (int)
split_group(int)
client_user_id (int)
project (string)
email (string) --optional
user (array) --optional
{
  "0": {
    "event": "request",
    "user_id": 899899,
    "project_id": 99,
    "type_id": 8,
    "event_id": 290290,
    "source_id": 4,
    "ts": 1549381952,
    "split_group": null,
    "client_user_id": "991",
    "project": "SomeProject",
    "email": "[email protected]",
    "user": {
      "id": 899899,
      "project_id": 99,
      "email": "[email protected]",
      "name": "Some Name",
      "language": "en",
      "last_online": "1548912693",
      "last_mailed": "1549301485",
      "last_reaction": "1548308703"
    }
  }
}
  • ts – time when the webhook was sent in Unix timestamp format;
  • split_group – identifier of the user's split group used for conducting split tests on the Sendios side;
  • mail_source – name of the recommendation system logic through which the request was made;
  • user – basic information about the user in JSON format.

retention

The user's first click per lifetime (a calendar day).

📘

The retention webhook is sent when there's a click in the email but not more often than once a day, and on the condition that there were no reactions in the previous 2 hours (last_reaction).

event  (string)
user_id (int)
mail_id (int)
type_id (int)
project_id (int)
server (string)
mail_source_id (int)
source_id (int)
template_id (int)
ts (int)
split_group(int)
client_user_id (int)
project (string)
user --optional
campaign_id --optional (int)
type_id --optional (int)
category_id --optional (int)
msg --optional (array)
email --optional (string)
{
  "0": {
     "event": "retention",
     "user_id": 899899,
     "mail_id": 2222229009,
     "type_id": 8,
     "project_id": 99,
     "server": "mail10",
     "source_id": 4,
     "browser": "Chrome mobile",
     "template_id": 2368,
     "ts": 1549382720,
     "split_group": 351,
     "client_user_id": "991",
     "project": "SomeProject",
     "email": "[email protected]",
     "user": {
        "id": 899899,
        "project_id": 99,
        "email": "[email protected]",
        "name": "Some Name",
        "language": "en",
        "last_online": "1549382609",
        "last_mailed": "1549382518",
        "last_reaction": "1549382719"
     },
     "msg": {
        "mail_id": 2222229009,
        "category_id": "1",
        "source_id": 4,
        "type_id": 8,
        "type_sig": "welcome",
        "server": "mail10"
     },
     "meta": [],
     "category_id": 1
  }
}
  • ts – time when the webhook was sent in Unix timestamp format;
  • split_group – identifier of the user's split group used for conducting split tests on the Sendios side;
  • user – basic information about the user in JSON format.