Upload a RAG document for an account
PUT
/v1/adapters/llm/rag/document/{id}
const url = 'https://example.com/v1/adapters/llm/rag/document/example?index_type=vector';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"content":"example","type":"txt"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url 'https://example.com/v1/adapters/llm/rag/document/example?index_type=vector' \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "content": "example", "type": "txt" }'Accepts either a JSON text body or a multipart file upload, selected by Content-Type.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string
RAG document id.
Query Parameters
Section titled “Query Parameters”mode
string
Document split mode.
index_type
string
chunk_size
integer
Header Parameters
Section titled “Header Parameters”X-Account-Sid
string
Target account for principals broader than one account (tenant / account API key); account-scoped principals use their own.
Request Bodyrequired
Section titled “Request Bodyrequired”object
content
required
string
type
required
string
object
document
required
string format: binary
Responses
Section titled “Responses”Accepted
Media typeapplication/json
object
message
string
Examplegenerated
{ "message": "example"}Invalid request body or parameters
Media typeapplication/json
Flat error shape emitted by the RAG document, public models and admin
registry handlers. details is present only on validation failures that
carry per-field diagnostics.
object
error
required
string
details
string
Examplegenerated
{ "error": "example", "details": "example"}Unauthorized
Forbidden
Resource busy
Media typeapplication/json
Flat error shape emitted by the RAG document, public models and admin
registry handlers. details is present only on validation failures that
carry per-field diagnostics.
object
error
required
string
details
string
Examplegenerated
{ "error": "example", "details": "example"}Bad gateway (upstream adapter error)