Skip to content

Create Label

POST
/v0/labels
curl -s -X POST "https://api.yoagent.dev/v0/labels" \
-H "Authorization: Bearer $YOAGENT_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"verified","inbox_id":"test@k7m2xq4p.yoagent.email"}'

Make a label of a project (of project_id, or of inbox_id’s project): every inbox of the project shows it. The same name again answers the label there is (200).

Media typeapplication/json
LabelCreate

Make a label of a project: of project_id, or of the project of inbox_id (give one). The same name again answers the label there is.

object
name
required
Name

The label’s name.

string
>= 1 characters <= 64 characters /^[\w.:-]+$/
project_id
Project Id

The project the label belongs to.

Any of:
string
/^prj_[0-7][0-9a-hjkmnp-tv-z]{25}$/
inbox_id
Inbox Id

Or an inbox of that project: its id, address or *@domain (the catch-all).

Any of:

Inbox id (inb_…), address or *@domain (the catch-all)

string

The project has a label of this name already

Media typeapplication/json
LabelOut

A project’s own label.

object
version
required
Version

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

integer
label_id
required
Label Id
string
/^lbl_[0-7][0-9a-hjkmnp-tv-z]{25}$/
project_id
required
Project Id
string
/^prj_[0-7][0-9a-hjkmnp-tv-z]{25}$/
name
required
Name
string

Example

{
"version": 1,
"label_id": "lbl_01je56wqswfmn9pgbc1wq8tjgq",
"project_id": "prj_01je56wqswfmn9pgbc1wq8tjgq",
"name": "verified"
}

Successful Response

Media typeapplication/json
LabelOut

A project’s own label.

object
version
required
Version

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

integer
label_id
required
Label Id
string
/^lbl_[0-7][0-9a-hjkmnp-tv-z]{25}$/
project_id
required
Project Id
string
/^prj_[0-7][0-9a-hjkmnp-tv-z]{25}$/
name
required
Name
string

Example

{
"version": 1,
"label_id": "lbl_01je56wqswfmn9pgbc1wq8tjgq",
"project_id": "prj_01je56wqswfmn9pgbc1wq8tjgq",
"name": "verified"
}

An error (400, 401, 403, 404, 405, 409, 413, 429, 500, 503), in the one shape every call answers: Errors.