Find addresses to write to
const url = 'https://mail.work.optidata.cloud/api/mail/mailboxes/78/search/mailables?search=jane&shouldExcludeGroups=false&isCompanyOnly=false';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://mail.work.optidata.cloud/api/mail/mailboxes/78/search/mailables?search=jane&shouldExcludeGroups=false&isCompanyOnly=false' \ --header 'Authorization: Bearer <token>'Autocomplete for a recipient field: matches the search term against the
user’s own contacts and the tenant directory, best match first. An empty
search returns an empty list rather than everything.
Distribution lists come back with isGroup: true. Set
shouldExcludeGroups to drop them, and isCompanyOnly to keep only
addresses on the company’s own domains.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”Id of the mailbox. Every mailbox the caller may use is listed in their account.
Query Parameters
Section titled “Query Parameters”What the user has typed so far.
Drop distribution lists from the result.
Keep only addresses on the company’s own domains.
Responses
Section titled “ Responses ”The matching addresses.
object
An address a message can be sent to.
object
Whether the address is a distribution list.
Where the match came from, e.g. contact.
How often the user writes to this address. Higher sorts first.
Examples
{ "mailables": [ { "name": "Jane Doe", "email": "jane.doe@acme.example", "isGroup": false, "type": "contact", "ranking": 535 }, { "name": "Everyone", "email": "everyone@acme.example", "isGroup": true, "type": "group", "ranking": 12 } ]}Missing, malformed or expired authentication key.
Authentication failures use an error key rather than message.
object
Examples
No bearer token sent
{ "error": "JWT passport exception: Missing bearer token in request"}The caller may not act on this mailbox, user or resource.
Generic error envelope used by policy, binding and framework failures.
object
Human-readable description of the failure.
Examples
{ "message": "This action is unauthorized."}Rate limit exceeded. Retry after the window resets.
Generic error envelope used by policy, binding and framework failures.
object
Human-readable description of the failure.
Examples
{ "message": "Too Many Attempts."}The mail platform did not answer as expected — a folder or message that
does not exist, or a transient failure. reference is the code to quote to
support and fault_code names the underlying condition. A 503 with the
same envelope means the platform is in maintenance; retry shortly.
Failure raised by the mail platform behind the API rather than by the request itself.
object
What went wrong, phrased for the end user.
Repeats the HTTP status code.
Suggested next step.
Support reference, e.g. MZ-502.
Names the underlying condition, e.g. mail.NO_SUCH_FOLDER.
Examples
Unknown folder
{ "error": "The mail server did not answer as expected, so this action could not be completed.", "status": 502, "help": "If the problem persists, contact support and inform the error code above.", "reference": "MZ-502", "fault_code": "mail.NO_SUCH_FOLDER"}Unknown message
{ "error": "The mail server did not answer as expected, so this action could not be completed.", "status": 502, "help": "If the problem persists, contact support and inform the error code above.", "reference": "MZ-502", "fault_code": "mail.NO_SUCH_MSG"}