Update Document Categories
Update the categories assigned to a document.
This endpoint replaces all existing categories for a document with the new list provided. Use this to organize and tag documents for easier retrieval.
Args:
id: Document ID (path parameter)
req: Request body containing the new list of categories
Returns: Object with document_id, old_categories, new_categories, and a confirmation message.
Raises:
404: If the document is not found or doesn’t belong to the user
Example: Request:
PUT /api/v3/documents/doc-xyz789/categories
Headers: {"Authorization": "Bearer <api_key>"}
Body:
{
"categories": ["financial", "2024-q1", "confidential"]
}
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
List of categories to be assigned to the document
["customer_support", "products", "legal"]
Response
Successful Response
ID of the updated document
"doc-abc123"
Categories before the update
["customer_service", "ML_book_new"]
Categories after the update
["customer_support", "products", "legal"]
Human-readable confirmation message