Skip to content
English

Actions with messages

POST/v1/mailboxes/{mailbox_id}/messages/actions

Applies an action to selected messages in one folder. Pass their IDs to uids, the folder name to folder and its uidvalidity. For action=move, also specify the target folder to destination.

Authentication and access · Errors and retries

Request

Terminal window
curl -X POST 'https://adapt-mail.com/v1/mailboxes/<mailbox_id>/messages/actions' \
-H 'Authorization: Bearer <access_token>' \
-H 'Content-Type: application/json' \
--data '{"folder":"INBOX","uidvalidity":1,"uids":[1],"action":"read"}'

Parameters

mailbox_idpathNecessarily

integer

X-Customer-IDheader
Option 1

string

Option 2

null

Request body · application/json

object

folderNecessarily

string

Folder name from the folder list, for example INBOX.

minLength: 1

maxLength: 255

uidvalidityNecessarily

integer

The value is uidvalidity from the response API for this folder.

exclusiveMinimum: 0

uidsNecessarily

array

Identifiers of selected letters from one folder.

minItems: 1

maxItems: 100

Array elements

integer

actionNecessarily

string

Valid values: "read" "unread" "star" "unstar" "move" "delete"

destination

Target folder name. Required for action=move.

Option 1

string

maxLength: 255

Option 2

null

Unknown fields are not accepted.

Responses

200 Successful response

application/json

object

updated

boolean

401 Login required

application/json

object

detail
Option 1

string

Option 2

object

code

string

message

string

Option 3

array

Array elements

object

403 No access

application/json

object

detail
Option 1

string

Option 2

object

code

string

message

string

Option 3

array

Array elements

object

404 Resource not found

application/json

object

detail
Option 1

string

Option 2

object

code

string

message

string

Option 3

array

Array elements

object

409 State conflict

application/json

object

detail
Option 1

string

Option 2

object

code

string

message

string

Option 3

array

Array elements

object

422 Validation error

application/json

object

detail

array

Array elements

object

locNecessarily

array

Array elements
Option 1

string

Option 2

integer

msgNecessarily

string

typeNecessarily

string

503 Temporarily unavailable

application/json

object

detail
Option 1

string

Option 2

object

code

string

message

string

Option 3

array

Array elements

object