Skip to product menu
Skip to main content

List Emails Based on Search Key

Purpose

This API lists all the emails that match the specified search parameter.

OAuth Scope

Use the scope

MailApps.messages.ALL (or) MailApps.messages.READ

ALL - Full access to the messages.

READ - Read emails.

To generate Authtoken, refer here.

Request URL

Method: GET

https://mail360.zoho.com/api/accounts/{account_key}/messages/search

Path Parameters

  • account_key*string
    • This key is used to identify the account from which the emails have to be retrieved. It is generated during account addition.
    • This parameter can be fetched from Get all accounts API.

Query Parameters

  • emailId*string
    • This parameter specifies the email IDs for which the search needs to be performed. 
    • Values should be provided as email addresses separated by commas.
  • startint
    • This parameter specifies the starting sequence number of the emails to be retrieved.
    • The default value is 1.
  • limitint
    • This parameter specifies the number of emails to be retrieved from the start value mentioned.
    • The value can be between 1 to 200.
    • The default value is 10.
  • mailQrystring
    • This parameter specifies the particular data to search for.
    • The possible value can be sender, sendername, to, cc, bcc, senddate, receiveddate, content, subject, hasattach, folderid, flagid, hasinline, threadid, attachid, attachlabel, attachtype, attachname.
  • dateRange string
    • This parameter specifies the time frame for retrieving emails.
    • Format : startDate:endDate
      Example:31-Dec-1969:13-May-2024

 

* - Mandatory parameter

Note:

While the Messages APIs focus on individual messages, the Threads APIs deal with entire conversation threads, each of which contains multiple messages.

Sample Request 1

Copiedcurl "https://mail360.zoho.com/api/accounts/x7**0s/messages/search?mailQry=(sender=rebecca@gmailcom)&dateRange=
31-Dec-1969:13-May-2024" \
-X GET \
-H "Accept: application/json" \
-H "Authorization:Zoho-oauthtoken 8024329**09d8c98b4ac3" 

Sample Request 2

Copiedcurl "https://mail360.zoho.com/api/accounts/x7**0s/messages/search?mailQry=(sender=rebecca@zylker.com || to=paula@zylker.com || cc=david@zylker.com)&start=1&limit=10" \
-X GET \
-H "Accept: application/json" \
-H "Authorization:Zoho-oauthtoken 8024329**09d8c98b4ac3"