---
title: "Append Content Library Item to a document"
method: POST
path: "/public/v1/documents/{id}/append-content-library-item"
tags: ["Documents"]
---

# Append Content Library Item to a document

`POST /public/v1/documents/{id}/append-content-library-item`

## Request

- Base URL: `https://api.pandadoc.com`
- URL: `https://api.pandadoc.com/public/v1/documents/{id}/append-content-library-item`
- Auth: one of:
  - API key in header `Authorization`
  - OAuth 2
    - Authorization code: `https://app.pandadoc.com/oauth2/authorize`
    - Token URL: `https://api.pandadoc.com/oauth2/access_token`
- TypeScript: <https://skmtc.dev/pandadoc/apis/pandadoc-public-api/docs/public/v1/documents/:id/append-content-library-item/post.ts> (a function with typed inputs; its response is checked against the schema)

Appends a Content Library Item (CLI) to a document and provides a name mapping for its content blocks.

## Path parameters

- `id` string, required

## Request body

- AppendCLIDataRequest
  - `cli` object: Settings to append a CLI to a document, with ability to change some parameters
    - `id` string, required: CLI ID to append to the first section.
    - `pages` object[]: The list of the CLI's pages you want to change in a result document
      - `index` integer: The index of the CLI's page you want to change in a result document during appending the CLI
      - `name` string, nullable: The name you want to apply to the CLI's page in a result document during appending the CLI

## Response `201`

OK

- AppendCLIDataResponse
  - `cli` object: Settings of the appended to a document CLI. Name property can be different from what you passed if there were collisions
    - `id` string, required: CLI ID appended to the first section.
    - `pages` object[]: The list of the CLI's pages you have changed in a result document
      - `index` integer: The index of the CLI's page you have changed in a result document during appending the CLI
      - `name` string, nullable: The real name in the page. It can be different from the one you passed if there were collisions (e.g. you appended the same CLI twice with the same names)
  - `block_mapping` object: Maps the original names of content blocks from the CLI to their new names in the document. Use the 'new_name' to target blocks in subsequent API calls.
    - `tables` object[]: Mapping for Table blocks.
      - `original_name` string: The name of the block in the source Content Library Item.
      - `new_name` string: The new, unique name of the block in the document after appending.
    - `pricing_tables` object[]: Mapping for Pricing Table blocks.
      - `original_name` string: The name of the block in the source Content Library Item.
      - `new_name` string: The new, unique name of the block in the document after appending.
    - `images` object[]: Mapping for Image blocks.
      - `original_name` string: The name of the block in the source Content Library Item.
      - `new_name` string: The new, unique name of the block in the document after appending.
    - `texts` object[]: Mapping for Text blocks.
      - `original_name` string: The name of the block in the source Content Library Item.
      - `new_name` string: The new, unique name of the block in the document after appending.

## Other responses

- `401`: Authentication error
- `403`: Permission error
- `404`: Not found
- `409`: Conflict
- `423`: Document is locked for editing
- `429`: Too Many Requests

---

[API](https://skmtc.dev/pandadoc/apis/pandadoc-public-api.md) - [All operations](https://skmtc.dev/pandadoc/apis/pandadoc-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/pandadoc/apis/pandadoc-public-api/revisions/b9a306b1a421?raw)
