Mailbox API – Mails Search

Axigen Documentation

The Mailbox API is available starting with Axigen X4 (10.4).

Request body (JSON)

Name

Type

Required

Values

Description

folderIds

Array

*

Example:

The IDs of the folders to search in

query

Array

*

JSON object list in the following format:

The query should be a JSON array containing all the requested search criteria.

See the Search Syntax chapter below for details about criteria.

recursive

Boolean

Whether the folders specified in the folderIds array should be searched recursively. Default value is “false”.

Response

Mails Search Syntax

Criteria

The table below contains the criteria included in the API search implementation, along with their advanced search / quick search mapping.

Criterion class

Criterion

Operators

Syntax

Prefix

(All languages)

Examples

Notes

Mailbox REST API Examples

Text

From

contains (default)

doesn't contain (-)

from:

  1. from:John

  2. from:(John Doe)

  3. from:(Mihai "John Doe")

  4. from:John Doe <john.doe@example.com>

  5. from: Mihai "John Doe <john.doe@example.com>"

  6. from:-John

  7. from:-(John Doe)

  8. from:-("John Doe")

  9. from: Mihai from: -"john Doe"

Also accepted with a space after ":"

When in quotes, exact match will be applied.

To

contains (default)

doesn't contain (-)

to:

  1. to:John

  2. to:(John Doe)

  3. to:("John Doe")

  4. to:-John

  5. to:-(John Doe)

  6. to:-("John Doe")

  7. to: Mihai "John Doe <john.doe@example.com>"

  8. to: Mihai to: -"john Doe"

Also accepted with a space after ":"

When in quotes, exact match will be applied.


Subject

contains (default)

doesn't contain (-)

subject:

subject:Party

subject:(Christmas Party)

subject:("Christmas Party")

subject:-Party

subject:-(Christmas Party)

-subject:("Christmas Party")

Also accepted with a space after ":"

When in quotes, exact match will be applied.

Same as the "From" criterion API; replace "field": "from" with "field": "subject"


Cc

contains (default)

doesn't contain (-)

cc:

cc:John

cc:(John Doe)

cc:("John Doe")

cc:-John

cc:-(John Doe)

cc:-("John Doe")

Also accepted with a space after ":"

When in quotes, exact match will be applied.

Same as the "From" criterion API; replace "field": "from" with "field": "cc"


Bcc

contains (default)

doesn't contain (-)

bcc:

bcc:John

bcc:(John Doe)

bcc:("John Doe")

bcc:-John

bcc:-(John Doe)

bcc:-("John Doe")

Also accepted with a space after ":"

When in quotes, exact match will be applied.

Same as the "From" criterion API; replace "field": "from" with "field": "bcc"


Body

contains (default)

doesn't contain (-)

body:

body:Party

body:(Christmas Party)

body:("Christmas Party")

body:-Party

body:-(Christmas Party)

body:-("Christmas Party")

Also accepted with a space after ":"

When in quotes, exact match will be applied.

Same as the "From" criterion API; replace "field": "from" with "field": "body"


Any field

contains (default)

doesn't contain (-)

N/A

John

John Doe <john.doe@example.com>

(Christmas Party)

"Christmas Party"

-John

-(John Doe <john.doe@example.com>)

-(Christmas Party)

-"Christmas Party"

Also accepted with a space after ":"

When in quotes, exact match will be applied.

Same as the "From" criterion API; replace "field": "from" with "field": "anyfield"

Time

Date

before

before:[date]

before:15/12/2019

before:(15/12/2019)

Also accepted with a space after ":"

Dates are accepted in the format: dd-mm-yyyy (dd can also be d)

"last 7 days" replaces "is from this week"

"last 30 days" replaces "is from this month"

"before" replaces "is before"

"after" replaces "is since" 

Examples assume today is 14/12/2019

The "After" and "Before" dates are exclusive.

The date timestamps are treated as UTC, regardless of the client's timezone.

after

after:[date] 

after:14/12/2019

after:(14/12/2019)

last 7 days

after:[date]

before:[date]



after:07/12/2019 before:15/12/2019

after:(07/12/2019) before:(15/12/2019)

last 30 days

after:14/11/2019 before:15/12/2019

after:(14/11/2019) before:(15/12/2019)

between (default)

after:15/08/2019 before:15/12/2019

after:(15/08/2019) before:(15/12/2019)

Has attachment

Has attachment

N/A

has:

has:attachment


Read / Unread

Read / Unread

N/A

is:

  1. is:unread

  2. is:read

Also accepted with a space after ":"

An is:read WebMail search translates to a negated "unread" API query

Folder ID

Search in

All mail

in:anywhere

in:anywhere

Also accepted with a space after ":"

The folder name can be in quotes or without quotes.

If there's a folder named "mailbox", the current mailbox takes precedence; the folder needs to be added in brackets or quotes to take precedence.

Note that the folder IDs are specified in the fid array, not in the query

Current mailbox (default)

N/A

N/A

Current mailbox (including Spam and Trash) 

in:mailbox

in:mailbox

Current folder

in:[folderName]

in:Inbox

in:(Marketing Materials)

in:("Marketing Materials")

Custom folders

in:("Inbox", "Marketing Materials")

in:("Inbox", "Marketing Materials")

Size

Size

is less than

smaller:[size]

  1. smaller: 2M

  2. smaller:800K

  3. smaller:1000B

  4. smaller:10000

Also accepted with a space after ":"

is more than

larger:[size]

  1. larger: 2M

  2. larger:800K

  3. larger:1000B

  4. larger:10000

Flag

Flag

is follow-up

is:

is:follow-up

Also accepted with a space after ":"

is not follow-up

is:-follow-up

is completed

is:completed

is not completed

is:-completed

Importance

Importance

is high importance

has:

has:high-importance

Also accepted with a space after ":"

is not high importance

has:-high-importance

is low importance

has:low-importance

is not low importance

has:-low-importance

is normal importance

has:normal-importance

is not normal importance

has:-normal-importance

Label

Label

has label

label:

label:MyLabelName

Also accepted with a space after ":"

The client will translate label name to label id

does not have label

label:-MyOtherLabelName

Additional Notes

  • The default operator is AND.

  • The "-" prefix negates the entire criterion ("-" followed by space is not accepted — i.e. does not have the same behavior)

  • Multiple criteria can be combined. Examples:

    • Christmas Party from:John

    • "Christmas Party 2019" from:John 

    • from:John from:Doe  → from:(John Doe) 

    • from:John subject:Party is:replied after:2019-12-01