---
title: "Create Inbox"
url: "https://docs.yoagent.dev/reference/rest-api/operations/createinbox"
---

# Create Inbox

POST

/v0/inboxes

```sh
curl -s -X POST "https://api.yoagent.dev/v0/inboxes" \
  -H "Authorization: Bearer $YOAGENT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"project_id":"prj_01je56wqswfmn9pgbc1wq8tjgq","username":"signup-test","domain":"mail.example.com","display_name":"Signup tests","client_id":"ci-run-1842"}'
```

```js
const response = await fetch("https://api.yoagent.dev/v0/inboxes", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.YOAGENT_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "project_id": "prj_01je56wqswfmn9pgbc1wq8tjgq",
    "username": "signup-test",
    "domain": "mail.example.com",
    "display_name": "Signup tests",
    "client_id": "ci-run-1842"
  }),
});
if (!response.ok) throw new Error(await response.text());
const data = await response.json();
```

```python
import os

import requests

response = requests.post(
    "https://api.yoagent.dev/v0/inboxes",
    headers={"Authorization": f"Bearer {os.environ['YOAGENT_KEY']}"},
    json={
        "project_id": "prj_01je56wqswfmn9pgbc1wq8tjgq",
        "username": "signup-test",
        "domain": "mail.example.com",
        "display_name": "Signup tests",
        "client_id": "ci-run-1842",
    },
    timeout=60,
)
response.raise_for_status()
data = response.json()
```

- api.yoagent.dev/v0/inboxes

Create an inbox (random username and the shared subdomain unless given).

## Authorizations

- **[ApiKey](https://docs.yoagent.dev/reference/rest-api#apikey)**

## Request Body required

application/json

_InboxCreate_

Create an inbox. Without `username` a random one is picked; without `domain` the project’s shared subdomain; `domain` without `project_id` names the project too.

object

**project_id**

_Project Id_

The project; omitted: the domain’s, else the first project, in the dashboard’s order, where the caller may create it.

Any of:

**string**

string

/^prj\_\[0-7]\[0-9a-hjkmnp-tv-z]{25}$/

**null**

null

**username**

_Username_

The part of the address before `@`; omitted: a random one.

Any of:

**string**

string

\>= 1 characters <= 64 characters /^\[a-z0-9]\(?:\[a-z0-9.\_-]{0,62}\[a-z0-9])?$/

**null**

null

**domain**

_Domain_

The project’s shared subdomain or a custom domain of the organization; omitted: the shared subdomain.

Any of:

**string**

string

**null**

null

**display_name**

_Display Name_

The name its mail is sent under.

Any of:

**string**

string

\>= 1 characters <= 100 characters

**null**

null

**client_id**

_Client Id_

Your idempotency key: creating again with the same `client_id` returns the same inbox.

Any of:

**string**

string

\>= 1 characters <= 100 characters

**null**

null

**metadata**

_Metadata_

Your own data about the inbox, a JSON object of at most 16 KB, answered as given.

Any of:

**object**

object

**_key_**

additional properties

**null**

null

## Responses

### 201

Successful Response

application/json

_InboxOut_

An inbox.

object

**version**

required

_Version_

Goes up by one on every change: of two copies, the one with the higher version is the newer.

integer

**inbox_id**

required

_Inbox Id_

string

/^inb\_\[0-7]\[0-9a-hjkmnp-tv-z]{25}$/

**project_id**

required

_Project Id_

string

/^prj\_\[0-7]\[0-9a-hjkmnp-tv-z]{25}$/

**address**

required

_Address_

Its local part may come from a sender: auto-create makes inboxes for addresses mail arrived at.

string

**is_catch_all**

required

_Is Catch All_

boolean

**display_name**

required

_Display Name_

Set by whoever made the inbox (an agent, too): text from outside, like `metadata` and `client_id`.

Any of:

**string**

string

**null**

null

**metadata**

required

_Metadata_

object

**_key_**

additional properties

**client_id**

required

_Client Id_

Any of:

**string**

string

**null**

null

**deletable**

required

_Deletable_

Whether the caller may delete it (`inbox_delete` on it; never the catch-all).

boolean

**labels_editable**

required

_Labels Editable_

Whether the caller may change the labels of its mail — mark it read or unread, label it (`message_update` on the inbox).

boolean

**labels_manageable**

required

_Labels Manageable_

Whether the caller may rename and delete its project’s own labels (`message_update` on the project: the change reaches every inbox of it).

boolean

**mail_deletable**

required

_Mail Deletable_

Whether the caller may delete its messages and threads (`message_delete` on the inbox).

boolean

**mail_sendable**

required

_Mail Sendable_

Whether the caller may send from it — new mail, replies and forwards of mail it reads (`message_send` on the inbox; never from the catch-all).

boolean

**created_at**

required

_Created At_

string format: date-time

#### Example

```json
{
  "version": 1,
  "inbox_id": "inb_01je56wqswfmn9pgbc1wq8tjgq",
  "project_id": "prj_01je56wqswfmn9pgbc1wq8tjgq",
  "address": "test@k7m2xq4p.yoagent.email",
  "is_catch_all": false,
  "display_name": "Signup tests",
  "metadata": {},
  "client_id": "ci-run-1842",
  "deletable": true,
  "labels_editable": true,
  "labels_manageable": true,
  "mail_deletable": true,
  "mail_sendable": true,
  "created_at": "2026-12-01T12:00:00Z"
}
```

### default

An error (400, 401, 403, 404, 405, 409, 413, 429, 500, 503), in the one shape every call answers: [Errors](https://docs.yoagent.dev/reference/conventions#errors).
