## Simulate a delivery status

`POST https://whatsapp.paaltech.org/api/v1/businesses/{external_id}/sandbox/messages/{id}/status`

Test keys only. Meta reports `delivered`, `read` or `failed` for a message you sent in
the sandbox: it goes through the live path and fires `message.status`. Statuses only move
forward, as live.

Ability: `messages.send`

### 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 message ID. |

### Body

| Name | Type | Required | Description |
|---|---|---|---|
| `status` | string | yes | One of: `delivered`, `read`, `failed` |
| `error` | object | null | no | For failed - the code and message to report. |
| `error.code` | string | no |  |
| `error.message` | string | no |  |

### Request

```bash
curl --request POST \
  --url 'https://whatsapp.paaltech.org/api/v1/businesses/presec/sandbox/messages/2/status' \
  --header "Authorization: Bearer $PAALCHAT_TOKEN" \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{"status": "delivered"}'
```

### Responses

- **200** - The message, with its new status.
- **401** - unauthenticated - missing, invalid, revoked or expired token

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

- **403** - missing_ability, or sandbox_only (a live key).
- **404** - not_found - not yours, or does not exist

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

- **409** - sandbox_not_sent - only sent outgoing messages get statuses.
- **422** - validation_failed - fields are invalid; see errors.

```json
{
  "error": {
    "code": "validation_failed",
    "message": "The external id field format is invalid. (and 1 more error)"
  },
  "errors": {
    "external_id": ["The external id field format is invalid."],
    "name": ["The name field is required."]
  }
}
```

- **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."
  }
}
```

