दस्तावेज़ पर जाएँ
API

लेबल

इस समूह का हर ऑपरेशन: वह क्या लेता है, क्या लौटाता है और किन त्रुटियों के साथ जवाब दे सकता है।

ऑपरेशन

The names a conversation can be filed under, several at once. Labels belong to the workspace, so every member and every key sees the same set, and renaming or deleting one changes it for everybody.

A label's id comes from the name it was created with and never changes, so a rename keeps every conversation labelled. Its colour is a hex value or one of seven gradient tokens, and GET /labels/colors lists the palette the app offers. Apply and remove labels on a conversation with PATCH /threads/{id}. GET /threads?folder=USER_BIG_CLIENTS lists every conversation carrying a label, and labelIds narrows a folder to the ones carrying it.

GET/labels

List labels

स्कोपlabels:readपढ़ता है

Every user label in the workspace, sorted by name and then by id, a page at a time: follow nextCursor while hasMore is true to read them all. Each row carries its colour, how many conversations carry it and when it was created and last changed, which is everything the Labels table in the app shows.

System labels such as INBOX, STARRED and UNREAD are not listed. A thread carries them and PATCH /threads/{id} takes them, but they cannot be renamed, recoloured or deleted.

The order the app's sidebar shows is each person's own arrangement and is not exposed here.

Requires the labels:read scope.

क्वेरी पैरामीटर

limitinteger

Rows per page, 1 to 100.

कम से कम 1अधिकतम 100डिफ़ॉल्ट25
cursorstring

The previous page's nextCursor, passed back as it came. It is opaque: it holds where the last row sat in this list's order, so a row deleted or edited between pages never breaks the walk, and the next page starts at the first row that sorts after it. A value this list did not hand out is a 400 invalid_cursor.

लौटाता है

A page of labels, by name.

त्रुटियाँ

वे त्रुटियाँ जो कोई भी ऑपरेशन लौटा सकता है400401403404422500त्रुटि सूची

इनमें भी उपलब्ध

SDK
labels.list()labels.listAll()labels.iterate()
CLI
openemail labels list
MCP
getLabelgetUserLabels

POST/labels

Create a label

स्कोपlabels:writeडेटा बदलता है

Creates a label and answers with it. The id comes from the name (Big Clients becomes USER_BIG_CLIENTS) and never changes afterwards. A workspace holds at most 50 labels.

Leave color out for a label with no colour, or send color.backgroundColor as a hex value or a gradient token. GET /labels/colors lists the swatches the app offers.

Requires the labels:write scope.

अनुरोध बॉडी

namestringआवश्यक

Trimmed, then 1 to 225 characters. Also decides the id, which never changes afterwards.

1 से 225 वर्ण
colorLabelColorInput

The colour. Leave it out for a label with no colour.

लौटाता है

Created, read back as it is stored.

त्रुटियाँ

409

label_name_taken: another label already has that name, compared without case, or already holds the id this name gives because it was created under it and renamed since.

422

label_limit_reached once the workspace holds 50 labels, or invalid_parameter for a colour that is neither a hex value nor a gradient token.

वे त्रुटियाँ जो कोई भी ऑपरेशन लौटा सकता है400401403404500त्रुटि सूची

इनमें भी उपलब्ध

SDK
labels.create()
CLI
openemail labels create
MCP
createLabel

GET/labels/colors

List label colours

स्कोपlabels:readपढ़ता है

The fourteen solid colours and seven gradients the app offers when you make or edit a label, in the order it shows them. Each one says what to send as color.backgroundColor, the ink drawn on it, and for a gradient the colour at each end and one solid hex for places a gradient cannot go.

A fixed catalogue with no paging. Fetch it once and keep it. A label may also carry any other hex, set through this API, which the app keeps and offers back as its own swatch.

Requires the labels:read scope.

लौटाता है

The whole palette.

त्रुटियाँ

वे त्रुटियाँ जो कोई भी ऑपरेशन लौटा सकता है400401403404422500त्रुटि सूची

इनमें भी उपलब्ध

SDK
labels.listColors()
CLI
openemail labels list-colors

GET/labels/{id}

Retrieve a label

स्कोपlabels:readपढ़ता है

One label by id, in the same shape as a row of the list. Ids are matched exactly, and a system id such as INBOX is a 404.

Requires the labels:read scope.

पाथ पैरामीटर

idstringआवश्यक

Label id such as USER_RECEIPTS, matched case sensitively.

लौटाता है

The label.

त्रुटियाँ

वे त्रुटियाँ जो कोई भी ऑपरेशन लौटा सकता है400401403404422500त्रुटि सूची

इनमें भी उपलब्ध

SDK
labels.get()
CLI
openemail labels get
MCP
getLabelgetUserLabels

PATCH/labels/{id}

Rename or recolour a label

स्कोपlabels:writeडेटा बदलता है

Renames a label, recolours it, or both. Send name, color or both; a field left out stays as it is, and color: null or an empty backgroundColor clears the colour. The id never changes, so every conversation keeps the label through a rename.

Requires the labels:write scope.

पाथ पैरामीटर

idstringआवश्यक

Label id such as USER_RECEIPTS.

अनुरोध बॉडी

namestring

The new name, trimmed, 1 to 225 characters. Left out, the name stays.

1 से 225 वर्ण
colorobject

The new colour. null clears it. Left out, the colour stays.

null हो सकता है
backgroundColorstringआवश्यक

