POST
/
v1
/
rag42
/
collections
/
{collection_id}
/
documents
/
upload
문서 업로드
curl --request POST \
  --url https://api.clovastudio.go.kr/v1/rag42/collections/{collection_id}/documents/upload \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form 'metadata={"author": "홍길동", "department": "개발팀"}' \
  --form 'indexed_fields=author,department' \
  --form external_id=doc-12345 \
  --form external_id_field=uuid \
  --form file=@example-file
{
  "status": {
    "code": "20000",
    "message": "OK"
  },
  "result": {
    "document_id": "ed5754eec78e4e0783ce075549ccadaa",
    "document_name": "2024년_업무추진계획.pdf",
    "file_size": 2458624,
    "collection_id": "ef7483af16d84818a59dcbcf8b587b93",
    "uploaded_at": "2024-10-18T12:00:00Z",
    "operation": "upload_document",
    "ingest_config": {
      "chunking_strategy": "by_title",
      "chunk_size": 1000,
      "chunk_overlap": 100,
      "embedding_model": "bge-m3",
      "embedding_dimension": 1024,
      "pii_mask": true,
      "parser_model": "rag42-chunk-v1",
      "indexed_fields": [
        "author",
        "department",
        "document_type"
      ],
      "external_id_field": "document_number"
    }
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

CSG-TENANT-ID
string | null

Clova Studio Gov 테넌트 ID

X-CSG-TENANT-ID
string | null

Clova Studio Gov 테넌트 ID (레거시)

Path Parameters

collection_id
string
required

컬렉션 ID (프로젝트 ID)

Examples:

"ef7483af16d84818a59dcbcf8b587b93"

Body

multipart/form-data
file
file
required

업로드할 파일

metadata
string | null

메타데이터 (JSON 문자열)

Examples:

"{\"author\": \"홍길동\", \"department\": \"개발팀\"}"

indexed_fields
string | null

인덱싱할 필드 (최대 10개, 쉼표 구분)

Examples:

"author,department"

external_id
string | null

문서 고유 키 직접 지정 (업데이트 시 사용)

Examples:

"doc-12345"

"uuid-abc-def"

external_id_field
string | null

문서 고유 키로 사용할 메타데이터 필드명

Examples:

"uuid"

"doc_id"

Response

문서 업로드 성공

문서 업로드 응답

status
object
required

응답 상태

result
object
required

문서 업로드 결과