Events
What a webhook can be told about, and what each event carries in data. A webhook is told the events it lists, and only those.
The events
- message.received
- A message arrives in a mailbox. Mail brought in by a history import isn’t counted.
- message.sent
- A message leaves: sent from DMU Mail, or found in the mailbox’s Sent folder after another client sent it.
- message.failed
- A send failed. Get a message has
lastError. - thread.status_changed
- A conversation is closed, reopened, marked in progress, trashed, restored, or marked as spam or not spam.
- thread.assigned
- Someone is assigned to a conversation.
- thread.unassigned
- Someone is unassigned.
- thread.labelled
- A label is put on a conversation.
- thread.unlabelled
- A label is taken off.
- thread.renamed
- A conversation is renamed in DMU Mail, or given back the mail’s own subject.
- thread.snoozed
- A conversation is snoozed, or its wake time is changed.
- thread.woken
- A snoozed conversation comes back: at its time, early because new mail arrived, or by Wake now.
- thread.moved
- A conversation is moved to another mailbox.
- thread.granted
- Someone who can’t see the mailbox is given the conversation, by a mention in its team chat or by being assigned it.
- thread.ungranted
- Someone given a conversation that way can no longer see it.
- contact.created
- A contact is added: in the app, by an import, or through the API.
- contact.updated
- A contact’s names, addresses, phones, fields or visibility change. Its notes aren’t counted.
- contact.deleted
- A contact is deleted.
- webhook.test
- Only from Send test event.
A webhook made before an event existed doesn’t gain it. Add it in the app, or with PATCH and the whole events list.
A contact belongs to no mailbox, so a webhook for some mailboxes still hears about contacts. A personal contact’s events go only to its own person’s webhooks. A webhook made with a key hears about contacts only while the key has contacts:read, and about personal ones only while the key includes personal contacts.
What’s in data
- message.*
direction:inboundoroutbound.- thread.status_changed
change(closed,reopened,progress_started,trashed,restored,marked_spam,not_spam) andstatus, the conversation’s status after it.- thread.assigned, thread.unassigned
assigneeUserId.- thread.labelled, thread.unlabelled
labelId(null if the label has since been deleted) andlabelName.- thread.renamed
- Nothing more: the name is something a person wrote. Get a thread has it as
displaySubject. - thread.snoozed
snoozedUntil, when it wakes.- thread.woken
- Nothing more, and no
actor. - thread.moved
fromMailboxId, the mailbox it left.mailboxIdis the one it’s in now.- thread.granted, thread.ungranted
userId, who can now see it or no longer can, andreason.- thread.*
actor: who did it, absent when DMU Mail did it itself. Itsnameends in “(API key)” when a key did it.- contact.*
contactId,visibilityandsource, never a name or an address: ask Get a contact for the rest.contact.updatedaddsshared: truewhen a personal contact was shared.
Two events for one change
Assigning someone who couldn’t see the mailbox is
thread.assignedandthread.granted, in either order. Unassigning them isthread.unassignedandthread.ungranted.Moves and access are told as the webhook’s person sees them afterwards. A conversation moved out of their sight isn’t told.
Closing, trashing or marking a snoozed conversation as spam ends the snooze without a
thread.woken:thread.status_changedsays what happened.