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"}'const response = await fetch("https://api.yoagent.dev/v0/labels", { method: "POST", headers: { Authorization: `Bearer ${process.env.YOAGENT_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ "name": "verified", "inbox_id": "test@k7m2xq4p.yoagent.email" }),});if (!response.ok) throw new Error(await response.text());const data = await response.json();import os
import requests
response = requests.post( "https://api.yoagent.dev/v0/labels", headers={"Authorization": f"Bearer {os.environ['YOAGENT_KEY']}"}, json={ "name": "verified", "inbox_id": "test@k7m2xq4p.yoagent.email", }, timeout=60,)response.raise_for_status()data = response.json()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).
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”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.
Responses
Section titled “Responses”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
project_id
required
Project Id
string
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
project_id
required
Project Id
string
name
required
Name
string
Example
{ "version": 1, "label_id": "lbl_01je56wqswfmn9pgbc1wq8tjgq", "project_id": "prj_01je56wqswfmn9pgbc1wq8tjgq", "name": "verified"}default
Section titled “default”An error (400, 401, 403, 404, 405, 409, 413, 429, 500, 503), in the one shape every call answers: Errors.