Search quarantine¶
POST/
Email Management API · Post-Delivery Quarantine
Summary of all the post-delivery quarantined messages matching your search and filter conditions.
Parameters¶
| Name | In | Type | Required | Description |
|---|---|---|---|---|
X-Tenant-ID | header | string (uuid) | Yes | Tenant ID. |
Request body¶
Content type: application/json
Request body fields
beginDatestring (date-time)requiredMessages quarantined on or after this date. Used with endDate.
endDatestring (date-time)requiredMessages quarantined on or after this date. Used with beginDate.
pageintegerThe 1-based index of the page to fetch.
pageSizeintegerThe size of the page requested.
Must be ≤ 100.
Must be ≤ 100.
sortarray of stringDefines how to sort the data. Supported fields are from, quarantinedAt, forRecipient, and reason.
filterobjectFiltering conditions.
Show child attributesHide child attributes
idstring (uuid)ID from 'X-Sophos-Email-ID' header.
fromContainsstringReturn all rows which contains the provided text in from field.
toContainsstringReturn all rows which contains the provided text in to field.
subjectContainsstringReturn all rows which contains the provided text in subject field.
attachmentNameContainsstringReturn all rows which contains the provided text in attachment names.
sizeInMBGreaterThannumberReturn all rows where the message size in MB is greater than the provided value.
sizeInMBLowerThannumberReturn all rows where the message size in MB is less than the provided value.
productTypestringEmail product.
Must be one of:
Must be one of:
mailflow, gateway, ems.reasonarray of stringEach item must be one of:
malware, maliciousUrl, onDemand.hasAnyAttachmentbooleanReturn all rows where email has at least one attachment.
Request samples¶
curl -X POST "https://api-<data-region>.central.sophos.com/email/v1/post-delivery-quarantine/messages/search" -H "Authorization: Bearer <access-token>" -H "X-Tenant-ID: <tenant-id>" -H "Content-Type: application/json" -d "{
\"beginDate\": \"2012-06-26T11:55:36.100Z\",
\"endDate\": \"2012-06-26T11:55:36.100Z\",
\"page\": 1,
\"pageSize\": 50,
\"sort\": [
\"forRecipient:DESC\"
],
\"filter\": {
\"id\": \"15a7f8ea-691c-4f03-862e-3cefb102818e\",
\"fromContains\": \"some text\",
\"toContains\": \"some text\",
\"subjectContains\": \"some text\",
\"attachmentNameContains\": \"some text\",
\"sizeInMBGreaterThan\": 1,
\"sizeInMBLowerThan\": 2,
\"productType\": \"mailflow\",
\"reason\": [
\"malware\"
],
\"hasAnyAttachment\": false
}
}"
import requests
response = requests.post(
"https://api-<data-region>.central.sophos.com/email/v1/post-delivery-quarantine/messages/search",
headers={
"Authorization": "Bearer <access-token>",
"X-Tenant-ID": "<tenant-id>",
"Content-Type": "application/json",
},
json={ 'beginDate': '2012-06-26T11:55:36.100Z',
'endDate': '2012-06-26T11:55:36.100Z',
'page': 1,
'pageSize': 50,
'sort': ['forRecipient:DESC'],
'filter': { 'id': '15a7f8ea-691c-4f03-862e-3cefb102818e',
'fromContains': 'some text',
'toContains': 'some text',
'subjectContains': 'some text',
'attachmentNameContains': 'some text',
'sizeInMBGreaterThan': 1,
'sizeInMBLowerThan': 2,
'productType': 'mailflow',
'reason': ['malware'],
'hasAnyAttachment': False}},
)
print(response.json())
$headers = @{
"Authorization" = "Bearer <access-token>"
"X-Tenant-ID" = "<tenant-id>"
"Content-Type" = "application/json"
}
$body = '{
"beginDate": "2012-06-26T11:55:36.100Z",
"endDate": "2012-06-26T11:55:36.100Z",
"page": 1,
"pageSize": 50,
"sort": [
"forRecipient:DESC"
],
"filter": {
"id": "15a7f8ea-691c-4f03-862e-3cefb102818e",
"fromContains": "some text",
"toContains": "some text",
"subjectContains": "some text",
"attachmentNameContains": "some text",
"sizeInMBGreaterThan": 1,
"sizeInMBLowerThan": 2,
"productType": "mailflow",
"reason": [
"malware"
],
"hasAnyAttachment": false
}
}'
Invoke-RestMethod -Method POST -Uri "https://api-<data-region>.central.sophos.com/email/v1/post-delivery-quarantine/messages/search" -Headers $headers -Body $body -ContentType "application/json"
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
req, err := http.NewRequest("POST", "https://api-<data-region>.central.sophos.com/email/v1/post-delivery-quarantine/messages/search", strings.NewReader(`{
"beginDate": "2012-06-26T11:55:36.100Z",
"endDate": "2012-06-26T11:55:36.100Z",
"page": 1,
"pageSize": 50,
"sort": [
"forRecipient:DESC"
],
"filter": {
"id": "15a7f8ea-691c-4f03-862e-3cefb102818e",
"fromContains": "some text",
"toContains": "some text",
"subjectContains": "some text",
"attachmentNameContains": "some text",
"sizeInMBGreaterThan": 1,
"sizeInMBLowerThan": 2,
"productType": "mailflow",
"reason": [
"malware"
],
"hasAnyAttachment": false
}
}`))
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer <access-token>")
req.Header.Set("X-Tenant-ID", "<tenant-id>")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
const response = await fetch("https://api-<data-region>.central.sophos.com/email/v1/post-delivery-quarantine/messages/search", {
method: "POST",
headers: {
"Authorization": "Bearer <access-token>",
"X-Tenant-ID": "<tenant-id>",
"Content-Type": "application/json",
},
body: JSON.stringify({
"beginDate": "2012-06-26T11:55:36.100Z",
"endDate": "2012-06-26T11:55:36.100Z",
"page": 1,
"pageSize": 50,
"sort": [
"forRecipient:DESC"
],
"filter": {
"id": "15a7f8ea-691c-4f03-862e-3cefb102818e",
"fromContains": "some text",
"toContains": "some text",
"subjectContains": "some text",
"attachmentNameContains": "some text",
"sizeInMBGreaterThan": 1,
"sizeInMBLowerThan": 2,
"productType": "mailflow",
"reason": [
"malware"
],
"hasAnyAttachment": false
}
}),
});
const data = await response.json();
console.log(data);
Responses¶
200 — Post-Delivery quarantined messages.¶
Response fields
pagesobjectrequiredShow child attributesHide child attributes
currentintegerrequiredThe 1-based page number being returned.
sizeintegerrequiredThe size of the page being returned.
totalinteger(Optional) The total number of pages that exist, if pageTotal=true in the request.
itemsinteger(Optional) The total number of items across all pages.
maxSizeintegerrequiredThe maximum page size that can be requested.
itemsarray of objectrequiredList of post-delivery-quarantined messages.
Show child attributesHide child attributes
idstring (uuid)requiredID from 'X-Sophos-Email-ID' header.
mimeMessageIdstringID from 'message-id' MIME header.
o365MessageIdstringrequiredO365 Message id.
envelopeSenderobjectEmail address and optional display name.
Show child attributesHide child attributes
namestringName of the sender or recipient.
localAddressstringrequiredLocal part of the mail address of the sender or recipient.
domainAddressstringrequiredDomain part of the mail address of the sender or recipient.
toarray of objectList of email addresses listed in 'To' header.
Email address and optional display name.
Show child attributesHide child attributes
namestringName of the sender or recipient.
localAddressstringrequiredLocal part of the mail address of the sender or recipient.
domainAddressstringrequiredDomain part of the mail address of the sender or recipient.
ccarray of objectList of email addresses listed in 'Cc' header.
Email address and optional display name.
Show child attributesHide child attributes
namestringName of the sender or recipient.
localAddressstringrequiredLocal part of the mail address of the sender or recipient.
domainAddressstringrequiredDomain part of the mail address of the sender or recipient.
subjectstringMessage subject.
sizeInBytesnumberMessage size, in bytes.
clientIpstringIP address from where the message was sent.
sentAtstring (date-time)Time from 'Date' MIME header.
quarantinedAtstring (date-time)requiredTime the message was quarantined post-delivery.
productTypestringEmail product.
Must be one of:
Must be one of:
mailflow, gateway, ems.attachmentsobjectShow child attributesHide child attributes
totalintegerrequiredTotal number of attachments found in the message.
itemsarray of objectrequiredMust contain at most 100 items.
Attachment details.
Show child attributesHide child attributes
namestringAttachment name.
sizeInBytesnumberAttachment size, in bytes.
forRecipientstringrequiredEmail address for the post-delivery quarantined message.
reasonstringrequiredReason for clawback.
Must be one of:
Must be one of:
malware, maliciousUrl, onDemand.Errors¶
| Status | Meaning |
|---|---|
400 | Bad request. |
500 | Unexpected error. |
All error responses share the same shape — see the error response object.
Response examples¶
200¶
{
"pages": {
"current": 0,
"size": 0,
"total": 0,
"items": 0,
"maxSize": 0
},
"items": [
{
"id": "15a7f8ea-691c-4f03-862e-3cefb102818e",
"mimeMessageId": "<15a7f8ea-691c-4f03-862e-3cefb102818e>",
"o365MessageId": "message id",
"envelopeSender": {
"name": "Alice",
"localAddress": "user_alice",
"domainAddress": "example.com"
},
"to": [
{
"name": "Alice",
"localAddress": "user_alice",
"domainAddress": "example.com"
}
],
"cc": [
{
"name": "Alice",
"localAddress": "user_alice",
"domainAddress": "example.com"
}
],
"subject": "This is the subject of the email",
"sizeInBytes": "4134",
"clientIp": "10.223.0.45",
"sentAt": "2012-05-26T11:55:36.100Z",
"quarantinedAt": "2012-05-26T11:55:36.100Z",
"productType": "mailflow",
"attachments": {
"total": 50,
"items": [
{
"name": "photo.png",
"sizeInBytes": 374427
}
]
},
"forRecipient": "user_alice@domain.com",
"reason": "malware"
}
]
}
See the guide for a narrative walkthrough of this API.