Skip to content

List folders and labels

GET
/v1/grants/{id}/labels
curl --request GET \
--url https://api.inboxcnx.com/v1/grants/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/labels \
--header 'Authorization: Bearer <token>'

Lists the folders and the mailbox’s labels of a grant, with the ones it subscribes, so you can build a folder and label picker with one call. system holds the folders (labels.system on message-v1): those available, the application’s default, the grant’s override (null when it follows the default) and the effective ones. custom holds the mailbox’s own labels and category tabs, read live from the provider (labels.custom on message-v1), as a tree through parentId, with subscribed per label. A subscribed id the mailbox no longer has is listed with missing: true. A grant-scoped token reads its own grant.

Requires the read:messages scope.

id
required
string format: uuid

The folders and labels

Media typeapplication/json
object
system
required
object
available
required
Array<string>
applicationDefault
required
Array<string>
override
required
Array<string> | null
effective
required
Array<string>
custom
required
Array<object>
object
id
required
string
name
required

The last segment of path.

string
path
required

The full name, nested by /, e.g. Clients/Acme.

string
parentId
required
string | null
type
required
string
Allowed values: user category
subscribed
required
boolean
missing
required

A subscribed id the mailbox no longer has. name and path are the id.

boolean

Example

{
"system": {
"available": [
"inbox",
"sent",
"archive",
"drafts",
"junk",
"trash"
],
"applicationDefault": [
"inbox",
"sent"
],
"override": [
"inbox"
],
"effective": [
"inbox"
]
},
"custom": [
{
"id": "Label_7",
"name": "Clients",
"path": "Clients",
"parentId": null,
"type": "user",
"subscribed": false,
"missing": false
},
{
"id": "Label_12",
"name": "Acme",
"path": "Clients/Acme",
"parentId": "Label_7",
"type": "user",
"subscribed": true,
"missing": false
}
]
}

The credential lacks the read:messages scope

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string

Example generated

{
"error": {
"code": "example",
"message": "example"
}
}

No such grant for the caller’s credential

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string

Example generated

{
"error": {
"code": "example",
"message": "example"
}
}

grant_revoked: the grant is revoked. connection_unreadable: the mailbox cannot be asked for its labels

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string

Example generated

{
"error": {
"code": "example",
"message": "example"
}
}