curl --request POST \
--url https://api.zeroentropy.dev/v1/documents/update-document \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"collection_name": "<string>",
"path": "<string>",
"metadata": {}
}
'{
"message": "Success!"
}Update Document
Updates a document. This endpoint is atomic.
Currently both metadata and index_status are supported.
- When updating with a non-null
metadata, the document must haveindex_statusofindexed. After this call, the document will have anindex_statusofnot_indexed, since the document will need to reindex with the new metadata. - When updating with a non-null
index_status, setting it tonot_parsedornot_indexedrequires that the document must haveindex_statusofparsing_failedorindexing_failed, respectively.
A 404 Not Found status code will be returned, if the provided collection name or document path does not exist.
curl --request POST \
--url https://api.zeroentropy.dev/v1/documents/update-document \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"collection_name": "<string>",
"path": "<string>",
"metadata": {}
}
'{
"message": "Success!"
}Authorizations
Body
The name of the collection.
The filepath of the document that you are updating. A 404 Not Found status code will be returned if no document with this path was found.
If this field is provided, the given metadata json will replace the document's existing metadata json. In other words, if you want to add a new field, you will need to provide the entire metadata object (Both the original fields, and the new field).
Show child attributes
Show child attributes
If the document is in the index_status of parsing_failed orindexing_failed, then this endpoint allows you to update the index status tonot_parsedandnot_indexed`, respectively. This allows the document to re-attempt to parse/index after failure.
not_parsed, not_indexed Response
Successful Response
This string will always be "Success!". This may change in the future.