Follow changes
/syncReturns what changed since your last call, so you can keep a copy of conversations, mailboxes and labels without listing them all again.
Needs the permissionsync:read
Call it once without since before you list what you mean to keep. It answers with no items and a cursor. Then list, and from then on call it with since set to the last cursor you got.
Each item is the thing as it is now, as the key’s owner sees it. A delete means they can no longer see it: it was deleted, moved out of their sight, or their access ended.
Messages aren’t included. Fetch Get a thread for the conversations you keep.
Changes are kept for 30 days. A cursor older than that answers 410 cursor_expired: start again without since.
Query parameters
sincestringoptional- The
cursorof your last call. Leave it out the first time. limitnumberoptional- 1 to 500, or 100 if you leave it out.
Returns
A list of changes, and beside it cursor, hasMore and reset. Each change has:
typestringthread,mailboxorlabel.idstring- The thing that changed.
opstringupsert, ordeletewhen the key’s owner can no longer see it.dataobject- With
upsert: a thread as List threads gives it plusmailboxId,unread,labelIdsandassigneeIds; a mailbox as List mailboxes does; a label’sid,name,colour,scope,teamIdsandmailboxIds, without counts. A thread’smailboxIdis null for a conversation started in DMU Mail before anything was sent, until its starter chooses a mailbox. cursorstring- Pass it as
sincenext time. It’s never null. hasMoreboolean- True when there’s more: call again at once.
resetboolean- True when who can see what changed wholesale: discard what you hold, list it again, and carry on from
cursor.
Errors
400bad_cursorsinceisn’t a cursor this endpoint gave.400bad_limitlimitisn’t a whole number from 1 to 500.401invalid_key- The key is wrong, expired or revoked. With no Authorization header at all, the code is
missing_credentials. 403missing_scope- The key doesn’t have
sync:read. TheX-Required-Scopeheader names what’s missing. 410cursor_expired- The cursor is older than the 30 days of changes kept.
429rate_limited- More than 120 requests a minute from this key. Wait for
Retry-Afterseconds.