Available in VPC
Upload a file to the indexing system by specifying a file ID. The user can create a document with an ID of their choosing instead of the one the system automatically generates.
Request
This section describes the request format. The method and URI are as follows:
Method | URI |
---|---|
POST | /api/v1/svc/{serviceId}/file/{fileId} |
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 |
fileId |
String | Required | File's unique identifier
|
Request query parameters
The following describes the parameters.
Field | Type | Required | Description |
---|---|---|---|
background |
Boolean | Optional | Whether to process text extraction in the background
|
Request body
You can include the following data in the body of your request:
Field | Type | Required | Description |
---|---|---|---|
file |
File | Required | File to upload (up to 1)
|
Request example
The request example is as follows:
curl --location --request POST 'https://kr-pub-gateway.rag.naverncp.com/api/v1/svc/{serviceId}/file/12345?background=true' \
--header 'Authorization: Bearer {apiKey}' \
--header 'Content-Type: multipart/form-data' \
--form 'file=@"filePath"'
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 | - | File 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
}
}