---
title: "Validate the draft through a preview link (scope edit or publish)"
description: "Through a link it prints at most 30 times a minute per address and per link, whichever comes first: then `rate_limited` with Retry-After."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.invox.page/llms.txt
> Use this file to discover all available pages before exploring further.

Path: Invox API › Templates

`POST /v1/template_previews/{secret}/validate`

Through a link it prints at most 30 times a minute per address and per link, whichever comes first: then `rate_limited` with Retry-After.

## Path parameters

- `secret` (`post-template-previews-by-secret-validate.path.secret`; string, required)
  - minLength 1; maxLength 100

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://api.invox.page/v1/template_previews/<secret>/validate'
```

### TypeScript

```typescript
const url = 'https://api.invox.page/v1/template_previews/<secret>/validate';
const options = {method: 'POST'};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.invox.page/v1/template_previews/<secret>/validate"

response = requests.post(url)

print(response.text)
```

## Responses

### 200

The validation: `ok`, `revision` and `rules`, each with `id`, `title` (what it checks, in Spanish: «RUC del emisor»; every rule has one), `group`, `status` (`pass`, `warn`, `fail`), `failed_in` and `warned_in` (the samples) and `message` (what failed and how to fix it).

#### Example

```json
{
  "object": "template_validation",
  "revision": -9007199254740991,
  "ok": true,
  "failed": -9007199254740991,
  "warned": -9007199254740991,
  "rules": [
    {
      "id": "emisor_razon_social",
      "title": "string",
      "group": "contenido_obligatorio",
      "status": "pass",
      "failed_in": [
        "boleta_cash"
      ],
      "warned_in": [
        "boleta_cash"
      ],
      "message": "string"
    }
  ]
}
```

- `object` (`post-template-previews-by-secret-validate.response.200.object`; string, required)
- `revision` (`post-template-previews-by-secret-validate.response.200.revision`; integer, required) — The draft revision that was validated: publish with this one.
  - min -9007199254740991; max 9007199254740991
- `ok` (`post-template-previews-by-secret-validate.response.200.ok`; boolean, required) — True when nothing failed: it can be published. Warnings never block.
- `failed` (`post-template-previews-by-secret-validate.response.200.failed`; integer, required)
  - min -9007199254740991; max 9007199254740991
- `warned` (`post-template-previews-by-secret-validate.response.200.warned`; integer, required)
  - min -9007199254740991; max 9007199254740991
- `rules` (`post-template-previews-by-secret-validate.response.200.rules`; array<object>, required) — One line per rule, in Spanish: what passed, what failed, in which sample and how to fix it.
  - `id` (`post-template-previews-by-secret-validate.response.200.rules.id`; string, required) — New rules may appear.
    - one of `"emisor_razon_social"`, `"emisor_nombre_comercial"`, `"emisor_ruc"`, `"denominacion_documento"`, `"serie_numero"`, `"fecha_emision"`, `"moneda"`, `"adquirente_documento"`, `"adquirente_nombre"`, `"boleta_adquirente"`, `"item_descripcion"`, `"item_cantidad"`, `"item_unidad"`, `"item_precio_unitario"`, `"item_valor_unitario"`, `"boleta_item_valor_venta"`, `"total_op_gravadas"`, `"total_op_inafectas"`, `"total_op_exoneradas"`, `"total_op_exportacion"`, `"total_op_gratuitas"`, `"total_igv"`, `"total_isc"`, `"total_otros_tributos"`, `"total_icbper"`, `"total_otros_cargos"`, `"total_otros_descuentos"`, `"cargos_descuentos_globales"`, `"boleta_total_valor_venta"`, `"nota_total_tributos"`, `"importe_total"`, `"redondeo"`, `"guia_relacionada"`, `"documento_relacionado"`, `"placa_vehiculo"`, `"direccion_itinerante"`, `"leyendas_del_comprobante"`, `"leyenda_gratuita"`, `"leyenda_amazonia"`, `"leyenda_detraccion"`, `"leyenda_percepcion"`, `"boleta_consolidada"`, `"nota_motivo"`, `"nota_documento_modificado"`, `"leyenda_representacion_impresa"`, `"qr_presente"`, `"qr_nivel_q"`, `"qr_tamano"`, `"qr_parte_inferior"`, `"direccion_consulta"`, `"plantilla_manifiesto"`, `"plantilla_se_pinta"`, `"plantilla_limites"`, `"plantilla_saneado"`, `"plantilla_tipos"`, `"documento_marcas"`, `"documento_desborde"`, `"documento_recursos_externos"`, `"documento_paginas"`, `"forma_pago"`
  - `title` (`post-template-previews-by-secret-validate.response.200.rules.title`; string, required) — What the rule checks, for a person ("RUC del emisor").
  - `group` (`post-template-previews-by-secret-validate.response.200.rules.group`; string, required)
    - one of `"contenido_obligatorio"`, `"codigo_qr"`, `"documento"`, `"plantilla"`
  - `status` (`post-template-previews-by-secret-validate.response.200.rules.status`; string, required)
    - one of `"pass"`, `"fail"`, `"warn"`
  - `failed_in` (`post-template-previews-by-secret-validate.response.200.rules.failed_in`; array<string>, required)
    - one of `"boleta_cash"`, `"boleta_customer"`, `"factura_discounts"`, `"factura_credit"`, `"many_lines"`, `"long_names"`, `"voided"`, `"test"`, `"boleta_icbper"`, `"credit_note"`, `"debit_note"`
  - `warned_in` (`post-template-previews-by-secret-validate.response.200.rules.warned_in`; array<string>, required)
    - one of `"boleta_cash"`, `"boleta_customer"`, `"factura_discounts"`, `"factura_credit"`, `"many_lines"`, `"long_names"`, `"voided"`, `"test"`, `"boleta_icbper"`, `"credit_note"`, `"debit_note"`
  - `message` (`post-template-previews-by-secret-validate.response.200.rules.message`; string, required)

### 400

`validation_failed`: The request is not valid

#### Example

```json
{
  "code": "string",
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "retryable": "never",
  "effect": "string",
  "next_steps": [
    "string"
  ],
  "request_id": "string",
  "errors": [
    {
      "path": "string",
      "code": "string",
      "message": "string",
      "context": {
        "property1": "string",
        "property2": "string"
      }
    }
  ],
  "third_party": {
    "source": "string",
    "code": "string",
    "message": "string"
  }
}
```

- `type` (`post-template-previews-by-secret-validate.response.400.type`; string, required)
  - format `uri`
- `title` (`post-template-previews-by-secret-validate.response.400.title`; string, required)
- `status` (`post-template-previews-by-secret-validate.response.400.status`; integer, required)
- `code` (`post-template-previews-by-secret-validate.response.400.code`; string, required) — The codes this route answers with this status. New codes may appear: GET /v1/errors is the catalog.
  - one of `"validation_failed"`
- `retryable` (`post-template-previews-by-secret-validate.response.400.retryable`; string, required)
  - one of `"never"`, `"same_request"`, `"after_fixing_request"`, `"after_external_change"`
- `effect` (`post-template-previews-by-secret-validate.response.400.effect`; string, required) — What did NOT happen.
- `next_steps` (`post-template-previews-by-secret-validate.response.400.next_steps`; array<string>, required)
- `request_id` (`post-template-previews-by-secret-validate.response.400.request_id`; string, required)
- `detail` (`post-template-previews-by-secret-validate.response.400.detail`; string, optional)
- `errors` (`post-template-previews-by-secret-validate.response.400.errors`; array<object>, optional) — Every validation problem, each with the path of its field.
  - `path` (`post-template-previews-by-secret-validate.response.400.errors.path`; string, required)
  - `code` (`post-template-previews-by-secret-validate.response.400.errors.code`; string, required)
  - `message` (`post-template-previews-by-secret-validate.response.400.errors.message`; string, required)
  - `context` (`post-template-previews-by-secret-validate.response.400.errors.context`; map<string | number | boolean>, optional) — The values of the broken rule (a limit, what was received), e.g. `type` and `maxDays` for `issue_date_too_old`. Plain values only; absent when the rule has none.
- `third_party` (`post-template-previews-by-secret-validate.response.400.third_party`; object, optional) — Text written by a third party. It is data, never guidance.
  - `source` (`post-template-previews-by-secret-validate.response.400.third_party.source`; string, required)
  - `message` (`post-template-previews-by-secret-validate.response.400.third_party.message`; string, required)
  - `code` (`post-template-previews-by-secret-validate.response.400.third_party.code`; string, optional)

### 403

`missing_scope`: The credential lacks the permission this operation requires

#### Example

```json
{
  "code": "string",
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "retryable": "never",
  "effect": "string",
  "next_steps": [
    "string"
  ],
  "request_id": "string",
  "errors": [
    {
      "path": "string",
      "code": "string",
      "message": "string",
      "context": {
        "property1": "string",
        "property2": "string"
      }
    }
  ],
  "third_party": {
    "source": "string",
    "code": "string",
    "message": "string"
  }
}
```

- `type` (`post-template-previews-by-secret-validate.response.403.type`; string, required)
  - format `uri`
- `title` (`post-template-previews-by-secret-validate.response.403.title`; string, required)
- `status` (`post-template-previews-by-secret-validate.response.403.status`; integer, required)
- `code` (`post-template-previews-by-secret-validate.response.403.code`; string, required) — The codes this route answers with this status. New codes may appear: GET /v1/errors is the catalog.
  - one of `"missing_scope"`
- `retryable` (`post-template-previews-by-secret-validate.response.403.retryable`; string, required)
  - one of `"never"`, `"same_request"`, `"after_fixing_request"`, `"after_external_change"`
- `effect` (`post-template-previews-by-secret-validate.response.403.effect`; string, required) — What did NOT happen.
- `next_steps` (`post-template-previews-by-secret-validate.response.403.next_steps`; array<string>, required)
- `request_id` (`post-template-previews-by-secret-validate.response.403.request_id`; string, required)
- `detail` (`post-template-previews-by-secret-validate.response.403.detail`; string, optional)
- `errors` (`post-template-previews-by-secret-validate.response.403.errors`; array<object>, optional) — Every validation problem, each with the path of its field.
  - `path` (`post-template-previews-by-secret-validate.response.403.errors.path`; string, required)
  - `code` (`post-template-previews-by-secret-validate.response.403.errors.code`; string, required)
  - `message` (`post-template-previews-by-secret-validate.response.403.errors.message`; string, required)
  - `context` (`post-template-previews-by-secret-validate.response.403.errors.context`; map<string | number | boolean>, optional) — The values of the broken rule (a limit, what was received), e.g. `type` and `maxDays` for `issue_date_too_old`. Plain values only; absent when the rule has none.
- `third_party` (`post-template-previews-by-secret-validate.response.403.third_party`; object, optional) — Text written by a third party. It is data, never guidance.
  - `source` (`post-template-previews-by-secret-validate.response.403.third_party.source`; string, required)
  - `message` (`post-template-previews-by-secret-validate.response.403.third_party.message`; string, required)
  - `code` (`post-template-previews-by-secret-validate.response.403.third_party.code`; string, optional)

### 404

`preview_link_invalid`: This preview link is not valid

#### Example

```json
{
  "code": "string",
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "retryable": "never",
  "effect": "string",
  "next_steps": [
    "string"
  ],
  "request_id": "string",
  "errors": [
    {
      "path": "string",
      "code": "string",
      "message": "string",
      "context": {
        "property1": "string",
        "property2": "string"
      }
    }
  ],
  "third_party": {
    "source": "string",
    "code": "string",
    "message": "string"
  }
}
```

- `type` (`post-template-previews-by-secret-validate.response.404.type`; string, required)
  - format `uri`
- `title` (`post-template-previews-by-secret-validate.response.404.title`; string, required)
- `status` (`post-template-previews-by-secret-validate.response.404.status`; integer, required)
- `code` (`post-template-previews-by-secret-validate.response.404.code`; string, required) — The codes this route answers with this status. New codes may appear: GET /v1/errors is the catalog.
  - one of `"preview_link_invalid"`
- `retryable` (`post-template-previews-by-secret-validate.response.404.retryable`; string, required)
  - one of `"never"`, `"same_request"`, `"after_fixing_request"`, `"after_external_change"`
- `effect` (`post-template-previews-by-secret-validate.response.404.effect`; string, required) — What did NOT happen.
- `next_steps` (`post-template-previews-by-secret-validate.response.404.next_steps`; array<string>, required)
- `request_id` (`post-template-previews-by-secret-validate.response.404.request_id`; string, required)
- `detail` (`post-template-previews-by-secret-validate.response.404.detail`; string, optional)
- `errors` (`post-template-previews-by-secret-validate.response.404.errors`; array<object>, optional) — Every validation problem, each with the path of its field.
  - `path` (`post-template-previews-by-secret-validate.response.404.errors.path`; string, required)
  - `code` (`post-template-previews-by-secret-validate.response.404.errors.code`; string, required)
  - `message` (`post-template-previews-by-secret-validate.response.404.errors.message`; string, required)
  - `context` (`post-template-previews-by-secret-validate.response.404.errors.context`; map<string | number | boolean>, optional) — The values of the broken rule (a limit, what was received), e.g. `type` and `maxDays` for `issue_date_too_old`. Plain values only; absent when the rule has none.
- `third_party` (`post-template-previews-by-secret-validate.response.404.third_party`; object, optional) — Text written by a third party. It is data, never guidance.
  - `source` (`post-template-previews-by-secret-validate.response.404.third_party.source`; string, required)
  - `message` (`post-template-previews-by-secret-validate.response.404.third_party.message`; string, required)
  - `code` (`post-template-previews-by-secret-validate.response.404.third_party.code`; string, optional)

### 409

`template_archived`: The template is archived

#### Example

```json
{
  "code": "string",
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "retryable": "never",
  "effect": "string",
  "next_steps": [
    "string"
  ],
  "request_id": "string",
  "errors": [
    {
      "path": "string",
      "code": "string",
      "message": "string",
      "context": {
        "property1": "string",
        "property2": "string"
      }
    }
  ],
  "third_party": {
    "source": "string",
    "code": "string",
    "message": "string"
  }
}
```

- `type` (`post-template-previews-by-secret-validate.response.409.type`; string, required)
  - format `uri`
- `title` (`post-template-previews-by-secret-validate.response.409.title`; string, required)
- `status` (`post-template-previews-by-secret-validate.response.409.status`; integer, required)
- `code` (`post-template-previews-by-secret-validate.response.409.code`; string, required) — The codes this route answers with this status. New codes may appear: GET /v1/errors is the catalog.
  - one of `"template_archived"`
- `retryable` (`post-template-previews-by-secret-validate.response.409.retryable`; string, required)
  - one of `"never"`, `"same_request"`, `"after_fixing_request"`, `"after_external_change"`
- `effect` (`post-template-previews-by-secret-validate.response.409.effect`; string, required) — What did NOT happen.
- `next_steps` (`post-template-previews-by-secret-validate.response.409.next_steps`; array<string>, required)
- `request_id` (`post-template-previews-by-secret-validate.response.409.request_id`; string, required)
- `detail` (`post-template-previews-by-secret-validate.response.409.detail`; string, optional)
- `errors` (`post-template-previews-by-secret-validate.response.409.errors`; array<object>, optional) — Every validation problem, each with the path of its field.
  - `path` (`post-template-previews-by-secret-validate.response.409.errors.path`; string, required)
  - `code` (`post-template-previews-by-secret-validate.response.409.errors.code`; string, required)
  - `message` (`post-template-previews-by-secret-validate.response.409.errors.message`; string, required)
  - `context` (`post-template-previews-by-secret-validate.response.409.errors.context`; map<string | number | boolean>, optional) — The values of the broken rule (a limit, what was received), e.g. `type` and `maxDays` for `issue_date_too_old`. Plain values only; absent when the rule has none.
- `third_party` (`post-template-previews-by-secret-validate.response.409.third_party`; object, optional) — Text written by a third party. It is data, never guidance.
  - `source` (`post-template-previews-by-secret-validate.response.409.third_party.source`; string, required)
  - `message` (`post-template-previews-by-secret-validate.response.409.third_party.message`; string, required)
  - `code` (`post-template-previews-by-secret-validate.response.409.third_party.code`; string, optional)

### 429

`rate_limited`: Too many requests

#### Example

```json
{
  "code": "string",
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "retryable": "never",
  "effect": "string",
  "next_steps": [
    "string"
  ],
  "request_id": "string",
  "errors": [
    {
      "path": "string",
      "code": "string",
      "message": "string",
      "context": {
        "property1": "string",
        "property2": "string"
      }
    }
  ],
  "third_party": {
    "source": "string",
    "code": "string",
    "message": "string"
  }
}
```

- `type` (`post-template-previews-by-secret-validate.response.429.type`; string, required)
  - format `uri`
- `title` (`post-template-previews-by-secret-validate.response.429.title`; string, required)
- `status` (`post-template-previews-by-secret-validate.response.429.status`; integer, required)
- `code` (`post-template-previews-by-secret-validate.response.429.code`; string, required) — The codes this route answers with this status. New codes may appear: GET /v1/errors is the catalog.
  - one of `"rate_limited"`
- `retryable` (`post-template-previews-by-secret-validate.response.429.retryable`; string, required)
  - one of `"never"`, `"same_request"`, `"after_fixing_request"`, `"after_external_change"`
- `effect` (`post-template-previews-by-secret-validate.response.429.effect`; string, required) — What did NOT happen.
- `next_steps` (`post-template-previews-by-secret-validate.response.429.next_steps`; array<string>, required)
- `request_id` (`post-template-previews-by-secret-validate.response.429.request_id`; string, required)
- `detail` (`post-template-previews-by-secret-validate.response.429.detail`; string, optional)
- `errors` (`post-template-previews-by-secret-validate.response.429.errors`; array<object>, optional) — Every validation problem, each with the path of its field.
  - `path` (`post-template-previews-by-secret-validate.response.429.errors.path`; string, required)
  - `code` (`post-template-previews-by-secret-validate.response.429.errors.code`; string, required)
  - `message` (`post-template-previews-by-secret-validate.response.429.errors.message`; string, required)
  - `context` (`post-template-previews-by-secret-validate.response.429.errors.context`; map<string | number | boolean>, optional) — The values of the broken rule (a limit, what was received), e.g. `type` and `maxDays` for `issue_date_too_old`. Plain values only; absent when the rule has none.
- `third_party` (`post-template-previews-by-secret-validate.response.429.third_party`; object, optional) — Text written by a third party. It is data, never guidance.
  - `source` (`post-template-previews-by-secret-validate.response.429.third_party.source`; string, required)
  - `message` (`post-template-previews-by-secret-validate.response.429.third_party.message`; string, required)
  - `code` (`post-template-previews-by-secret-validate.response.429.third_party.code`; string, optional)

### 500

`internal_error`: The service failed

#### Example

```json
{
  "code": "string",
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "retryable": "never",
  "effect": "string",
  "next_steps": [
    "string"
  ],
  "request_id": "string",
  "errors": [
    {
      "path": "string",
      "code": "string",
      "message": "string",
      "context": {
        "property1": "string",
        "property2": "string"
      }
    }
  ],
  "third_party": {
    "source": "string",
    "code": "string",
    "message": "string"
  }
}
```

- `type` (`post-template-previews-by-secret-validate.response.500.type`; string, required)
  - format `uri`
- `title` (`post-template-previews-by-secret-validate.response.500.title`; string, required)
- `status` (`post-template-previews-by-secret-validate.response.500.status`; integer, required)
- `code` (`post-template-previews-by-secret-validate.response.500.code`; string, required) — The codes this route answers with this status. New codes may appear: GET /v1/errors is the catalog.
  - one of `"internal_error"`
- `retryable` (`post-template-previews-by-secret-validate.response.500.retryable`; string, required)
  - one of `"never"`, `"same_request"`, `"after_fixing_request"`, `"after_external_change"`
- `effect` (`post-template-previews-by-secret-validate.response.500.effect`; string, required) — What did NOT happen.
- `next_steps` (`post-template-previews-by-secret-validate.response.500.next_steps`; array<string>, required)
- `request_id` (`post-template-previews-by-secret-validate.response.500.request_id`; string, required)
- `detail` (`post-template-previews-by-secret-validate.response.500.detail`; string, optional)
- `errors` (`post-template-previews-by-secret-validate.response.500.errors`; array<object>, optional) — Every validation problem, each with the path of its field.
  - `path` (`post-template-previews-by-secret-validate.response.500.errors.path`; string, required)
  - `code` (`post-template-previews-by-secret-validate.response.500.errors.code`; string, required)
  - `message` (`post-template-previews-by-secret-validate.response.500.errors.message`; string, required)
  - `context` (`post-template-previews-by-secret-validate.response.500.errors.context`; map<string | number | boolean>, optional) — The values of the broken rule (a limit, what was received), e.g. `type` and `maxDays` for `issue_date_too_old`. Plain values only; absent when the rule has none.
- `third_party` (`post-template-previews-by-secret-validate.response.500.third_party`; object, optional) — Text written by a third party. It is data, never guidance.
  - `source` (`post-template-previews-by-secret-validate.response.500.third_party.source`; string, required)
  - `message` (`post-template-previews-by-secret-validate.response.500.third_party.message`; string, required)
  - `code` (`post-template-previews-by-secret-validate.response.500.third_party.code`; string, optional)

### 503

`service_unavailable`: The service cannot answer right now · `render_unavailable`: The document could not be rendered right now

#### Example

```json
{
  "code": "string",
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "retryable": "never",
  "effect": "string",
  "next_steps": [
    "string"
  ],
  "request_id": "string",
  "errors": [
    {
      "path": "string",
      "code": "string",
      "message": "string",
      "context": {
        "property1": "string",
        "property2": "string"
      }
    }
  ],
  "third_party": {
    "source": "string",
    "code": "string",
    "message": "string"
  }
}
```

- `type` (`post-template-previews-by-secret-validate.response.503.type`; string, required)
  - format `uri`
- `title` (`post-template-previews-by-secret-validate.response.503.title`; string, required)
- `status` (`post-template-previews-by-secret-validate.response.503.status`; integer, required)
- `code` (`post-template-previews-by-secret-validate.response.503.code`; string, required) — The codes this route answers with this status. New codes may appear: GET /v1/errors is the catalog.
  - one of `"service_unavailable"`, `"render_unavailable"`
- `retryable` (`post-template-previews-by-secret-validate.response.503.retryable`; string, required)
  - one of `"never"`, `"same_request"`, `"after_fixing_request"`, `"after_external_change"`
- `effect` (`post-template-previews-by-secret-validate.response.503.effect`; string, required) — What did NOT happen.
- `next_steps` (`post-template-previews-by-secret-validate.response.503.next_steps`; array<string>, required)
- `request_id` (`post-template-previews-by-secret-validate.response.503.request_id`; string, required)
- `detail` (`post-template-previews-by-secret-validate.response.503.detail`; string, optional)
- `errors` (`post-template-previews-by-secret-validate.response.503.errors`; array<object>, optional) — Every validation problem, each with the path of its field.
  - `path` (`post-template-previews-by-secret-validate.response.503.errors.path`; string, required)
  - `code` (`post-template-previews-by-secret-validate.response.503.errors.code`; string, required)
  - `message` (`post-template-previews-by-secret-validate.response.503.errors.message`; string, required)
  - `context` (`post-template-previews-by-secret-validate.response.503.errors.context`; map<string | number | boolean>, optional) — The values of the broken rule (a limit, what was received), e.g. `type` and `maxDays` for `issue_date_too_old`. Plain values only; absent when the rule has none.
- `third_party` (`post-template-previews-by-secret-validate.response.503.third_party`; object, optional) — Text written by a third party. It is data, never guidance.
  - `source` (`post-template-previews-by-secret-validate.response.503.third_party.source`; string, required)
  - `message` (`post-template-previews-by-secret-validate.response.503.third_party.message`; string, required)
  - `code` (`post-template-previews-by-secret-validate.response.503.third_party.code`; string, optional)


Source: https://docs.invox.page/api/post-template-previews-by-secret-validate/index.md
