v1

latestOpenAPI 3.0.32026-07-267015229.9 KB
Documents

Update Document

Update a document's document_name and tags.

patch/v2/documents/{document_id}

Path parameters

document_idstring required

The unique identifier of the document to update

Request body

document_namestring

New name for the document

tagsstring[]

New array of tags for the document. This will overwrite the existing tags for the document.

Example request

{
  "document_name": "Updated Document Name",
  "tags": [
    "docs",
    "website",
    "updated"
  ]
}

Response

Document updated successfully

document_idstring

Unique identifier for the document

document_namestring

Updated name of the document

document_urlstring

URL of the document

status'started' | 'processing' | 'ready' | 'error' | 'recrawling'

Current status of the document processing. Possible values: started, processing, ready, error, recrawling.

progressinteger nullable

Processing progress as a percentage (0-100). Null when processing has not started or is complete.

error_messagestring nullable

Error code indicating why processing failed. Only present when status is error. Possible values include: file_download_failed, file_format_unsupported, file_size_too_large, file_empty, invalid_file_url, document_processing_failed, website_processing_failed, chunking_failed, embedding_failed, vector_store_failed, contact_support.

created_atstring

ISO 8601 timestamp of when the document was created

updated_atstring

ISO 8601 timestamp of when the document was last updated

callback_urlstring

URL that receives status updates

tagsstring[]

Updated array of document tags

crawled_urlsstring[] nullable

List of URLs that were crawled (only present for crawled websites after processing completes)

last_crawled_atstring nullable

ISO 8601 timestamp of when the document was last crawled

crawl_countinteger nullable

Number of times the document has been crawled

Example response

{
  "document_id": "d8-5c71baca86fc",
  "document_name": "Updated Document Name",
  "document_url": "https://docs.example.com/",
  "status": "ready",
  "created_at": "2024-01-01T12:00:00Z",
  "updated_at": "2024-01-01T13:00:00Z",
  "callback_url": "https://your-server.com/webhook",
  "tags": [
    "docs",
    "website",
    "updated"
  ],
  "crawl_config": {
    "depth": 2,
    "max_pages": 10
  },
  "crawled_urls": [
    "https://docs.example.com/",
    "https://docs.example.com/getting-started",
    "https://docs.example.com/api"
  ],
  "last_crawled_at": "2024-01-01T12:00:00Z",
  "crawl_count": 1
}