API DocsKnowledgeFiles

파일

파일 업로드, 저장, 관리

개요

파일 엔드포인트는 문서 업로드, 저장, 조회를 처리합니다. 파일은 채팅 첨부 파일 및 지식 베이스 수집에 사용됩니다. 모든 엔드포인트는 인증이 필요합니다.

기본 URL:

파일 관리

POST /api/v1/chats/attachment/upload

채팅 첨부 파일로 하나 이상의 파일을 업로드합니다.

POSTAuth required

멀티파트 폼 데이터로 파일을 업로드합니다.

요청 본문

text
Content-Type: multipart/form-data

[Binary file data]

응답 200

json
[
{
  "id": "file-uuid",
  "filename": "document.pdf",
  "size": 1024000,
  "mime_type": "application/pdf",
  "url": "https://storage.example.com/file-uuid"
}
]

오류

상태 코드설명
400유효하지 않은 파일 형식이거나 크기가 제한을 초과함
413파일이 너무 큼

DELETE /api/v1/chats/attachment/{file_id}

스토리지에서 파일을 삭제합니다.

DELETEAuth required

스토리지 및 벡터 DB에서 파일을 삭제합니다.

응답 200

json
true

오류

상태 코드설명
404파일을 찾을 수 없음
403접근 거부

PATCH /api/v1/chats/{chat_id}/attachments

업로드된 파일을 채팅에 연결합니다.

PATCHAuth required

채팅 레코드에 첨부 파일 ID를 저장합니다.

요청 본문

json
{
"attachment_ids": [
  "file-uuid-1",
  "file-uuid-2"
]
}

응답 200

json
{
"id": "chat-uuid",
"attachments": [...]
}