# Límites y errores

{% hint style="warning" %}
**SERVICIO DISCONTINUADO**

La API de envíos transaccionales ya no está disponible para nuevas suscripciones.&#x20;

Para las suscripciones activas, **el servicio será discontinuado en su totalidad el día 1/3/2026.**
{% endhint %}

## Límites

### Longitudes máximas

| Campo                      | Longitud máxima por elemento | Cantidad máxima |
| -------------------------- | ---------------------------- | --------------- |
| `subject`                  | 200 chars                    | -               |
| `recipients[]`             | -                            | 1000            |
| `cc[]`                     | -                            | 10              |
| `bcc[]`                    | -                            | 10              |
| `name` (from, to, cc, bcc) | 100 chars                    | -               |
| `headers[]`                | -                            | 10              |
| `headers[].key`            | 900 chars                    | -               |
| `headers[].value`          | 50 chars                     | -               |
| `tags[]`                   | 100 chars                    | 10              |
| `batch_code`               | 30 chars                     | -               |
| `content.html`             | 300KB                        |                 |
| `content.text`             | 300KB                        |                 |

### Tamaño total por request

El tamaño total de cada request no puede superar los 10MB.

### Tamaño de archivos adjuntos

Los archivos adjuntos se consideran como parte del mensaje, por lo que suman para el límite total de 10MB.

## Errores

Si ocurrió algo que impidió completar con éxito un pedido, la respuesta tiene esta forma:&#x20;

```javascript
{
    "success": false,
    "error": {
        "status": 403,
        "type": "forbidden",
        "message": "Origin IP address not allowed: 190.19.245.237"
    }
}
```

### Tipos de errores

El `type` puede ser alguno de estos:

| Status | error.type              | Descripción                                                                   |
| ------ | ----------------------- | ----------------------------------------------------------------------------- |
| 400    | `bad_request`           | El contenido del request tiene un formato inválido.                           |
| 400    | `validation_error`      | Algunos de los campos tienen contenido inválido.                              |
| 401    | `unauthorized`          | El API key utilizado es inválido o no se especificó.                          |
| 403    | `forbidden`             | El request fue bloqueado. La causa se especifica en message.                  |
| 500    | `internal_server_error` | Ocurrió un error inesperado en el servidor.                                   |
| 503    | `service_unavailable`   | El servicio no está disponible. Generalmente por límites temporales de envío. |

### Límite alcanzado

En caso de alcanzar el límite mensual, el pedido será rechazadao, indicando un error de tipo `503 service_unavailable` como este:

```javascript
{
    "success": false,
    "error": {
        "status": 503,
        "type": "service_unavailable",
        "message": "Sending limit reached: MONTHLY"
    }
}
```

### Errores de validación

Cuando `type` es `validation_error`, se incluye un objeto `errors` con todos los errores de validación encontrados:

```javascript
{
    "success": false,
    "error": {
        "status": 400,
        "type": "validation_error",
        "message": "Some fields have invalid values"
        "errors": {
            "from.email": "required"
        }
    }
}
```

Los tipos de error de validación pueden ser:

| Error                   | Descripción                                                              |
| ----------------------- | ------------------------------------------------------------------------ |
| `required`              | El campo es requerido.                                                   |
| `required_at_least_one` | Se debe incluir al menos un elemento en el campo de tipo array.          |
| `max_length_exceeded`   | Se excedió la longitud máximo en un campo de tipo string.                |
| `too_many_items`        | Se excedió la cantidad permitida de elementos en un campo de tipo array. |
| `invalid_value`         | El valor indicado tiene un formato inválido.                             |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.myperfit.com/transactional-api/limites-y-errores.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
