## Update conversation

`PATCH https://whatsapp.paaltech.org/api/v1/businesses/{external_id}/conversations/{id}`

Work the conversation: change its `status` (snoozing needs `snoozed_until`), `priority`
or `tags` (replaced), assign it to an inbox member (`assignee`: the staff member's
`external_id`, or null to unassign), and send `read: true` when your staff have seen its
messages. Changes are announced as `conversation.updated`.

Ability: `conversations.manage`

### Path parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `external_id` | string | yes | Your own ID for the business (Multi-SKUUL - the tenant ID). Max 191 characters. Pattern `^[A-Za-z0-9._:-]+$` |
| `id` | integer | yes | PaalChat's conversation ID. |

### Body

| Name | Type | Required | Description |
|---|---|---|---|
| `status` | string | no | open = needs the business; pending = waiting for the customer (a conversation the business started); an incoming message reopens pending, resolved and snoozed conversations; after closed, the next message starts a new conversation. One of: `open`, `pending`, `resolved`, `closed`, `snoozed` |
| `snoozed_until` | string | null | no | Format date-time |
| `priority` | string | no | One of: `low`, `normal`, `high`, `urgent` |
| `tags` | array of strings | no |  |
| `read` | boolean | no | Always `1` |
| `assignee` | string | null | no | An active inbox member's external_id (sign them in first), or null. |

### Request

```bash
curl --request PATCH \
  --url 'https://whatsapp.paaltech.org/api/v1/businesses/presec/conversations/2' \
  --header "Authorization: Bearer $PAALCHAT_TOKEN" \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{"status": "resolved", "tags": ["fees"], "read": true}'
```

### Responses

- **200** - The updated conversation.
- **401** - unauthenticated - missing, invalid, revoked or expired token

```json
{
  "error": {"code": "unauthenticated", "message": "A valid product token is required."}
}
```

- **403** - missing_ability, product_suspended or product_token_required

```json
{
  "error": {
    "code": "missing_ability",
    "message": "This token does not have the ability this request needs."
  }
}
```

- **404** - not_found - not yours, or does not exist

```json
{"error": {"code": "not_found", "message": "Business not found."}}
```

- **422** - validation_failed, or unknown_member (no active inbox member with that assignee).
- **429** - rate_limited - over 300 requests/minute for this product

```json
{
  "error": {
    "code": "rate_limited",
    "message": "Too many requests. Slow down and retry after the Retry-After header."
  }
}
```

