---
title: "Import a code book file"
description: "Other routes 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.

# Import a code book file

{/* 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/data-files/codes/imports</code>
</div>
</div>

Saves every new row and every changed row except those in `keep`, in one step. A changed row in `keep` keeps the answer the book holds today. Invalid rows are not imported; the answer names them again. Refused with 409 `list_changed` when the book has a newer version than `basedOn`. Preview the file again. Only invoices made after the import read the new answers. Any credential may call this, as for one answer.

## Request body

`application/json`, required

## Response

A `200` answer carries these fields.

## Status codes

| Status | Meaning |
|---|---|
| `200` | What was saved. |
| `400` | The body was refused, or the file is no code book file (`invalid_data_file`, `invalid_json`). Nothing was saved. |
| `401` | No usable credential was sent (`invalid_credentials`). |
| `409` | The code book changed since the preview (`list_changed`). Nothing was saved. |
| `501` | This deployment keeps no database, so nothing can be saved (`no_database`). |
| `502` | The engine could not run, so nothing was read (`engine_unavailable`). |

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

</div>
</div>

Source: https://docs.certinvo.com/reference/api/other/import-a-code-book-file/index.mdx
