# Cambiar un correo

Source: https://won.dev/es/docs/email/messages-update

`PATCH https://api.won.dev/v1/email/messages/{id}`

Cambia el asunto o el texto de un correo que espera aprobación, o que fue aprobado y aún no salió, para esa sola persona. Se revisa como todo correo y vuelve a esperar aprobación. Escríbelo completo: los marcadores ya están llenos. Un seguimiento que responde al correo anterior conserva el asunto de ese hilo. Un cambio posterior de los pasos de la campaña lo deja como quedó. Gratis.

- **Cobro:** Gratis.

Una clave de prueba (`won_test_...`) ejecuta esto en el [sandbox](/es/docs/email#sandbox): no se envía ni se cobra nada.

## Parámetros [#parameters]

`id` va en la ruta. Los demás van en el cuerpo JSON. Las solicitudes `PATCH` también aceptan el encabezado `Idempotency-Key`; consulta [Enviar una solicitud dos veces](/es/docs/email#idempotency).

| Parámetro | Tipo | Obligatorio | Descripción (texto original de la API) |
| --- | --- | --- | --- |
| `id` | string | sí | Email ID, such as `msg_3e5r4k2m9x7p1q8w`. |
| `subject` | string | no | The new subject line. |
| `text` | string | no | The new text, as plain text. The footer and the unsubscribe link are added when it goes out. |

## Respuesta [#response]

Los errores se describen en [Errores](/es/docs/errors).

| Campo | Tipo | Descripción (texto original de la API) |
| --- | --- | --- |
| `data` | object |  |
| `data.id` | string | Message ID, such as `msg_3e5r4k2m9x7p1q8w`. |
| `data.conversation_id` | string | Its conversation with the person, such as `cnv_9x7p1q8w3e5r4k2m`. |
| `data.campaign_id` | string |  |
| `data.recipient_id` | string |  |
| `data.from` | string \| null | The address it went out from: a mailbox of the sender's domains. |
| `data.to` | string |  |
| `data.kind` | `step` \| `reply` \| `single` | `step` of the sequence, `reply` (your answer to a reply), or `single` (an email you sent on its own with `POST /email/messages`). |
| `data.step` | integer \| null | The step, counted from 1. Null for a reply or a single email. |
| `data.version` | integer | Which version of the step went out, counted from 1. |
| `data.status` | `pending_approval` \| `approved` \| `sending` \| `sent` \| `bounced` \| `failed` \| `skipped` | `sent`, `bounced`, or `sending` for the seconds it takes. `failed` and `skipped` did not go out. On a campaign that asks for approval, `pending_approval` waits for a person to approve it, and `approved` waits for its mailbox and the recipient's office hours. |
| `data.subject` | string |  |
| `data.text` | string \| null | What it says, placeholders filled in, without the footer and the quoted email under a follow-up. On one that waits for approval, what will go out. |
| `data.opens` | integer | Opens that look like a person's. Machines that fetch mail to scan it are left out. |
| `data.clicks` | integer |  |
| `data.bounce_type` | `hard` \| `soft` \| null |  |
| `data.attachments` | object[] | The files that went with it. |
| `data.attachments[].filename` | string |  |
| `data.attachments[].content_type` | string |  |
| `data.attachments[].size` | integer | In bytes. |
| `data.sent_at` | string \| null |  |
| `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. |

## Ejemplo [#example]

```bash
curl -X PATCH https://api.won.dev/v1/email/messages/msg_3e5r4k2m9x7p1q8w \
  -H "Authorization: Bearer $WON_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "text": "Hi Dana,\n\nI saw that Harborline Imports imports office seating, and that you opened a warehouse in Savannah. We make mesh task chairs in Leeds and ship to the US in four weeks.\n\nWould a price list be useful?\n\nAlex"
}'
```

```json
{
  "data": {
    "id": "msg_3e5r4k2m9x7p1q8w",
    "conversation_id": "cnv_9x7p1q8w3e5r4k2m",
    "campaign_id": "cmp_7p1q8w3e5r4k2m9x",
    "recipient_id": "rcp_9x7p1q8w3e5r4k2m",
    "from": "alex@northwindseating.example",
    "to": "dana.whitfield@harborline-imports.example",
    "kind": "step",
    "step": 1,
    "version": 1,
    "status": "pending_approval",
    "subject": "Office chairs for Harborline Imports",
    "text": "Hi Dana,\n\nI saw that Harborline Imports imports office seating, and that you opened a warehouse in Savannah. We make mesh task chairs in Leeds and ship to the US in four weeks.\n\nWould a price list be useful?\n\nAlex",
    "opens": 0,
    "clicks": 0,
    "bounce_type": null,
    "attachments": [],
    "sent_at": null
  },
  "notice": null,
  "usage": {
    "cost": 0,
    "balance": 48.08,
    "replayed": false
  }
}
```