Skip to content

Update messages in bulk

POST
/v1/messages/batch
curl --request POST \
--url https://api.inboxcnx.com/v1/messages/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "ids": [ "c4a7e2b9-1d3f-4e6a-8b0c-5f2d9e7a1b34", "f0e1d2c3-b4a5-4968-8776-5a4b3c2d1e0f" ], "keywords": { "$seen": true } }'

Changes the read state, flags, archive and labels of up to 100 messages of one grant in one call, for bulk actions such as mark all as read. Same rules as PATCH /v1/messages/{id}. An unknown id refuses the whole request before any change. failed lists the messages the provider refused while it took the others.

Requires the modify:messages scope.

Media typeapplication/json
object
ids
required
Array<string>
>= 1 items <= 100 items
keywords
object
key
additional properties
boolean
labels
object
add
Array<string>
<= 100 items
remove
Array<string>
<= 100 items

Example

{
"ids": [
"c4a7e2b9-1d3f-4e6a-8b0c-5f2d9e7a1b34",
"f0e1d2c3-b4a5-4968-8776-5a4b3c2d1e0f"
],
"keywords": {
"$seen": true
}
}

How many changed

Media typeapplication/json
object
updated
required
integer
failed
required
Array<object>
object
id
required
string
code
required
string

Example generated

{
"updated": 1,
"failed": [
{
"id": "example",
"code": "example"
}
]
}

Invalid body. mixed_grants: the ids belong to more than one grant. unknown_labels: the mailbox has no label with these ids

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

Example generated

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

The credential lacks the modify:messages scope

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

Example generated

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

messages_not_found: ids lists the unknown ones. provider_message_not_found: the provider no longer has one of them

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

Example generated

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

message_deleted: the mail is deleted at the provider. connection_unreadable: the mailbox cannot be reached and may need a reconnect. connection_scope_missing: the end user did not grant the scope the action needs, named in scope. A reconnect grants it

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

Example generated

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

provider_unavailable: the provider is down or rate-limits the mailbox. Retry after Retry-After seconds

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

Example generated

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