Skip to content

Create Library Document

POST
/library/documents

Create a TEXT document from a string.

The counterpart to /documents/upload: no file, no extraction, the content you send is the content stored. Use it for material you already have as text.

Authorizations

Parameters

Header Parameters

X-Target-Org-Id
Any of:
string

Request Body required

Create a TEXT document in the Library.

Mirrors campaign_builder.routers.library.CreateDocumentRequest. For a file, use POST /library/documents/upload instead - this path stores the content string verbatim and runs no extraction.

object
account_id
Any of:
string
campaign_id
Any of:
string
content
required

The document text. Stored verbatim.

string
context_type

Whose library this belongs to.

string
default: global
Allowed values: global campaign account
copilot_session_id
Any of:
string
display_name
required

How the document is listed.

string
file_name
required

Stored file name.

string
folder_path
required

Where it lands, e.g. Library/Case Studies. The folder must already exist.

string
source

Where the text came from; manual or copilot are what the app writes. NOT validated by the app, so any value is accepted and stored as given.

string
default: manual

Responses

201

Successful Response

object
data
required

An open envelope for one document, folder or questionnaire.

Open on purpose: a Library document carries extraction metadata, a questionnaire carries per-provider processing detail, and a generated deal document carries structured_data and highlights whose shape is the generator’s rather than this contract’s. Pinning those would silently drop whatever the app learned to return that this file had not caught up on.

object
key
additional properties
any
pagination
Any of:
object
has_next
required

Whether there are more pages

boolean
limit
required

Items per page

integer
next_cursor
Any of:
string
notes
Any of:
Array<string>
page
required

Current page number (1-indexed)

integer
total
required

Total number of items

integer
total_available
Any of:
integer
total_is_lower_bound
Any of:
boolean

422

Validation Error

object
detail
Array<object>
object
loc
required
Array
msg
required
string
type
required
string