POST
/
documents
/
add-document

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
collection_name
string
required

The name of the collection to be used for this request. A 404 Not Found status code will be returned if this collection name does not exist.

content
object
required

The content of the document. There are three possible JSON types that can be passed into this parameter: APITextDocument, APITextPagesDocument, APIBinaryDocument. The type field is how ZeroEntropy will know which document object you have passed in.

path
string
required

The filepath of the document that you are adding. A 409 Conflict status code will be returned if this path already exists, unless overwrite is set to true.

metadata
object

This is a metadata JSON object that can be used to assign various metadata attributes to your document. The provided object must match the type dict[str, str | list[str]]. Please read Metadata Filtering for more details. By default, the metadata will be set to {}.

NOTE: The UTF-8-encoded JSON string must be less than 65536 bytes (Whitespace does not count). This limit can be increased upon request.

overwrite
boolean
default:
false

Setting this property to true will put this endpoint in "upsert" mode: If the document already exists, this action will atomically replace it.

Response

200 - application/json
message
string
default:
Success!

This string will always be "Success!". This may change in the future.