# delete_mailing_draft

Delete a mailing draft

`DELETE /v1/mailings/{mailing_id}`

| | |
| --- | --- |
| Risk | write |
| Authentication | API key or OAuth access token |
| Scopes | `mailings:write` |
| Idempotency | natural: repeating the call gives the same result |
| Dry run | yes: add dry_run=true to the query |
| Success status | 200 |
| Response type | application/json |

## What it does

- Use when: A draft is no longer wanted; send If-Match with the ETag you last read.
- Do not use when: the mailing is scheduled, sending or sent (cancel_scheduled_mailing for a scheduled one).
- Side effects: Deletes the draft and its content.
- Reversible: No.
- Required scope: mailings:write.
- Idempotency: safe to repeat (same result).
- Typical next step: call list_mailings.

## Scopes

- `mailings:write`: Create, edit and delete draft mailings, and ask for a send to be approved.

## Side effects

- Deletes the draft and its content

## Concurrency

Send the revision you last read in an `If-Match` header. A stale revision returns `revision_mismatch` (HTTP 412) with the current revision.

## Request

### Path parameters

| Field | Type | Description |
| --- | --- | --- |
| `mailing_id` | string |  |

### Query parameters

None.

Every mutation also accepts `dry_run=true`: it runs every check and returns `{"dry_run": true, "would": {...}}` without writing anything.

## Response

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `deleted` | exactly true | yes |  |
| `id` | string | yes |  |

## Examples

### deleted

Request:

```bash
curl -X DELETE 'https://api.seemly.com/v1/mailings/cmp_2c4e6g8j0m2p4r6t8w0y2a4c' \
  -H "Authorization: Bearer $SEEMLY_API_KEY" \
  -H 'If-Match: "1"'
```

Response: `200`:

```json
{
  "deleted": true,
  "id": "cmp_2c4e6g8j0m2p4r6t8w0y2a4c"
}
```

## Errors

| Status | Codes |
| --- | --- |
| 400 | [`validation_failed`](/developers/md/errors/validation_failed) |
| 401 | [`unauthenticated`](/developers/md/errors/unauthenticated), [`credential_revoked`](/developers/md/errors/credential_revoked), [`credential_expired`](/developers/md/errors/credential_expired) |
| 403 | [`insufficient_scope`](/developers/md/errors/insufficient_scope), [`plan_does_not_include`](/developers/md/errors/plan_does_not_include), [`workspace_paused`](/developers/md/errors/workspace_paused), [`api_suspended`](/developers/md/errors/api_suspended), [`consent_required`](/developers/md/errors/consent_required) |
| 404 | [`not_found`](/developers/md/errors/not_found) |
| 409 | [`conflict`](/developers/md/errors/conflict) |
| 412 | [`revision_mismatch`](/developers/md/errors/revision_mismatch) |
| 429 | [`rate_limited`](/developers/md/errors/rate_limited), [`quota_exceeded`](/developers/md/errors/quota_exceeded) |
| 503 | [`service_unavailable`](/developers/md/errors/service_unavailable) |

Every error is an `application/problem+json` body with a `code`, a `fix` sentence and `next_actions`. See [reading a problem response](/developers/md/guides/agents#reading-a-problem-response).

## Typical next steps

- [`list_mailings`](/developers/md/operations/list_mailings)

## Related

- [OpenAPI document](https://api.seemly.com/v1/openapi.json)
- [Agent guide](/developers/md/guides/agents)
