This is a list of all the types of events we currently send.
We may add more types at any time, so in developing and maintaining your code, you should not assume that only these types exist.
You’ll notice that these events follow a pattern: resource.event. Our goal is to design a consistent system that makes things easier to anticipate and code against.
The event object
The body of each POST request to a webhook endpoint contains an Event Object with the following shape :
| Field | Description |
|---|---|
id | Identifier of the event. |
created_at | Date time that the event was created by Unipile. For events coming from providers, this date can be late by few milliseconds to few seconds compared to the actual date time of occurence. |
account_id | Identifier of the account for which the event occurs. |
type | Type of the event from the list below. |
payload | Event payload, where its shape is an object determined by the type, specified in the list below. |
Account events
account.status.disconnected
account.status.disconnectedOccurs when an account is disconnected due to obsolete credentials. Learn more about account status.
| Field | Description |
|---|---|
timestamp | Timestamp of when the account was disconnected |
product? | If the provider have multiple products with multiple sessions, the disconnected product. |
account.status.errored
account.status.erroredOccurs when an account becomes out of service due to issues or outages with Unipile, providers, or proxy services. Learn more about account status.
| Field | Description |
|---|---|
timestamp | Timestamp of when the account was out of service |
reason | Reason of error. Can be unipile, proxy or provider |
account.status.running
account.status.runningOccurs when an account connection is started after the account is added, re-authenticated after obsolete credentials, restarted after service interruption or restarted after pause. Learn more about account status.
| Field | Description |
|---|---|
timestamp | Timestamp of when the account was running |
account.status.paused
account.status.pausedOccurs when an account connection is paused because no subscription is active on your organization. Learn more about account status.
| Field | Description |
|---|---|
timestamp | Timestamp of when the account was paused |
account.add
account.addOccurs when a new account is connected. Use account.status.running to make sure the account is ready to be used.
| Field | Description |
|---|---|
account | The linked account. See response of Get an Account for the object shape. |
state? | State passed to the authentication process |
account.reconnect
account.reconnectOccurs when an account is re-authenticated. Use account.status.running to make sure the account is ready to be used.
| Field | Description |
|---|---|
account | The re-authenticated account. See response of Get an Account for the object shape. |
state? | State passed to the re-authentication process |
account.remove
account.removeOccurs when an account is removed.
| Field | Description |
|---|---|
account.id | Account identifier of the removed account. |
account.initial_sync.running
account.initial_sync.runningOccurs when the initial sync of an account is started. Learn more about Initial Sync
| Field | Description |
|---|---|
timestamp | Timestamp of when the sync was started. |
account.initial_sync.completed
account.initial_sync.completedOccurs when the initial sync of an account is finished and all historical data is available. Learn more about Initial Sync
| Field | Description |
|---|---|
timestamp | Timestamp of when the sync was completed. |
account.initial_sync.failed
account.initial_sync.failedOccurs when the initial sync of an account is stopped due to an error. Learn more about Initial Sync
| Field | Description |
|---|---|
timestamp | Timestamp of when the sync was failed. |
reason | Reason of error. Can be unipile, proxy or provider |
Email events
email.new
email.newOccurs when an email is upserted in a folder:
- A received email is upserted in the Inbox folder
- A sent email is upserted in the Outbox (Sent items)
- An email moved from one folder to another is upserted in the new folder
| Field | Description |
|---|---|
folder_id | ID of the Folder where the email is upserted. |
email | Upserted email. See response of Get an Email for the object shape. |
email.bounce.new
email.bounce.newOccurs when a received Bounced email is upserted in the Inbox folder. This event is emitted instead of email.new and not in addition to.
| Field | Description |
|---|---|
reason | Reason message |
date | Date of the bounce email |
addresses | Comma separated addresses of recipients |
type | Error type (See Bounce detection guide) |
code | Error code |
email | Original email. See response of Get an Email for the object shape. |
email.delete
email.deleteOccurs when an email is deleted from a folder. Note that this event is also triggered when an email is moved from one folder to another as it's deleted from its original folder.
Note that emails client often use the word "delete" to move an email to trash. In this case,
email.deleteis sent because it's deleted from it's original folder thenemail.newis sent because it's upserted in the trash folder.
| Field | Description |
|---|---|
folder_id | ID of Folder where the email is deleted. |
email.id | ID of the deleted email. |
email.draft.new
email.draft.newOccurs when a new email draft is created.
Payload is an EmailDraft object. See response ofGet a Draft for the object shape.
email.draft.delete
email.draft.deleteOccurs when an email draft is deleted (not trashed).
| Field | Description |
|---|---|
id | Id of the deleted email draft |
email.folder.create
email.folder.createOccurs when a new email folder is created.
Payload is a Folder object. See response ofGet a Folder for the object shape.
email.folder.update
email.folder.updateOccurs when an existing email folder is updated.
Payload is the updated Folder object. See response ofGet a Folder for the object shape.
email.folder.delete
email.folder.deleteOccurs when an existing email folder is deleted.
| Field | Description |
|---|---|
id | Id of the deleted email folder |
Messaging events
message.new
message.newOccurs when a new message is upserted (received or sent) in a chat.
Why would I need to receive my sent messages ?
If the message is sent from another device (and not from Unipile), your application might want to be aware of it to stay in sync.
Payload is a Message object. See response ofGet a Message for the object shape.
message.update
message.updateOccurs when the content of a message is updated.
Payload is a Message object. See response ofGet a Message for the object shape.
message.delete
message.deleteOccurs when a message is deleted in a chat.
| Field | Description |
|---|---|
chat_id | Id of the parent chat. |
id | Id of the deleted message. |
message.receipt.read
message.receipt.readOccurs when a sent message has been read by a user.
| Field | Description |
|---|---|
chat_id | Id of the parent chat. |
message_id | Id of the read message. |
user_id | Id of the user who read the message. |
timestamp | Timestamp of when the message was read. |
message.receipt.delivery
message.receipt.deliveryOccurs when a sent message has been delivered to a user. If supported by the provider, this event can occurs multiple times for the same message in group chats.
| Field | Description |
|---|---|
chat_id | Id of the parent chat. |
message_id | Id of the delivered message. |
user_id | Id of the user who received the message. |
timestamp | Timestamp of when the message was delivered. |
message.reaction.new
message.reaction.newOccurs when a new reaction is added to a message.
| Field | Description |
|---|---|
chat_id | Id of the parent chat. |
message_id | Id of the parent message. |
reaction | The added reaction. See response of List all Message's Reactions for the object shape. |
Calendar events
calendar.create
calendar.createOccurs when a new calendar is created.
Payload is a Calendar object. See response ofGet a Calendar for the object shape.
calendar.update
calendar.updateOccurs when an existing calendar is updated.
Payload is the updated Calendar object. See response ofGet a Calendar for the object shape.
calendar.delete
calendar.deleteOccurs when an existing calendar is deleted.
| Field | Description |
|---|---|
id | Id of the deleted calendar |
calendar.event.new
calendar.event.newOccurs when a new calendar event is upserted in a Calendar (created or invited to).
Payload is a Calendar Event object. See response ofGet a calendar event for the object shape.
calendar.event.update
calendar.event.updateOccurs when an existing calendar event is updated.
Payload is the updated Calendar Event object. See response ofGet a calendar event for the object shape.
calendar.event.delete
calendar.event.deleteOccurs when an existing calendar event is deleted.
| Field | Description |
|---|---|
calendar_id | Id of the parent calendar |
id | Id of the deleted event |
Tracking events
tracking.click
tracking.clickOccurs when a link is clicked in an email.
| Field | Description |
|---|---|
url | URL of the clicked link |
ip | IP Address of the user who clicked on the link |
user_agent | User agent of the browser used by the user to open the link |
date | ISO Datetime when the link was clicked |
label? | (Optional) Description label specified in tracking_options when the email was sent using Send an Email. |
tracking.open
tracking.openOccurs when an email is opened by the recipient.
| Field | Description |
|---|---|
ip | IP Address of the user who opened the mail |
user_agent | User agent of the software used by the user to open the email |
date | ISO Datetime when the email was opened |
label? | (Optional) Description label specified in tracking_options when the email was sent using Send an Email. |
User events
relation.new
relation.newOccurs when a new bi-directional relation has been established between the owner of the account and an other user.
Payload is a User Relation object. See response of List Relations of a User for the object shape.
follower.new
follower.newOccurs when a user follows the owner of the account.
Payload is a User object. See response of List Followers of a User for the object shape.