# Upload a RAG document for an account PUT /v1/a/adapters/llm/rag/document/{id} Select code sample ``` const url = 'https://example.com/v1/a/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/a/adapters/llm/rag/document/example?index_type=vector' \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --data '{ "content": "example", "type": "txt" }' ``` - /v1/a/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 [`llm:document:manage`](https://docs.aiva.apifonica.com/concepts/roles-and-permissions/#llm-document-manage). ## Authorizations - **[bearerAuth](https://docs.aiva.apifonica.com/api/account/#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-Account-Sid** string Target account for principals broader than one account (tenant / account API key); account-scoped principals use their own. ## 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)