# Upload a RAG document for an account PUT /v1/t/adapters/llm/rag/document/{id} Select code sample ``` const url = 'https://example.com/v1/t/adapters/llm/rag/document/example?index_type=vector'; const options = { method: 'PUT', headers: {Authorization: 'Bearer ', '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/t/adapters/llm/rag/document/example?index_type=vector' \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --data '{ "content": "example", "type": "txt" }' ``` - /v1/t/adapters/llm/rag/document/{id} 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`](https://docs.aiva.apifonica.com/concepts/roles-and-permissions/#tenant-scenario_template-manage). ## Authorizations - **[bearerAuth](https://docs.aiva.apifonica.com/api/tenant/#bearerauth)** ## Parameters ### Path Parameters **id** required string RAG document id. ### Query Parameters **mode** string Document split mode. **index\_type** string Allowed values: vector fulltext **chunk\_size** integer ### Header Parameters **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. ## Request Bodyrequired The list of MIME types the operation can consume object **content** required string **type** required string Allowed values: txt csv object **document** required string format: binary ## Responses ### 202 Accepted Media typeapplication/json object **message** string ##### Examplegenerated ``` { "message": "example" } ``` ### 400 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" } ``` ### 401 Unauthorized ### 403 Forbidden ### 409 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" } ``` ### 502 Bad gateway (upstream adapter error)