Skip to main content
PATCH
/
v2
/
documents
/
{document_id}
Update Document
curl --request PATCH \
  --url https://tavusapi.com/v2/documents/{document_id} \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "document_name": "Updated Document Name",
  "tags": [
    "docs",
    "website",
    "updated"
  ]
}
'
{
  "document_id": "d8-5c71baca86fc",
  "document_name": "Updated Document Name",
  "document_url": "https://docs.example.com/",
  "status": "ready",
  "progress": null,
  "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
}
Update metadata for a specific document. This endpoint allows you to modify the document name and its tags.

Authorizations

x-api-key
string
header
required

Path Parameters

document_id
string
required

The unique identifier of the document to update

Body

application/json
document_name
string

New name for the document

Example:

"Updated Document Name"

tags
string[]

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

Example:
["docs", "website", "updated"]

Response

Document updated successfully

document_id
string

Unique identifier for the document

Example:

"d8-5c71baca86fc"

document_name
string

Updated name of the document

Example:

"Updated Document Name"

document_url
string

URL of the document

Example:

"https://docs.example.com/"

status
string

Current status of the document processing

Example:

"ready"

progress
string | null

Progress indicator for document processing

Example:

null

created_at
string

ISO 8601 timestamp of when the document was created

Example:

"2024-01-01T12:00:00Z"

updated_at
string

ISO 8601 timestamp of when the document was last updated

Example:

"2024-01-01T13:00:00Z"

callback_url
string

URL that receives status updates

Example:

"https://your-server.com/webhook"

tags
string[]

Updated array of document tags

Example:
["docs", "website", "updated"]
crawl_config
object

The crawl configuration used for this document (only present for crawled websites)

crawled_urls
string[] | null

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

Example:
[
"https://docs.example.com/",
"https://docs.example.com/getting-started",
"https://docs.example.com/api"
]
last_crawled_at
string | null

ISO 8601 timestamp of when the document was last crawled

Example:

"2024-01-01T12:00:00Z"

crawl_count
integer | null

Number of times the document has been crawled

Example:

1