---
title: "Test a mapping on every sample"
description: "Mappings API"
---

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

# Test a mapping on every sample

{/* Generated by apps/docs/scripts/generate.ts from contracts/api/openapi.yaml. Do not edit. */}
<div class="cvo-op">
<div class="cvo-op-main">

<div class="cvo-op-header">
<div class="cvo-op-path-row">
<span class="cvo-method" data-method="post">POST</span>
<code class="cvo-op-path-code">/v1/mappings/tests</code>
</div>
</div>

Runs a draft mapping config over every sample file you send and says, per sample, whether it passed. Use it before you freeze a config. A sample passes when the config reads the whole file and maps every invoice in it, exactly as a frozen config reads a file at run time. A sample with no invoice in it fails. Send the draft config itself, not a stored version. It is checked the same way as when you freeze it. Nothing is stored and nothing is validated. A mapped invoice is well-formed, not compliant.

## Request body

`application/json`, required

## Status codes

| Status | Meaning |
|---|---|
| `200` | `{tested, passed, failed, samples}`. Each entry of `samples` is `{name, passed}` and: - `invoices`: how many invoices the file held, when it could be read. - `unreadable`: the reader's sentence, when the file could not be read the way the config says. - `unmapped`: per invoice that could not be mapped, its number from 1, the fields that stopped it and the values waiting for a person. A failed sample is a normal answer, not an error. |
| `400` | The body is not JSON (`invalid_json`), the config does not load (`invalid_mapping_config`), the config reads no file (`config_reads_no_file`), or no sample has a name and its bytes (`no_samples`). |
| `401` | No usable credential was sent (`invalid_credentials`). |
| `413` | The samples are larger than 10 MB together (`document_too_large`), or one holds more than one request may carry once read (`file_too_large_to_read`). Nothing was tested. |

</div>
<div class="cvo-op-aside">

</div>
</div>

Source: https://docs.certinvo.com/reference/api/mappings/test-a-mapping-on-every-sample/index.mdx
