Skip to content

Upload a RAG document for an account

PUT
/v1/t/adapters/llm/rag/document/{id}
curl --request PUT \
--url 'https://example.com/v1/t/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.

Permission

This operation needs the permission tenant:scenario_template:manage.

id
required
string

RAG document id.

mode
string

Document split mode.

index_type
string
Allowed values: vector fulltext
chunk_size
integer
X-Tenant-Sid
string

Names the target tenant.

By principal:

  • A tenant-scoped principal may omit it.
  • A principal with no tenant of its own names one here.

Refused when:

  • A tenant-scoped principal sends a value naming any other tenant.
  • A principal with no tenant of its own omits it.
object
content
required
string
type
required
string
Allowed values: txt csv

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)