Add Document
Adds a document to a given collection.
A status code of 201 Created
will be returned if a document was successfully added. A status code of 409 Conflict
will be returned if the given collection already has a document with the same path.
If overwrite
is given a value of true
, then a status code of 200 OK
will be returned if a document was overwritten (Rather than a status code of 409 Conflict
).
When a document is inserted, it can take time to appear in the index. Check the /status/get-status
endpoint to see progress.
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
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.
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.
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
.
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.
Setting this property to true will put this endpoint in "upsert" mode: If the document already exists, this action will atomically replace it.
Response
This string will always be "Success!". This may change in the future.