> For the complete documentation index, see [llms.txt](https://developers.docstudio.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.docstudio.com/api-reference/search-mailboxes-and-contacts.md). Agents can also search and read this documentation through its [MCP server](https://developers.docstudio.com/~gitbook/mcp).

# Search Mailboxes and Contacts

This document contains details for the /api/v1/mailbox/search endpoint, including headers, query parameters, response fields, and status codes.

### Endpoint

| Method | Endpoint                 |
| ------ | ------------------------ |
| `GET`  | `/api/v1/mailbox/search` |

### Headers

<table><thead><tr><th width="264">Header</th><th width="112">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>Authorization</code></td><td>Yes</td><td>Bearer authorization token</td></tr><tr><td><code>Mailbox</code></td><td>Yes</td><td>Current mailbox UUID and contact-list context</td></tr></tbody></table>

### Query parameters

<table><thead><tr><th width="91">Parameter</th><th width="70">Type</th><th width="126">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>q</code></td><td>string</td><td>Yes</td><td>Alias, contact, user email, mailbox name, or mailbox UUID</td></tr><tr><td><code>type</code></td><td>string</td><td>No</td><td>Restricts the search to <code>ALIAS</code> or <code>UUID</code></td></tr></tbody></table>

#### Type values

| Value   | Description             |
| ------- | ----------------------- |
| `ALIAS` | Search by mailbox alias |
| `UUID`  | Search by mailbox UUID  |

### Request example

```http
GET /api/v1/mailbox/search?q=john.doe@example.com
Authorization: Bearer {token}
Mailbox: 837bc65e-4818-48f5-a933-2d00b24b6e12
```

### Response

The endpoint returns `200 OK` with an array of matching mailboxes and contacts.

<table><thead><tr><th width="253">Field</th><th width="197">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>mailboxName</code></td><td>string</td><td>Mailbox name</td></tr><tr><td><code>mailboxUuid</code></td><td>UUID</td><td>Mailbox UUID</td></tr><tr><td><code>alias</code></td><td>string</td><td>Mailbox alias</td></tr><tr><td><code>accountUuid</code></td><td>UUID</td><td>Account UUID</td></tr><tr><td><code>inContacts</code></td><td>boolean</td><td>Whether the mailbox is saved in the current mailbox’s contacts</td></tr></tbody></table>

#### Response example

```json
[
  {
    "mailboxName": "John Doe",
    "mailboxUuid": "9baec31c-e940-4894-b6d1-52033e1af66e",
    "alias": "john-doe",
    "accountUuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "inContacts": true
  }
]
```

{% hint style="info" %}
Use `mailboxUuid` when assigning a mailbox to an envelope role.
{% endhint %}

### Status codes

| Code  | Description                |
| ----- | -------------------------- |
| `200` | Returns matching mailboxes |

### Related topics

* [Authorization](https://developers.docstudio.com/api-reference/authorization.md)
* [Send Envelope](https://developers.docstudio.com/api-reference/send-envelope.md)
* [Error handling](https://developers.docstudio.com/error-codes/error-handling-and-api-error-codes.md)
