# Decline emails

Source: https://won.dev/docs/email/messages-decline

`POST https://api.won.dev/v1/email/messages/decline`

Declines emails that wait for approval, or were approved and have not gone out: they never go out (`skipped`), and their recipients get nothing more from the campaign (`stopped`, reason `declined`). To send something else instead, change the email with `PATCH /email/messages/{id}`. A key that is set to ask for approval cannot decline (`forbidden`). Free.

- **Billing:** Free.

A test key (`won_test_...`) runs this in the [sandbox](/docs/email#sandbox): nothing is sent and nothing is charged.

## Parameters [#parameters]

Parameters go in the JSON body. `POST` requests also take an `Idempotency-Key` header, see [Sending a request twice](/docs/email#idempotency).

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `message_ids` | string[] | yes | Up to 100 email IDs, such as `msg_3e5r4k2m9x7p1q8w`, from `GET /email/messages?status=pending_approval`. |

## Response [#response]

Errors are described in [Errors](/docs/errors).

| Field | Type | Description |
| --- | --- | --- |
| `data` | object[] | One result per ID, in the order given. |
| `data[].id` | string |  |
| `data[].done` | boolean | Whether this call changed it. |
| `data[].status` | `pending_approval` \| `approved` \| `sending` \| `sent` \| `bounced` \| `failed` \| `skipped` \| null | Its status now. Null for an ID this account has no email with, or one of the other kind of key. |
| `notice` | string \| null | A plain sentence when there is something to know about this answer. Null otherwise. |
| `usage` | object | Nothing is charged here. The balance, for reference. |
| `usage.cost` | number | What this call cost, in US dollars. |
| `usage.balance` | number | The balance left after this call, in US dollars. |
| `usage.replayed` | boolean | True when this is a repeat of a request from the last 24 hours. Repeats are free. |

## Example [#example]

```bash
curl https://api.won.dev/v1/email/messages/decline \
  -H "Authorization: Bearer $WON_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "message_ids": [
    "msg_3e5r4k2m9x7p1q8w"
  ]
}'
```

```json
{
  "data": [
    {
      "id": "msg_3e5r4k2m9x7p1q8w",
      "done": true,
      "status": "skipped"
    }
  ],
  "notice": null,
  "usage": {
    "cost": 0,
    "balance": 48.08,
    "replayed": false
  }
}
```