--- title: "Replace document" slug: "rag-replace-doc" updated: 2026-09-17T09:35:51Z published: 2026-09-17T09:35:51Z canonical: "api.ncloud-docs.com/rag-replace-doc" --- > ## Documentation Index > Fetch the complete documentation index at: https://api.ncloud-docs.com/llms.txt > Use this file to discover all available pages before exploring further. # Replace document Available in VPC Replace a previously uploaded document with a new one. ## Request This section describes the request format. The method and URI are as follows: | Method | URI | | --- | --- | | PUT | /api/v1/svc/{serviceId}/doc/{docId} | ### Request headers For information about the headers common to all RAG APIs, see [RAG request headers](/docs/en/rag-overview#%EC%9A%94%EC%B2%AD%ED%97%A4%EB%8D%94). ### Request path parameters You can use the following path parameters with your request: | Field | Type | Required | Description | | --- | --- | --- | --- | | `serviceId` | String | Required | Service's unique identifier | | `docId` | String | Required | Document's unique identifier | ### Request body You can include the following data in the body of your request: | Field | Type | Required | Description | | --- | --- | --- | --- | | `orgid` | String | Optional | Original document's unique identifier | | `title` | String | Optional | Document title | | `file_name` | String | Optional | File name | | `body` | String | Required | Document body | | `url` | String | Optional | Website URL | | `created_at` | String | Optional | Creation date and time - ISO 8601 format | | `extra` | Object | Optional | Additional information - The user can add arbitrary fields under `extra` when sending documents. - `extra.bucket`, `extra.key`, `extra.last_modified`, `extra.size`, `extra.{userField}` - Field types are automatically determined upon initial data entry. - Use for categorizing, filtering, etc. | ### Request example The request example is as follows: ``` curl --location --request PUT 'https://kr-pub-gateway.rag.naverncp.com/api/v1/svc/{serviceId}/doc/12345' \ --header 'Authorization: Bearer {apiKey}' \ --header 'Content-Type: application/json' \ --data '{ "id": "12345", "orgid": "naver:media-ai-understanding.txt", "title": "Media AI Understanding", "file_name": "media-ai-understanding.txt", "body": "Where's that scene? Media AI, your video editing savior\n\nIf you've ever edited a video, you've probably experienced it: wasting time looking for a specific scene among dozens of hours of footage. NAVER Cloud's Media AI improves the efficiency of your video production process. Simply upload your footage and the AI will automatically analyze the people and actions in the scene, and even organize the script.\n\nSay, \"Find all the shots of the main character running\", and it will find all the shots of a specific person running in a flash, so you can take a break from editing and focus on your creative work. You can also associate meta information with your editing tools to complete your video editing tasks efficiently.", "url": "www.naver.com", "created_at": "2025-06-09T19:45:11+00:00", "extra": { "bucket": "naver", "key": "media-ai-understanding.txt", "last_modified": "2025-06-09T20:45:11+00:00", "size": 1024 } }' ``` ## Response This section describes the response format. ### Response body The response body includes the following data: | Field | Type | Required | Description | | --- | --- | --- | --- | | `status` | Object | - | API processing result | | `status.code` | Integer | - | [API response status code](/docs/en/rag-overview#%EC%9D%91%EB%8B%B5%EC%83%81%ED%83%9C%EC%BD%94%EB%93%9C) | | `status.message` | String | - | [API response status message](/docs/en/rag-overview#%EC%9D%91%EB%8B%B5%EC%83%81%ED%83%9C%EC%BD%94%EB%93%9C) | | `result` | Object | - | Document processing result | | `result.inserted` | Array | - | Created file ID (always `null`) | | `result.deleted` | Array | - | Deleted file ID (always `null`) | | `result.updated` | Array | - | Edited file ID | ### Response status codes For information about the HTTP status codes common to all RAG APIs, see [RAG response status codes](/docs/en/rag-overview#%EC%9D%91%EB%8B%B5%EC%83%81%ED%83%9C%EC%BD%94%EB%93%9C). ### Response example The response example is as follows: ``` { "status": { "code": 200, "message": "" }, "result": { "inserted": null, "deleted": null, "updated": [ "12345" ] } } ```