cURL
curl https://tavusapi.com/v2/documents/{document_id} \
-H "x-api-key: YOUR_API_KEY"import requests
headers = {
"x-api-key": "YOUR_API_KEY"
}
response = requests.get(
"https://tavusapi.com/v2/documents/{document_id}",
headers=headers
)
const response = await fetch(
"https://tavusapi.com/v2/documents/{document_id}",
{
headers: {
"x-api-key": "YOUR_API_KEY"
}
}
);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://tavusapi.com/v2/documents/{document_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://tavusapi.com/v2/documents/{document_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://tavusapi.com/v2/documents/{document_id}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://tavusapi.com/v2/documents/{document_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"document_id": "d8-5c71baca86fc",
"document_name": "Example Docs",
"document_url": "https://docs.example.com/",
"status": "ready",
"progress": null,
"error_message": "<string>",
"created_at": "2024-01-01T12:00:00Z",
"updated_at": "2024-01-01T12:05:00Z",
"callback_url": "https://your-server.com/webhook",
"tags": [
"docs",
"website"
],
"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
}{
"message": "Invalid access token"
}{
"message": "Document not found"
}Knowledge Base
Get Document
Retrieve detailed information about a specific document using its unique identifier.
GET
/
v2
/
documents
/
{document_id}
cURL
curl https://tavusapi.com/v2/documents/{document_id} \
-H "x-api-key: YOUR_API_KEY"import requests
headers = {
"x-api-key": "YOUR_API_KEY"
}
response = requests.get(
"https://tavusapi.com/v2/documents/{document_id}",
headers=headers
)
const response = await fetch(
"https://tavusapi.com/v2/documents/{document_id}",
{
headers: {
"x-api-key": "YOUR_API_KEY"
}
}
);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://tavusapi.com/v2/documents/{document_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://tavusapi.com/v2/documents/{document_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://tavusapi.com/v2/documents/{document_id}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://tavusapi.com/v2/documents/{document_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"document_id": "d8-5c71baca86fc",
"document_name": "Example Docs",
"document_url": "https://docs.example.com/",
"status": "ready",
"progress": null,
"error_message": "<string>",
"created_at": "2024-01-01T12:00:00Z",
"updated_at": "2024-01-01T12:05:00Z",
"callback_url": "https://your-server.com/webhook",
"tags": [
"docs",
"website"
],
"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
}{
"message": "Invalid access token"
}{
"message": "Document not found"
}For AI agents, use
https://docs.tavus.io/openapi.yaml for the full HTTP API contract.Response
Document details
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.

