Add document

Prev Next

Available in VPC

Create a document by uploading JSON data to the indexing system. The system automatically generates and returns a unique document ID.

Request

This section describes the request format. The method and URI are as follows:

Method URI
POST /api/v1/svc/{serviceId}/doc

Request headers

For information about the headers common to all RAG APIs, see RAG request headers.

Request path parameters

The following describes the parameters.

Field Type Required Description
serviceId String Required Service'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 POST 'https://kr-pub-gateway.rag.naverncp.com/api/v1/svc/{serviceId}/doc' \
--header 'Authorization: Bearer {apiKey}' \
--header 'Content-Type: application/json' \
--data '{
  "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-07-09T19:45:11+00:00",
  "extra": {
    "bucket": "naver",
    "key": "media-ai-understanding.txt",
    "last_modified": "2025-07-09T19: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
status.message String - API response status message
result Object - Document processing result
result.inserted Array - Created file ID
result.deleted Array - Deleted file ID (always null)
result.updated Array - Edited file ID (always null)

Response status codes

For information about the HTTP status codes common to all RAG APIs, see RAG response status codes.

Response example

The response example is as follows:

{
    "status": {
        "code": 200,
        "message": ""
    },
    "result": {
        "inserted": [
            "12345"
        ],
        "deleted": null,
        "updated": null
    }
}