---
title: "Add samples to a kept draft"
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.

# Add samples to a kept draft

{/* 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/drafts/&#123;id&#125;/samples</code>
</div>
</div>

`{samples: [{name, data}]}` join the draft's corpus. The draft is made again from every sample, and every decision is applied again; one that no longer applies is named in `notApplied`. A sample whose bytes the draft holds already, or that is sent twice, is not added and is named in `sameFile`, `{name, sameAs}`.

## Path parameters

## Request body

`application/json`, required

## Status codes

| Status | Meaning |
|---|---|
| `200` | The draft, as `GET /v1/mappings/drafts/{id}` answers it. |
| `400` | No sample has a name and its bytes (`no_samples`), or the body is not JSON (`invalid_json`). |
| `401` | No usable credential was sent (`invalid_credentials`). |
| `404` | This company has no such draft (`unknown_mapping_draft`). |
| `409` | `mapping_draft_finalized`: the draft is finalized and never changes. |
| `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 kept. |
| `422` | The samples are more than one layout (`several_sources`, with `detail.groups`), the samples are not one source (`not_one_source`), a sample is already an e-invoice (`already_an_invoice`), cannot be read (`unreadable_file`), or cannot be profiled (`unprofilable_sample`). Nothing was kept. |
| `503` | The profiler did not answer (`profiler_unavailable`). Nothing is wrong with the samples. |

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

</div>
</div>

Source: https://docs.certinvo.com/reference/api/mappings/add-samples-to-a-kept-draft/index.mdx