A hex colour (#RGB, #RGBA, #RRGGBB or #RRGGBBAA), stored upper-cased, or a gradient token: gradient:sunset, gradient:ember, gradient:meadow, gradient:lagoon, gradient:aurora, gradient:berry, gradient:midnight. The app's solid swatches are #EF4444, #F97316, #EA9602, #DCB30B, #79BB19, #2EB45C, #00AD9B, #09A9CA, #3B82F6, #6366F1, #8B5CF6, #D946EF, #EC4899, #64748B, and any other hex is kept as it is. An empty string means no colour. Anything else is a 422 invalid_parameter on color.backgroundColor.

अधिकतम 32 वर्ण
textColorstring

Accepted and ignored. The ink is worked out from backgroundColor.

अधिकतम 32 वर्ण

लौटाता है

Saved, read back as it is stored.

त्रुटियाँ

409

label_name_taken: another label already has that name, compared without case.

422

invalid_parameter for a body with neither name nor color, or a colour that is neither a hex value nor a gradient token.

वे त्रुटियाँ जो कोई भी ऑपरेशन लौटा सकता है400401403404500त्रुटि सूची

इनमें भी उपलब्ध

SDK
labels.update()
CLI
openemail labels update
MCP
updateLabel

DELETE/labels/{id}

Delete a label

स्कोपlabels:writeहटाता है

Deletes the label and takes it off every conversation that carried it, in one step. The conversations stay in whatever folder they were in. There is no undo: creating the same name again gives the same id, but the conversations do not get the label back.

Requires the labels:write scope.

पाथ पैरामीटर

idstringआवश्यक

Label id such as USER_OLD_PROJECT.

लौटाता है

Deleted.

त्रुटियाँ

वे त्रुटियाँ जो कोई भी ऑपरेशन लौटा सकता है400401403404422500त्रुटि सूची

इनमें भी उपलब्ध

SDK
labels.delete()
CLI
openemail labels delete
MCP
deleteLabel

ऑब्जेक्ट

DeletedLabelobject

objectstring
इनमें से एक"label"
idstring
deletedboolean
इनमें से एकtrue

Labelobject

objectstring
इनमें से एक"label"
idstring

Fixed when the label is created: USER_ and the name upper-cased, with each run of spaces turned into _, so Big Clients is USER_BIG_CLIENTS. It never changes, so a renamed label keeps the id of its first name. Store the id rather than the name.

namestring
typestring

Always user. System labels such as INBOX, STARRED and UNREAD are never listed, though a thread carries them and PATCH /threads/{id} takes them.

इनमें से एक"user"
colorobject

How the label is painted. Null on a label saved with no colour.

null हो सकता है
backgroundColorstring

The stored colour: a hex value such as #3B82F6, stored upper-cased, or a gradient token such as gradient:sunset. GET /labels/colors lists the palette the app offers, with the two ends of every gradient.

textColorstring

The ink the app draws on that colour, #18181B or #FFFFFF. Worked out here from backgroundColor and never stored, so a textColor you sent is not echoed.

threadCountinteger

Conversations carrying the label now, the number the Labels table in the app shows. A key limited to particular addresses counts only conversations delivered to them.

createdAtstring

Null on a label made before these times were recorded.

null हो सकता हैफ़ॉर्मैटdate-time
updatedAtstring

The last rename or recolour. Null on a label made before these times were recorded.

null हो सकता हैफ़ॉर्मैटdate-time

LabelColorEntryobject

objectstring
इनमें से एक"label_color"
kindstring
इनमें से एक"solid""gradient"
namestring

The swatch name, such as red or sunset.

valuestring

What to send as color.backgroundColor to use this swatch.

इनमें से एक"#EF4444""#F97316""#EA9602""#DCB30B""#79BB19""#2EB45C""#00AD9B""#09A9CA""#3B82F6""#6366F1""#8B5CF6""#D946EF""#EC4899""#64748B""gradient:sunset""gradient:ember""gradient:meadow""gradient:lagoon""gradient:aurora""gradient:berry""gradient:midnight"
solidstring

One hex for places a gradient cannot be drawn, such as an icon. The same as value on a solid.

fromstring

Where a gradient starts, drawn at 135 degrees. Null on a solid.

null हो सकता है
tostring

Where a gradient ends. Null on a solid.

null हो सकता है
textColorstring

The ink the app draws on this swatch.

LabelColorInputobject

backgroundColorstringआवश्यक

A hex colour (#RGB, #RGBA, #RRGGBB or #RRGGBBAA), stored upper-cased, or a gradient token: gradient:sunset, gradient:ember, gradient:meadow, gradient:lagoon, gradient:aurora, gradient:berry, gradient:midnight. The app's solid swatches are #EF4444, #F97316, #EA9602, #DCB30B, #79BB19, #2EB45C, #00AD9B, #09A9CA, #3B82F6, #6366F1, #8B5CF6, #D946EF, #EC4899, #64748B, and any other hex is kept as it is. An empty string means no colour. Anything else is a 422 invalid_parameter on color.backgroundColor.

अधिकतम 32 वर्ण
textColorstring

Accepted and ignored. The ink is worked out from backgroundColor.

अधिकतम 32 वर्ण

LabelColorListobject

objectstring
इनमें से एक"list"

LabelListobject

objectstring
इनमें से एक"list"
hasMoreboolean

True when another page follows. Pass nextCursor back as cursor to read it.

nextCursorstring

An opaque cursor for the next page, or null on the last page. Pass it back unchanged.

null हो सकता है