# Change a mailbox folder or message flags

Create or rename a native Yahoo/AOL folder, move an existing message, or set read/starred/answered/draft flags. Requires your own connected mailbox, write consent and provider activation. Use folder, uid_validity and uid from a message appearance or received event; never guess them. Supply a stable UUID operation_id. An uncertain outcome must be checked in the mailbox before another operation; never retry with a new ID. Operational use only; no advertising.

Access class: `workspace`.

## Endpoint

`POST /v1/mail-connections/{id}/operation`

## Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| id | path | string | Yes |

## Request body

Content type: `application/json`.

```json
{
  "action": "create_folder",
  "add_flags": [
    "string"
  ],
  "destination": "string",
  "folder": "string",
  "operation_id": "",
  "remove_flags": [
    "string"
  ],
  "uid": 1,
  "uid_validity": 1
}
```

## Responses

### 201

the action's answer

Content type: `application/json`.

```json
{
  "data": {
    "operation_id": "",
    "status": "string"
  },
  "no_advertising": true,
  "source_provider": "string"
}
```

### default

a refusal: `{"error": "<what a person needs to read>"}`. 401 no credential, 402 the plan does not include this, 403 the seat does not, 404 the thing does not exist or is not yours to see.

Content type: `application/json`.

```json
{
  "error": "string"
}
```
