Threads
Conversation threads.
| Method | Path | Summary |
|---|---|---|
GET | /v0/inboxes/{inbox_id}/threads | List Threads |
GET | /v0/inboxes/{inbox_id}/threads/search | Search Threads |
GET | /v0/inboxes/{inbox_id}/threads/{thread_id} | Get Thread |
PATCH | /v0/inboxes/{inbox_id}/threads/{thread_id} | Update Thread |
DELETE | /v0/inboxes/{inbox_id}/threads/{thread_id} | Delete Thread |
GET | /v0/pods/{pod_id}/inboxes/{inbox_id}/threads | List Threads in Pod |
GET | /v0/pods/{pod_id}/inboxes/{inbox_id}/threads/search | Search Threads in Pod |
GET | /v0/pods/{pod_id}/inboxes/{inbox_id}/threads/{thread_id} | Get Thread in Pod |
PATCH | /v0/pods/{pod_id}/inboxes/{inbox_id}/threads/{thread_id} | Update Thread in Pod |
DELETE | /v0/pods/{pod_id}/inboxes/{inbox_id}/threads/{thread_id} | Delete Thread in Pod |
GET | /v0/pods/{pod_id}/threads | List Threads in Pod |
GET | /v0/pods/{pod_id}/threads/search | Search Threads in Pod |
GET | /v0/pods/{pod_id}/threads/{thread_id} | Get Thread in Pod |
PATCH | /v0/pods/{pod_id}/threads/{thread_id} | Update Thread in Pod |
DELETE | /v0/pods/{pod_id}/threads/{thread_id} | Delete Thread in Pod |
GET | /v0/threads | List Threads |
GET | /v0/threads/search | Search Threads |
GET | /v0/threads/{thread_id} | Get Thread |
PATCH | /v0/threads/{thread_id} | Update Thread |
DELETE | /v0/threads/{thread_id} | Delete Thread |
List Threads
Threads, most recently active first. Pass q to keep only threads with a message matching the words.
Threads with a spam, blocked, trash, quarantined or unauthenticated message are hidden unless you pass the matching include_* flag or ask for the label in labels.
Authentication: Authorization: Bearer <api key> or the dashboard mm_session cookie. Permission: thread_read.
Path parameters
inbox_idstringRequiredQuery parameters
limitintegerpage_tokenstringascendingbooleanlabelsstring[]beforestring (date-time)afterstring (date-time)include_spambooleaninclude_blockedbooleaninclude_unauthenticatedbooleaninclude_trashbooleaninclude_quarantinebooleanqstringResponse
200 A page of threads (application/json)
countintegerRequiredlimitintegernext_page_tokenstringtruncatedtrueEach item of threads is a ThreadItem:
inbox_idstringRequiredthread_idstringRequiredlabelsstring[]Requiredtimestampstring (date-time)Requiredreceived_timestampstring (date-time)sent_timestampstring (date-time)sendersstring[]Requiredrecipientsstring[]RequiredsubjectstringpreviewstringattachmentsAttachment[]last_message_idstringRequiredmessage_countintegerRequiredsizeintegerRequiredupdated_atstring (date-time)Requiredcreated_atstring (date-time)Requiredpod_idstringRequiredErrors
| Status | Meaning |
|---|---|
400 | Invalid request: error.type is validation and error.param names the field. |
401 | Missing, invalid, expired or revoked credential. |
403 | The credential lacks the permission or scope for this request (error.type forbidden), or MachineMail suspended the organization or its sending (account_suspended: error.message says what still works; do not retry or re-register). |
404 | Not found. Also returned for resources outside the credential scope. |
500 | Unexpected server error. |
Error bodies use the error envelope.
Example
Search Threads
Threads with a message whose subject, sender, recipients, body or attachment file names contain every word of q, ordered by thread activity (not ranked by relevance). Scans the newest 500 matching messages; the response has truncated: true when it hit that cap.
Authentication: Authorization: Bearer <api key> or the dashboard mm_session cookie. Permission: thread_read.
Path parameters
inbox_idstringRequiredQuery parameters
qstringRequiredlimitintegerpage_tokenstringbeforestring (date-time)afterstring (date-time)ascendingbooleanlabelsstring[]include_spambooleaninclude_blockedbooleaninclude_unauthenticatedbooleaninclude_trashbooleaninclude_quarantinebooleanResponse
200 A page of matching threads (application/json)
countintegerRequiredlimitintegernext_page_tokenstringtruncatedtrueEach item of threads is a ThreadItem:
inbox_idstringRequiredthread_idstringRequiredlabelsstring[]Requiredtimestampstring (date-time)Requiredreceived_timestampstring (date-time)sent_timestampstring (date-time)sendersstring[]Requiredrecipientsstring[]RequiredsubjectstringpreviewstringattachmentsAttachment[]last_message_idstringRequiredmessage_countintegerRequiredsizeintegerRequiredupdated_atstring (date-time)Requiredcreated_atstring (date-time)Requiredpod_idstringRequiredErrors
| Status | Meaning |
|---|---|
400 | Invalid request: error.type is validation and error.param names the field. |
401 | Missing, invalid, expired or revoked credential. |
403 | The credential lacks the permission or scope for this request (error.type forbidden), or MachineMail suspended the organization or its sending (account_suspended: error.message says what still works; do not retry or re-register). |
404 | Not found. Also returned for resources outside the credential scope. |
500 | Unexpected server error. |
Error bodies use the error envelope.
Example
Get Thread
The thread with its messages, which carry their bodies and trust reports. Messages come in pages of limit (default and maximum 500): the first page has the newest messages, oldest first within the page; follow next_page_token for older ones.
Authentication: Authorization: Bearer <api key> or the dashboard mm_session cookie. Permission: thread_read.
Path parameters
inbox_idstringRequiredthread_idstringRequiredQuery parameters
limitintegerpage_tokenstringResponse
200 The thread with a page of its messages (application/json)
inbox_idstringRequiredthread_idstringRequiredlabelsstring[]Requiredtimestampstring (date-time)Requiredreceived_timestampstring (date-time)sent_timestampstring (date-time)sendersstring[]Requiredrecipientsstring[]RequiredsubjectstringpreviewstringattachmentsAttachment[]last_message_idstringRequiredmessage_countintegerRequiredsizeintegerRequiredupdated_atstring (date-time)Requiredcreated_atstring (date-time)Requiredpod_idstringRequiredcountintegerRequiredlimitintegernext_page_tokenstringEach item of attachments is a Attachment:
attachment_idstringRequiredfilenamestringsizeintegerRequiredcontent_typestringcontent_dispositionstringcontent_idstringEach item of messages is a Message:
inbox_idstringRequiredthread_idstringRequiredmessage_idstringRequiredlabelsstring[]Requiredtimestampstring (date-time)RequiredfromstringRequiredtostring[]Requiredccstring[]bccstring[]subjectstringpreviewstringattachmentsAttachment[]in_reply_tostringreferencesstring[]headersRecord<string, string>sizeintegerRequiredupdated_atstring (date-time)Requiredcreated_atstring (date-time)Requiredpod_idstringRequireddirection"inbound" | "outbound"Requireddelivery_status"sent" | "delivered" | "bounced" | "complained"trust_level"verified" | "known" | "unknown" | "suspicious" | "quarantined"reply_tostring[]textstringhtmlstringextracted_textstringextracted_htmlstringreceived_via"raw"trustTrustReportErrors
| Status | Meaning |
|---|---|
400 | Invalid request: error.type is validation and error.param names the field. |
401 | Missing, invalid, expired or revoked credential. |
403 | The credential lacks the permission or scope for this request (error.type forbidden), or MachineMail suspended the organization or its sending (account_suspended: error.message says what still works; do not retry or re-register). |
404 | Not found. Also returned for resources outside the credential scope. |
500 | Unexpected server error. |
Error bodies use the error envelope.
Example
Update Thread
Adds and removes labels on every message in the thread (up to 500 messages); the thread labels are their union. Labels are free strings, system labels included. Returns the updated thread without messages.
Authentication: Authorization: Bearer <api key> or the dashboard mm_session cookie. Permission: message_update.
Path parameters
inbox_idstringRequiredthread_idstringRequiredRequest body
Content type: application/json.
add_labelsstring | string[]remove_labelsstring | string[]Response
200 The updated thread, without messages (application/json)
inbox_idstringRequiredthread_idstringRequiredlabelsstring[]Requiredtimestampstring (date-time)Requiredreceived_timestampstring (date-time)sent_timestampstring (date-time)sendersstring[]Requiredrecipientsstring[]RequiredsubjectstringpreviewstringattachmentsAttachment[]last_message_idstringRequiredmessage_countintegerRequiredsizeintegerRequiredupdated_atstring (date-time)Requiredcreated_atstring (date-time)Requiredpod_idstringRequiredEach item of attachments is a Attachment:
attachment_idstringRequiredfilenamestringsizeintegerRequiredcontent_typestringcontent_dispositionstringcontent_idstringErrors
| Status | Meaning |
|---|---|
400 | Invalid request: error.type is validation and error.param names the field. |
401 | Missing, invalid, expired or revoked credential. |
403 | The credential lacks the permission or scope for this request (error.type forbidden), or MachineMail suspended the organization or its sending (account_suspended: error.message says what still works; do not retry or re-register). |
404 | Not found. Also returned for resources outside the credential scope. |
409 | Conflicts with an existing resource. |
500 | Unexpected server error. |
Error bodies use the error envelope.
Example
Delete Thread
Permanently deletes the thread and its messages (up to 500).
Authentication: Authorization: Bearer <api key> or the dashboard mm_session cookie. Permission: thread_delete.
Path parameters
inbox_idstringRequiredthread_idstringRequiredResponse
200 Deleted (application/json)
oktrueRequiredErrors
| Status | Meaning |
|---|---|
401 | Missing, invalid, expired or revoked credential. |
403 | The credential lacks the permission or scope for this request (error.type forbidden), or MachineMail suspended the organization or its sending (account_suspended: error.message says what still works; do not retry or re-register). |
404 | Not found. Also returned for resources outside the credential scope. |
409 | Conflicts with an existing resource. |
500 | Unexpected server error. |
Error bodies use the error envelope.
Example
List Threads in Pod
Same as List Threads (GET /v0/inboxes/{inbox_id}/threads), limited to the pod.
Authentication: Authorization: Bearer <api key> or the dashboard mm_session cookie. Permission: thread_read.
Path parameters
pod_idstringRequiredinbox_idstringRequiredQuery parameters
limitintegerpage_tokenstringascendingbooleanlabelsstring[]beforestring (date-time)afterstring (date-time)include_spambooleaninclude_blockedbooleaninclude_unauthenticatedbooleaninclude_trashbooleaninclude_quarantinebooleanqstringResponse
200 A page of threads (application/json)
countintegerRequiredlimitintegernext_page_tokenstringtruncatedtrueEach item of threads is a ThreadItem:
inbox_idstringRequiredthread_idstringRequiredlabelsstring[]Requiredtimestampstring (date-time)Requiredreceived_timestampstring (date-time)sent_timestampstring (date-time)sendersstring[]Requiredrecipientsstring[]RequiredsubjectstringpreviewstringattachmentsAttachment[]last_message_idstringRequiredmessage_countintegerRequiredsizeintegerRequiredupdated_atstring (date-time)Requiredcreated_atstring (date-time)Requiredpod_idstringRequiredErrors
| Status | Meaning |
|---|---|
400 | Invalid request: error.type is validation and error.param names the field. |
401 | Missing, invalid, expired or revoked credential. |
403 | The credential lacks the permission or scope for this request (error.type forbidden), or MachineMail suspended the organization or its sending (account_suspended: error.message says what still works; do not retry or re-register). |
404 | Not found. Also returned for resources outside the credential scope. |
500 | Unexpected server error. |
Error bodies use the error envelope.
Example
Search Threads in Pod
Same as Search Threads (GET /v0/inboxes/{inbox_id}/threads/search), limited to the pod.
Authentication: Authorization: Bearer <api key> or the dashboard mm_session cookie. Permission: thread_read.
Path parameters
pod_idstringRequiredinbox_idstringRequiredQuery parameters
qstringRequiredlimitintegerpage_tokenstringbeforestring (date-time)afterstring (date-time)ascendingbooleanlabelsstring[]include_spambooleaninclude_blockedbooleaninclude_unauthenticatedbooleaninclude_trashbooleaninclude_quarantinebooleanResponse
200 A page of matching threads (application/json)
countintegerRequiredlimitintegernext_page_tokenstringtruncatedtrueEach item of threads is a ThreadItem:
inbox_idstringRequiredthread_idstringRequiredlabelsstring[]Requiredtimestampstring (date-time)Requiredreceived_timestampstring (date-time)sent_timestampstring (date-time)sendersstring[]Requiredrecipientsstring[]RequiredsubjectstringpreviewstringattachmentsAttachment[]last_message_idstringRequiredmessage_countintegerRequiredsizeintegerRequiredupdated_atstring (date-time)Requiredcreated_atstring (date-time)Requiredpod_idstringRequiredErrors
| Status | Meaning |
|---|---|
400 | Invalid request: error.type is validation and error.param names the field. |
401 | Missing, invalid, expired or revoked credential. |
403 | The credential lacks the permission or scope for this request (error.type forbidden), or MachineMail suspended the organization or its sending (account_suspended: error.message says what still works; do not retry or re-register). |
404 | Not found. Also returned for resources outside the credential scope. |
500 | Unexpected server error. |
Error bodies use the error envelope.
Example
Get Thread in Pod
Same as Get Thread (GET /v0/inboxes/{inbox_id}/threads/{thread_id}), limited to the pod.
Authentication: Authorization: Bearer <api key> or the dashboard mm_session cookie. Permission: thread_read.
Path parameters
pod_idstringRequiredinbox_idstringRequiredthread_idstringRequiredQuery parameters
limitintegerpage_tokenstringResponse
200 The thread with a page of its messages (application/json)
inbox_idstringRequiredthread_idstringRequiredlabelsstring[]Requiredtimestampstring (date-time)Requiredreceived_timestampstring (date-time)sent_timestampstring (date-time)sendersstring[]Requiredrecipientsstring[]RequiredsubjectstringpreviewstringattachmentsAttachment[]last_message_idstringRequiredmessage_countintegerRequiredsizeintegerRequiredupdated_atstring (date-time)Requiredcreated_atstring (date-time)Requiredpod_idstringRequiredcountintegerRequiredlimitintegernext_page_tokenstringEach item of attachments is a Attachment:
attachment_idstringRequiredfilenamestringsizeintegerRequiredcontent_typestringcontent_dispositionstringcontent_idstringEach item of messages is a Message:
inbox_idstringRequiredthread_idstringRequiredmessage_idstringRequiredlabelsstring[]Requiredtimestampstring (date-time)RequiredfromstringRequiredtostring[]Requiredccstring[]bccstring[]subjectstringpreviewstringattachmentsAttachment[]in_reply_tostringreferencesstring[]headersRecord<string, string>sizeintegerRequiredupdated_atstring (date-time)Requiredcreated_atstring (date-time)Requiredpod_idstringRequireddirection"inbound" | "outbound"Requireddelivery_status"sent" | "delivered" | "bounced" | "complained"trust_level"verified" | "known" | "unknown" | "suspicious" | "quarantined"reply_tostring[]textstringhtmlstringextracted_textstringextracted_htmlstringreceived_via"raw"trustTrustReportErrors
| Status | Meaning |
|---|---|
400 | Invalid request: error.type is validation and error.param names the field. |
401 | Missing, invalid, expired or revoked credential. |
403 | The credential lacks the permission or scope for this request (error.type forbidden), or MachineMail suspended the organization or its sending (account_suspended: error.message says what still works; do not retry or re-register). |
404 | Not found. Also returned for resources outside the credential scope. |
500 | Unexpected server error. |
Error bodies use the error envelope.
Example
Update Thread in Pod
Same as Update Thread (PATCH /v0/inboxes/{inbox_id}/threads/{thread_id}), limited to the pod.
Authentication: Authorization: Bearer <api key> or the dashboard mm_session cookie. Permission: message_update.
Path parameters
pod_idstringRequiredinbox_idstringRequiredthread_idstringRequiredRequest body
Content type: application/json.
add_labelsstring | string[]remove_labelsstring | string[]Response
200 The updated thread, without messages (application/json)
inbox_idstringRequiredthread_idstringRequiredlabelsstring[]Requiredtimestampstring (date-time)Requiredreceived_timestampstring (date-time)sent_timestampstring (date-time)sendersstring[]Requiredrecipientsstring[]RequiredsubjectstringpreviewstringattachmentsAttachment[]last_message_idstringRequiredmessage_countintegerRequiredsizeintegerRequiredupdated_atstring (date-time)Requiredcreated_atstring (date-time)Requiredpod_idstringRequiredEach item of attachments is a Attachment:
attachment_idstringRequiredfilenamestringsizeintegerRequiredcontent_typestringcontent_dispositionstringcontent_idstringErrors
| Status | Meaning |
|---|---|
400 | Invalid request: error.type is validation and error.param names the field. |
401 | Missing, invalid, expired or revoked credential. |
403 | The credential lacks the permission or scope for this request (error.type forbidden), or MachineMail suspended the organization or its sending (account_suspended: error.message says what still works; do not retry or re-register). |
404 | Not found. Also returned for resources outside the credential scope. |
409 | Conflicts with an existing resource. |
500 | Unexpected server error. |
Error bodies use the error envelope.
Example
Delete Thread in Pod
Same as Delete Thread (DELETE /v0/inboxes/{inbox_id}/threads/{thread_id}), limited to the pod.
Authentication: Authorization: Bearer <api key> or the dashboard mm_session cookie. Permission: thread_delete.
Path parameters
pod_idstringRequiredinbox_idstringRequiredthread_idstringRequiredResponse
200 Deleted (application/json)
oktrueRequiredErrors
| Status | Meaning |
|---|---|
401 | Missing, invalid, expired or revoked credential. |
403 | The credential lacks the permission or scope for this request (error.type forbidden), or MachineMail suspended the organization or its sending (account_suspended: error.message says what still works; do not retry or re-register). |
404 | Not found. Also returned for resources outside the credential scope. |
409 | Conflicts with an existing resource. |
500 | Unexpected server error. |
Error bodies use the error envelope.
Example
List Threads in Pod
Same as List Threads (GET /v0/threads), limited to the pod.
Authentication: Authorization: Bearer <api key> or the dashboard mm_session cookie. Permission: thread_read.
Path parameters
pod_idstringRequiredQuery parameters
limitintegerpage_tokenstringascendingbooleanlabelsstring[]beforestring (date-time)afterstring (date-time)include_spambooleaninclude_blockedbooleaninclude_unauthenticatedbooleaninclude_trashbooleaninclude_quarantinebooleanqstringResponse
200 A page of threads (application/json)
countintegerRequiredlimitintegernext_page_tokenstringtruncatedtrueEach item of threads is a ThreadItem:
inbox_idstringRequiredthread_idstringRequiredlabelsstring[]Requiredtimestampstring (date-time)Requiredreceived_timestampstring (date-time)sent_timestampstring (date-time)sendersstring[]Requiredrecipientsstring[]RequiredsubjectstringpreviewstringattachmentsAttachment[]last_message_idstringRequiredmessage_countintegerRequiredsizeintegerRequiredupdated_atstring (date-time)Requiredcreated_atstring (date-time)Requiredpod_idstringRequiredErrors
| Status | Meaning |
|---|---|
400 | Invalid request: error.type is validation and error.param names the field. |
401 | Missing, invalid, expired or revoked credential. |
403 | The credential lacks the permission or scope for this request (error.type forbidden), or MachineMail suspended the organization or its sending (account_suspended: error.message says what still works; do not retry or re-register). |
404 | Not found. Also returned for resources outside the credential scope. |
500 | Unexpected server error. |
Error bodies use the error envelope.
Example
Search Threads in Pod
Same as Search Threads (GET /v0/threads/search), limited to the pod.
Authentication: Authorization: Bearer <api key> or the dashboard mm_session cookie. Permission: thread_read.
Path parameters
pod_idstringRequiredQuery parameters
qstringRequiredlimitintegerpage_tokenstringbeforestring (date-time)afterstring (date-time)ascendingbooleanlabelsstring[]include_spambooleaninclude_blockedbooleaninclude_unauthenticatedbooleaninclude_trashbooleaninclude_quarantinebooleanResponse
200 A page of matching threads (application/json)
countintegerRequiredlimitintegernext_page_tokenstringtruncatedtrueEach item of threads is a ThreadItem:
inbox_idstringRequiredthread_idstringRequiredlabelsstring[]Requiredtimestampstring (date-time)Requiredreceived_timestampstring (date-time)sent_timestampstring (date-time)sendersstring[]Requiredrecipientsstring[]RequiredsubjectstringpreviewstringattachmentsAttachment[]last_message_idstringRequiredmessage_countintegerRequiredsizeintegerRequiredupdated_atstring (date-time)Requiredcreated_atstring (date-time)Requiredpod_idstringRequiredErrors
| Status | Meaning |
|---|---|
400 | Invalid request: error.type is validation and error.param names the field. |
401 | Missing, invalid, expired or revoked credential. |
403 | The credential lacks the permission or scope for this request (error.type forbidden), or MachineMail suspended the organization or its sending (account_suspended: error.message says what still works; do not retry or re-register). |
404 | Not found. Also returned for resources outside the credential scope. |
500 | Unexpected server error. |
Error bodies use the error envelope.
Example
Get Thread in Pod
Same as Get Thread (GET /v0/threads/{thread_id}), limited to the pod.
Authentication: Authorization: Bearer <api key> or the dashboard mm_session cookie. Permission: thread_read.
Path parameters
pod_idstringRequiredthread_idstringRequiredQuery parameters
limitintegerpage_tokenstringResponse
200 The thread with a page of its messages (application/json)
inbox_idstringRequiredthread_idstringRequiredlabelsstring[]Requiredtimestampstring (date-time)Requiredreceived_timestampstring (date-time)sent_timestampstring (date-time)sendersstring[]Requiredrecipientsstring[]RequiredsubjectstringpreviewstringattachmentsAttachment[]last_message_idstringRequiredmessage_countintegerRequiredsizeintegerRequiredupdated_atstring (date-time)Requiredcreated_atstring (date-time)Requiredpod_idstringRequiredcountintegerRequiredlimitintegernext_page_tokenstringEach item of attachments is a Attachment:
attachment_idstringRequiredfilenamestringsizeintegerRequiredcontent_typestringcontent_dispositionstringcontent_idstringEach item of messages is a Message:
inbox_idstringRequiredthread_idstringRequiredmessage_idstringRequiredlabelsstring[]Requiredtimestampstring (date-time)RequiredfromstringRequiredtostring[]Requiredccstring[]bccstring[]subjectstringpreviewstringattachmentsAttachment[]in_reply_tostringreferencesstring[]headersRecord<string, string>sizeintegerRequiredupdated_atstring (date-time)Requiredcreated_atstring (date-time)Requiredpod_idstringRequireddirection"inbound" | "outbound"Requireddelivery_status"sent" | "delivered" | "bounced" | "complained"trust_level"verified" | "known" | "unknown" | "suspicious" | "quarantined"reply_tostring[]textstringhtmlstringextracted_textstringextracted_htmlstringreceived_via"raw"trustTrustReportErrors
| Status | Meaning |
|---|---|
400 | Invalid request: error.type is validation and error.param names the field. |
401 | Missing, invalid, expired or revoked credential. |
403 | The credential lacks the permission or scope for this request (error.type forbidden), or MachineMail suspended the organization or its sending (account_suspended: error.message says what still works; do not retry or re-register). |
404 | Not found. Also returned for resources outside the credential scope. |
500 | Unexpected server error. |
Error bodies use the error envelope.
Example
Update Thread in Pod
Same as Update Thread (PATCH /v0/threads/{thread_id}), limited to the pod.
Authentication: Authorization: Bearer <api key> or the dashboard mm_session cookie. Permission: message_update.
Path parameters
pod_idstringRequiredthread_idstringRequiredRequest body
Content type: application/json.
add_labelsstring | string[]remove_labelsstring | string[]Response
200 The updated thread, without messages (application/json)
inbox_idstringRequiredthread_idstringRequiredlabelsstring[]Requiredtimestampstring (date-time)Requiredreceived_timestampstring (date-time)sent_timestampstring (date-time)sendersstring[]Requiredrecipientsstring[]RequiredsubjectstringpreviewstringattachmentsAttachment[]last_message_idstringRequiredmessage_countintegerRequiredsizeintegerRequiredupdated_atstring (date-time)Requiredcreated_atstring (date-time)Requiredpod_idstringRequiredEach item of attachments is a Attachment:
attachment_idstringRequiredfilenamestringsizeintegerRequiredcontent_typestringcontent_dispositionstringcontent_idstringErrors
| Status | Meaning |
|---|---|
400 | Invalid request: error.type is validation and error.param names the field. |
401 | Missing, invalid, expired or revoked credential. |
403 | The credential lacks the permission or scope for this request (error.type forbidden), or MachineMail suspended the organization or its sending (account_suspended: error.message says what still works; do not retry or re-register). |
404 | Not found. Also returned for resources outside the credential scope. |
409 | Conflicts with an existing resource. |
500 | Unexpected server error. |
Error bodies use the error envelope.
Example
Delete Thread in Pod
Same as Delete Thread (DELETE /v0/threads/{thread_id}), limited to the pod.
Authentication: Authorization: Bearer <api key> or the dashboard mm_session cookie. Permission: thread_delete.
Path parameters
pod_idstringRequiredthread_idstringRequiredResponse
200 Deleted (application/json)
oktrueRequiredErrors
| Status | Meaning |
|---|---|
401 | Missing, invalid, expired or revoked credential. |
403 | The credential lacks the permission or scope for this request (error.type forbidden), or MachineMail suspended the organization or its sending (account_suspended: error.message says what still works; do not retry or re-register). |
404 | Not found. Also returned for resources outside the credential scope. |
409 | Conflicts with an existing resource. |
500 | Unexpected server error. |
Error bodies use the error envelope.
Example
List Threads
Threads, most recently active first. Pass q to keep only threads with a message matching the words.
Threads with a spam, blocked, trash, quarantined or unauthenticated message are hidden unless you pass the matching include_* flag or ask for the label in labels.
Authentication: Authorization: Bearer <api key> or the dashboard mm_session cookie. Permission: thread_read.
Query parameters
limitintegerpage_tokenstringascendingbooleanlabelsstring[]beforestring (date-time)afterstring (date-time)include_spambooleaninclude_blockedbooleaninclude_unauthenticatedbooleaninclude_trashbooleaninclude_quarantinebooleanqstringResponse
200 A page of threads (application/json)
countintegerRequiredlimitintegernext_page_tokenstringtruncatedtrueEach item of threads is a ThreadItem:
inbox_idstringRequiredthread_idstringRequiredlabelsstring[]Requiredtimestampstring (date-time)Requiredreceived_timestampstring (date-time)sent_timestampstring (date-time)sendersstring[]Requiredrecipientsstring[]RequiredsubjectstringpreviewstringattachmentsAttachment[]last_message_idstringRequiredmessage_countintegerRequiredsizeintegerRequiredupdated_atstring (date-time)Requiredcreated_atstring (date-time)Requiredpod_idstringRequiredErrors
| Status | Meaning |
|---|---|
400 | Invalid request: error.type is validation and error.param names the field. |
401 | Missing, invalid, expired or revoked credential. |
403 | The credential lacks the permission or scope for this request (error.type forbidden), or MachineMail suspended the organization or its sending (account_suspended: error.message says what still works; do not retry or re-register). |
500 | Unexpected server error. |
Error bodies use the error envelope.
Example
Search Threads
Threads with a message whose subject, sender, recipients, body or attachment file names contain every word of q, ordered by thread activity (not ranked by relevance). Scans the newest 500 matching messages; the response has truncated: true when it hit that cap.
Authentication: Authorization: Bearer <api key> or the dashboard mm_session cookie. Permission: thread_read.
Query parameters
qstringRequiredlimitintegerpage_tokenstringbeforestring (date-time)afterstring (date-time)ascendingbooleanlabelsstring[]include_spambooleaninclude_blockedbooleaninclude_unauthenticatedbooleaninclude_trashbooleaninclude_quarantinebooleanResponse
200 A page of matching threads (application/json)
countintegerRequiredlimitintegernext_page_tokenstringtruncatedtrueEach item of threads is a ThreadItem:
inbox_idstringRequiredthread_idstringRequiredlabelsstring[]Requiredtimestampstring (date-time)Requiredreceived_timestampstring (date-time)sent_timestampstring (date-time)sendersstring[]Requiredrecipientsstring[]RequiredsubjectstringpreviewstringattachmentsAttachment[]last_message_idstringRequiredmessage_countintegerRequiredsizeintegerRequiredupdated_atstring (date-time)Requiredcreated_atstring (date-time)Requiredpod_idstringRequiredErrors
| Status | Meaning |
|---|---|
400 | Invalid request: error.type is validation and error.param names the field. |
401 | Missing, invalid, expired or revoked credential. |
403 | The credential lacks the permission or scope for this request (error.type forbidden), or MachineMail suspended the organization or its sending (account_suspended: error.message says what still works; do not retry or re-register). |
500 | Unexpected server error. |
Error bodies use the error envelope.
Example
Get Thread
The thread with its messages, which carry their bodies and trust reports. Messages come in pages of limit (default and maximum 500): the first page has the newest messages, oldest first within the page; follow next_page_token for older ones.
Authentication: Authorization: Bearer <api key> or the dashboard mm_session cookie. Permission: thread_read.
Path parameters
thread_idstringRequiredQuery parameters
limitintegerpage_tokenstringResponse
200 The thread with a page of its messages (application/json)
inbox_idstringRequiredthread_idstringRequiredlabelsstring[]Requiredtimestampstring (date-time)Requiredreceived_timestampstring (date-time)sent_timestampstring (date-time)sendersstring[]Requiredrecipientsstring[]RequiredsubjectstringpreviewstringattachmentsAttachment[]last_message_idstringRequiredmessage_countintegerRequiredsizeintegerRequiredupdated_atstring (date-time)Requiredcreated_atstring (date-time)Requiredpod_idstringRequiredcountintegerRequiredlimitintegernext_page_tokenstringEach item of attachments is a Attachment:
attachment_idstringRequiredfilenamestringsizeintegerRequiredcontent_typestringcontent_dispositionstringcontent_idstringEach item of messages is a Message:
inbox_idstringRequiredthread_idstringRequiredmessage_idstringRequiredlabelsstring[]Requiredtimestampstring (date-time)RequiredfromstringRequiredtostring[]Requiredccstring[]bccstring[]subjectstringpreviewstringattachmentsAttachment[]in_reply_tostringreferencesstring[]headersRecord<string, string>sizeintegerRequiredupdated_atstring (date-time)Requiredcreated_atstring (date-time)Requiredpod_idstringRequireddirection"inbound" | "outbound"Requireddelivery_status"sent" | "delivered" | "bounced" | "complained"trust_level"verified" | "known" | "unknown" | "suspicious" | "quarantined"reply_tostring[]textstringhtmlstringextracted_textstringextracted_htmlstringreceived_via"raw"trustTrustReportErrors
| Status | Meaning |
|---|---|
400 | Invalid request: error.type is validation and error.param names the field. |
401 | Missing, invalid, expired or revoked credential. |
403 | The credential lacks the permission or scope for this request (error.type forbidden), or MachineMail suspended the organization or its sending (account_suspended: error.message says what still works; do not retry or re-register). |
404 | Not found. Also returned for resources outside the credential scope. |
500 | Unexpected server error. |
Error bodies use the error envelope.
Example
Update Thread
Adds and removes labels on every message in the thread (up to 500 messages); the thread labels are their union. Labels are free strings, system labels included. Returns the updated thread without messages.
Authentication: Authorization: Bearer <api key> or the dashboard mm_session cookie. Permission: message_update.
Path parameters
thread_idstringRequiredRequest body
Content type: application/json.
add_labelsstring | string[]remove_labelsstring | string[]Response
200 The updated thread, without messages (application/json)
inbox_idstringRequiredthread_idstringRequiredlabelsstring[]Requiredtimestampstring (date-time)Requiredreceived_timestampstring (date-time)sent_timestampstring (date-time)sendersstring[]Requiredrecipientsstring[]RequiredsubjectstringpreviewstringattachmentsAttachment[]last_message_idstringRequiredmessage_countintegerRequiredsizeintegerRequiredupdated_atstring (date-time)Requiredcreated_atstring (date-time)Requiredpod_idstringRequiredEach item of attachments is a Attachment:
attachment_idstringRequiredfilenamestringsizeintegerRequiredcontent_typestringcontent_dispositionstringcontent_idstringErrors
| Status | Meaning |
|---|---|
400 | Invalid request: error.type is validation and error.param names the field. |
401 | Missing, invalid, expired or revoked credential. |
403 | The credential lacks the permission or scope for this request (error.type forbidden), or MachineMail suspended the organization or its sending (account_suspended: error.message says what still works; do not retry or re-register). |
404 | Not found. Also returned for resources outside the credential scope. |
409 | Conflicts with an existing resource. |
500 | Unexpected server error. |
Error bodies use the error envelope.
Example
Delete Thread
Permanently deletes the thread and its messages (up to 500).
Authentication: Authorization: Bearer <api key> or the dashboard mm_session cookie. Permission: thread_delete.
Path parameters
thread_idstringRequiredResponse
200 Deleted (application/json)
oktrueRequiredErrors
| Status | Meaning |
|---|---|
401 | Missing, invalid, expired or revoked credential. |
403 | The credential lacks the permission or scope for this request (error.type forbidden), or MachineMail suspended the organization or its sending (account_suspended: error.message says what still works; do not retry or re-register). |
404 | Not found. Also returned for resources outside the credential scope. |
409 | Conflicts with an existing resource. |
500 | Unexpected server error. |
Error bodies use the error envelope.