# Agregar destinatarios

Source: https://won.dev/es/docs/email/recipients-add

`POST https://api.won.dev/v1/email/campaigns/{id}/recipients`

Agrega hasta 1000 personas a una campaña, en cualquier momento antes de que termine. Cada dirección se revisa mientras esperas (formato, listas de supresión, si la persona ya está en otra de tus campañas en curso, reglas por región, valores faltantes de los marcadores), y la respuesta lista cada dirección que quedó fuera, con el motivo. Luego se verifica que las direcciones aceptadas tengan un buzón que exista: las primeras 50 de la campaña en unos minutos, las demás alrededor de un día antes de su primer correo, así que una lista larga no se revisa con meses de anticipación. Las que no pasan quedan como `invalid`. Enviar la misma lista dos veces no cambia nada. Un destinatario puede ser cualquier persona que un endpoint te devolvió con un correo: pasa su ID `per_` como `contact_id` en lugar de la dirección. Gratis.

- **Cobro:** La llamada es gratis, y los correos también: salen de los dominios de envío del remitente, que se pagan por mes; consulta [Dominios de envío](/es/docs/email#domains).

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 `POST` 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í | Campaign ID, such as `cmp_7p1q8w3e5r4k2m9x`. |
| `recipients` | object[] | sí | Up to 1000 people to add. Each needs `email` or `contact_id`. |
| `recipients[].email` | string | no | The person's work email. |
| `recipients[].contact_id` | string | no | A person ID this account was given in the last 90 days, such as `per_8f3k2m9x4p1q`, instead of `email`: from a contact search, a people search, or any endpoint that returns a person. Their email, name, company and country on file are used. A person found without an email needs one first: `POST /enrich/people/email/find` with `person_id`. |
| `recipients[].first_name` | string | no | The person's first name, for `{{first_name}}`. |
| `recipients[].last_name` | string | no | The person's last name, for `{{last_name}}`. |
| `recipients[].company` | string | no | The company the person works at, for `{{company}}`. |
| `recipients[].country` | string | no | Where the person is, as an ISO code such as `US`. It decides their office hours and which rules apply. Guessed from the address when left out. An address that shows a country itself, such as one ending in `.de`, stays under that country's rules whatever is given here. |
| `recipients[].timezone` | string | no | The person's IANA time zone, when you know it better than the country says. |
| `recipients[].variables` | object | no | Values for your own placeholders, such as `{ "product": "mesh chairs" }` for `{{product}}`. Names are lowercase letters, digits and underscores. |
| `recipients[].metadata` | object | no | Your own keys and values, such as `{"customer_id": "c_812"}`: up to 20 keys of at most 40 characters, each value a string of at most 500. Returned with the recipient, and in the events about them over the campaign's keys of the same name. |
| `dry_run` | boolean | no | Only check the list and say what would happen. Nothing is added. Default: `false`. |

## Respuesta [#response]

Con `dry_run: true` no se crea ni se cambia nada: la respuesta tiene los mismos campos y dice qué pasaría. Los errores se describen en [Errores](/es/docs/errors).

| Campo | Tipo | Descripción (texto original de la API) |
| --- | --- | --- |
| `data` | object | What became of each address. |
| `data.accepted` | integer | Addresses taken into the campaign. |
| `data.duplicates` | integer | Addresses that were in the campaign already. Nothing changed for them. |
| `data.rejected` | integer | Addresses left out. `results` says why for each. |
| `data.results` | object[] | One entry for each address that was rejected, was a duplicate, or was accepted with a warning. Addresses accepted without remark are only counted. |
| `data.results[].email` | string \| null |  |
| `data.results[].status` | `accepted` \| `duplicate` \| `rejected` |  |
| `data.results[].recipient_id` | string \| null |  |
| `data.results[].reason` | string \| null | Why it was rejected: `invalid_address`, `blocked_mailbox`, `duplicate_in_request`, `suppressed`, `complained`, `undeliverable`, `active_in_other_campaign`, `region_blocked`, `region_not_declared`, `personal_mailbox_in_region`, `missing_variable`, `contact_not_found` or `campaign_full`. |
| `data.results[].message` | string \| null | The same in a sentence, with what to do about it. |
| `data.results[].warnings` | string[] | For an accepted address: `shared_mailbox` (such as info@, read by whoever is on duty) or `personal_mailbox` (a private mail service). |
| `data.dry_run` | boolean | True when nothing was added: the answer to `dry_run: true`. |
| `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 https://api.won.dev/v1/email/campaigns/cmp_7p1q8w3e5r4k2m9x/recipients \
  -H "Authorization: Bearer $WON_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "recipients": [
    {
      "email": "sam.ortiz@brightdesk.example",
      "first_name": "Sam",
      "company": "Brightdesk"
    },
    {
      "email": "noreply@brightdesk.example",
      "company": "Brightdesk"
    }
  ]
}'
```

```json
{
  "data": {
    "dry_run": false,
    "accepted": 1,
    "duplicates": 0,
    "rejected": 1,
    "results": [
      {
        "email": "noreply@brightdesk.example",
        "status": "rejected",
        "recipient_id": null,
        "reason": "blocked_mailbox",
        "message": "This mailbox is not read by a person (such as noreply@ or postmaster@).",
        "warnings": []
      }
    ]
  },
  "notice": null,
  "usage": {
    "cost": 0,
    "balance": 48.08,
    "replayed": false
  }
}
```