> 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).

# 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

| Property | Value                    |
| -------- | ------------------------ |
| Method   | `GET`                    |
| URL      | `/api/v1/mailbox/search` |

### Headers

| Header          | Required | Description                                   |
| --------------- | -------- | --------------------------------------------- |
| `Authorization` | Yes      | Bearer authorization token                    |
| `Mailbox`       | Yes      | Current mailbox UUID and contact-list context |

### Query parameters

| Parameter | Type   | Required | Description                                               |
| --------- | ------ | -------- | --------------------------------------------------------- |
| `q`       | string | Yes      | Alias, contact, user email, mailbox name, or mailbox UUID |
| `type`    | string | No       | Restricts the search to `ALIAS` or `UUID`                 |

#### 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

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

| Field         | Type    | Description                                                    |
| ------------- | ------- | -------------------------------------------------------------- |
| `mailboxName` | string  | Mailbox name                                                   |
| `mailboxUuid` | UUID    | Mailbox UUID                                                   |
| `alias`       | string  | Mailbox alias                                                  |
| `accountUuid` | UUID    | Account UUID                                                   |
| `inContacts`  | boolean | Whether the mailbox is saved in the current mailbox’s contacts |

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

### Status codes

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

### Related topics

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