List Documents
curl --request GET \
--url https://tavusapi.com/v2/documents \
--header 'x-api-key: <api-key>'import requests
url = "https://tavusapi.com/v2/documents"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://tavusapi.com/v2/documents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://tavusapi.com/v2/documents",
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"
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")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://tavusapi.com/v2/documents")
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{
"data": [
{
"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"
],
"last_crawled_at": "2024-01-01T12:00:00Z",
"crawl_count": 1
}
],
"total_count": 42,
"page": 0,
"limit": 10
}{
"error": "Invalid request: limit must be a positive integer"
}{
"message": "Invalid access token"
}Knowledge Base
List Documents
Retrieve a list of documents.
GET
/
v2
/
documents
List Documents
curl --request GET \
--url https://tavusapi.com/v2/documents \
--header 'x-api-key: <api-key>'import requests
url = "https://tavusapi.com/v2/documents"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://tavusapi.com/v2/documents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://tavusapi.com/v2/documents",
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"
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")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://tavusapi.com/v2/documents")
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{
"data": [
{
"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"
],
"last_crawled_at": "2024-01-01T12:00:00Z",
"crawl_count": 1
}
],
"total_count": 42,
"page": 0,
"limit": 10
}{
"error": "Invalid request: limit must be a positive integer"
}{
"message": "Invalid access token"
}For AI agents, use
https://docs.tavus.io/openapi.yaml for the full HTTP API contract.Authorizations
Query Parameters
Number of documents to return per page (default: 10)
Page number for pagination (0-based, default: 0)
Sort direction for the results (default: ascending)
Available options:
ascending, descending Filter documents by status
Search for documents by name or UUID
Comma-separated list of tags to filter by
Response
List of documents
Documents for the current page; use total_count for the full count under the applied filters.
Show child attributes
Show child attributes
Total number of documents matching the filter criteria
Example:
42
Current page number
Example:
0
Number of documents per page
Example:
10

