---
title: "Preview 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.

# Preview 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/previews</code>
</div>
</div>

Reads a code book file (CSV, Excel or JSON) and says what importing it would do, row by row. Nothing is saved. A row is keyed by its `list` and `code`. Each row is `new`, `same`, `changed` (with `now`, the answer the book holds today) or `invalid`, naming its column and why: a list that is not official, an empty code or one longer than 100 characters, an answer not on the list, or a code the file answers twice. A file with no `list` column takes `list` from the request: the official list its codes are on. Without it, such a file is refused. A code the file leaves out is kept. `basedOn` is the book's version; send it with the import.

## Request body

`application/json`, required

## Response

A `200` answer carries these fields.

## Status codes

| Status | Meaning |
|---|---|
| `200` | What the file would do. |
| `400` | The body was refused, or the file is no code book file (`invalid_data_file`, `invalid_json`). Nothing was read. |
| `401` | No usable credential was sent (`invalid_credentials`). |
| `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/preview-a-code-book-file/index.mdx
