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"
}Get Document
Retrieve detailed information about a specific document using its unique identifier.
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"
}https://docs.tavus.io/openapi.yaml for the full HTTP API contract.Authorizations
Path Parameters
The unique identifier of the document to retrieve
Response
Document details
Unique identifier for the document
"d8-5c71baca86fc"
Name of the document
"Example Docs"
URL of the document
"https://docs.example.com/"
Current status of the document processing. Possible values: started, processing, ready, error, recrawling.
started, processing, ready, error, recrawling "ready"
Processing progress as a percentage (0-100). Null when processing has not started or is complete.
null
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.
ISO 8601 timestamp of when the document was created
"2024-01-01T12:00:00Z"
ISO 8601 timestamp of when the document was last updated
"2024-01-01T12:05:00Z"
URL that receives status updates
"https://your-server.com/webhook"
Array of document tags
["docs", "website"]
The crawl configuration used for this document (only present for crawled websites)
Show child attributes
Show child attributes
List of URLs that were crawled (only present for crawled websites after processing completes)
[
"https://docs.example.com/",
"https://docs.example.com/getting-started",
"https://docs.example.com/api"
]
ISO 8601 timestamp of when the document was last crawled
"2024-01-01T12:00:00Z"
Number of times the document has been crawled
1

