# Knowledge\_bases

Knowledge base related APIs

## POST /webapi/v2/knowledge\_base\_diff

> 지식베이스 차분

```json
{"openapi":"3.1.0","info":{"title":"Alli API Documentation","version":"1.0.0"},"tags":[{"name":"knowledge_bases","description":"Knowledge base related APIs"}],"servers":[{"url":"https://backend.alli.ai","description":"US"}],"security":[{"ApiKeyAuth":[]},{"TokenAuth":[]},{"ProjectIdHeader":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"API-KEY","description":"Your API key for authentication"},"TokenAuth":{"type":"http","scheme":"bearer","description":"Your token for authentication"}},"parameters":{"AgentEmailHeader":{"name":"AGENT-EMAIL","in":"header","required":false,"schema":{"type":"string"},"description":"Optional: Email of the agent to use for this request"},"UserEmailHeader":{"name":"USER-EMAIL","in":"header","required":false,"schema":{"type":"string"},"description":"Optional: Email address to associate with the user"},"OwnUserIdHeader":{"name":"OWN-USER-ID","in":"header","required":false,"schema":{"type":"string"},"description":"Optional: User ID to identify or create a user"}},"schemas":{"KnowledgeBaseDiffResponse":{"properties":{"result":{"items":{"$ref":"#/components/schemas/KnowledgeBaseDiffResponseLineDiffer"},"title":"Result","type":"array"}},"required":["result"],"title":"KnowledgeBaseDiffResponse","type":"object"},"KnowledgeBaseDiffResponseLineDiffer":{"properties":{"left":{"$ref":"#/components/schemas/KnowledgeBaseDiffResponseLineDelta"},"right":{"$ref":"#/components/schemas/KnowledgeBaseDiffResponseLineDelta"},"row":{"title":"Row","type":"integer"},"comment":{"title":"Comment","type":"string"}},"required":["left","right","row","comment"],"title":"KnowledgeBaseDiffResponseLineDiffer","type":"object"},"KnowledgeBaseDiffResponseLineDelta":{"properties":{"status":{"title":"Status","type":"string"},"page":{"title":"Page","type":"integer"},"line":{"title":"Line","type":"integer"},"text":{"title":"Text","type":"string"},"highlight":{"title":"Highlight","type":"string"}},"required":["status","page","line","text","highlight"],"title":"KnowledgeBaseDiffResponseLineDelta","type":"object"},"KnowledgeBaseDiffRequest":{"properties":{"leftId":{"description":"올바른 지식베이스 ID","title":"Leftid","type":"string"},"rightId":{"description":"올바른 지식베이스 ID","title":"Rightid","type":"string"}},"required":["leftId","rightId"],"title":"KnowledgeBaseDiffRequest","type":"object"}}},"paths":{"/webapi/v2/knowledge_base_diff":{"post":{"operationId":"django_server_knowledge_base_views_rest_knowledge_base_diff_api_knowledge_base_diff","summary":"지식베이스 차분","parameters":[{"$ref":"#/components/parameters/AgentEmailHeader"},{"$ref":"#/components/parameters/UserEmailHeader"},{"$ref":"#/components/parameters/OwnUserIdHeader"}],"responses":{"200":{"description":"알겠습니다.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBaseDiffResponse"}}}}},"tags":["knowledge_bases"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBaseDiffRequest"}}},"required":true}}}}}
```

## GET /download\_document\_by\_name/{project\_id}

> 파일 이름으로 문서 다운로드

```json
{"openapi":"3.1.0","info":{"title":"Alli API Documentation","version":"1.0.0"},"tags":[{"name":"knowledge_bases","description":"Knowledge base related APIs"}],"servers":[{"url":"https://backend.alli.ai","description":"US"}],"security":[{"ApiKeyAuth":[]},{"TokenAuth":[]},{"ProjectIdHeader":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"API-KEY","description":"Your API key for authentication"},"TokenAuth":{"type":"http","scheme":"bearer","description":"Your token for authentication"}},"parameters":{"AgentEmailHeader":{"name":"AGENT-EMAIL","in":"header","required":false,"schema":{"type":"string"},"description":"Optional: Email of the agent to use for this request"},"UserEmailHeader":{"name":"USER-EMAIL","in":"header","required":false,"schema":{"type":"string"},"description":"Optional: Email address to associate with the user"},"OwnUserIdHeader":{"name":"OWN-USER-ID","in":"header","required":false,"schema":{"type":"string"},"description":"Optional: User ID to identify or create a user"}}},"paths":{"/download_document_by_name/{project_id}":{"get":{"tags":["knowledge_bases"],"operationId":"downloadDocumentByName","summary":"파일 이름으로 문서 다운로드","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"filename":{"type":"string","description":"다운로드할 문서의 이름"}}}}}},"responses":{"200":{"description":"문서 파일이 성공적으로 다운로드되었습니다.","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"여러 문서가 발견됨"},"401":{"description":"무단"},"403":{"description":"금지됨"},"404":{"description":"문서를 찾을 수 없습니다."},"500":{"description":"내부 서버 오류"}},"parameters":[{"$ref":"#/components/parameters/AgentEmailHeader"},{"$ref":"#/components/parameters/UserEmailHeader"},{"$ref":"#/components/parameters/OwnUserIdHeader"},{"name":"project_id","in":"path","required":true,"schema":{"type":"string"}}]}}}}
```

## 단일 문서 가져오기

> 단일 문서의 모든 상세 정보를 얻는 방법입니다.

```json
{"openapi":"3.1.0","info":{"title":"Alli API Documentation","version":"1.0.0"},"tags":[{"name":"knowledge_bases","description":"Knowledge base related APIs"}],"servers":[{"url":"https://backend.alli.ai","description":"US"}],"security":[{"ApiKeyAuth":[]},{"TokenAuth":[]},{"ProjectIdHeader":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"API-KEY","description":"Your API key for authentication"},"TokenAuth":{"type":"http","scheme":"bearer","description":"Your token for authentication"}},"parameters":{"AgentEmailHeader":{"name":"AGENT-EMAIL","in":"header","required":false,"schema":{"type":"string"},"description":"Optional: Email of the agent to use for this request"},"UserEmailHeader":{"name":"USER-EMAIL","in":"header","required":false,"schema":{"type":"string"},"description":"Optional: Email address to associate with the user"},"OwnUserIdHeader":{"name":"OWN-USER-ID","in":"header","required":false,"schema":{"type":"string"},"description":"Optional: User ID to identify or create a user"}}},"paths":{"/webapi/single_document":{"get":{"tags":["knowledge_bases"],"operationId":"getExactDocument","summary":"단일 문서 가져오기","description":"단일 문서의 모든 상세 정보를 얻는 방법입니다.","parameters":[{"$ref":"#/components/parameters/AgentEmailHeader"},{"$ref":"#/components/parameters/UserEmailHeader"},{"$ref":"#/components/parameters/OwnUserIdHeader"},{"name":"id","in":"query","required":true,"schema":{"type":"string"},"description":"The id of the document."}],"responses":{"200":{"description":"문서의 상세 정보를 성공적으로 가져옴","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"id":{"type":"string","description":"문서 ID."},"documentName":{"type":"string","description":"문서의 파일 이름."},"createdDate":{"type":"string","format":"date","description":"문서가 업로드된 날짜."},"hashtags":{"type":"array","items":{"type":"string"},"description":"문서에 등록된 해시태그."},"agentFeedback":{"type":"object","properties":{"positiveCount":{"type":"integer","description":"에이전트로부터 받은 긍정적인 피드백의 수."},"negativeCount":{"type":"integer","description":"에이전트로부터 받은 부정적인 피드백 수."}},"description":"직원들의 긍정적 및 부정적 피드백 수."},"userFeedback":{"type":"object","properties":{"positiveCount":{"type":"integer","description":"유저로부터 받은 긍정적인 피드백 수."},"negativeCount":{"type":"integer","description":"유저로부터 받은 부정적인 피드백 수."}},"description":"이 문서에 대한 유저들의 피드백."}}}}}}}}}}}}}
```

## 문서 업로드

> 이 API 메서드는 Cognitive Search를 위해 문서를 업로드할 수 있게 해줍니다. 업로드 가능한 파일 형식: PDF, TXT, MS Word, PowerPoint, Excel, HTM 및 HTML. 연결된 리소스가 있는 HTML 파일을 업로드하려면, 업로드 전에 상대적으로 연결된 리소스와 함께 ZIP 파일로 압축하십시오.

```json
{"openapi":"3.1.0","info":{"title":"Alli API Documentation","version":"1.0.0"},"tags":[{"name":"knowledge_bases","description":"Knowledge base related APIs"}],"servers":[{"url":"https://backend.alli.ai","description":"US"}],"security":[{"ApiKeyAuth":[]},{"TokenAuth":[]},{"ProjectIdHeader":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"API-KEY","description":"Your API key for authentication"},"TokenAuth":{"type":"http","scheme":"bearer","description":"Your token for authentication"}},"parameters":{"AgentEmailHeader":{"name":"AGENT-EMAIL","in":"header","required":false,"schema":{"type":"string"},"description":"Optional: Email of the agent to use for this request"},"UserEmailHeader":{"name":"USER-EMAIL","in":"header","required":false,"schema":{"type":"string"},"description":"Optional: Email address to associate with the user"},"OwnUserIdHeader":{"name":"OWN-USER-ID","in":"header","required":false,"schema":{"type":"string"},"description":"Optional: User ID to identify or create a user"}}},"paths":{"/webapi/upload_file":{"post":{"tags":["knowledge_bases"],"operationId":"uploadFile","summary":"문서 업로드","description":"이 API 메서드는 Cognitive Search를 위해 문서를 업로드할 수 있게 해줍니다. 업로드 가능한 파일 형식: PDF, TXT, MS Word, PowerPoint, Excel, HTM 및 HTML. 연결된 리소스가 있는 HTML 파일을 업로드하려면, 업로드 전에 상대적으로 연결된 리소스와 함께 ZIP 파일로 압축하십시오.","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary","description":"로컬 파일 위치"},"hashtags":{"type":"array","description":"업로드 파일의 해시태그","items":{"type":"string"}},"footerTitle":{"type":"string","description":"업로드된 파일의 검색 결과에 대한 출처를 바닥글로 입력할 수 있습니다. 바닥글 텍스트는 검색 결과의 '출처' 옆에 나타납니다."},"footerUrl":{"type":"string","description":"footerTitle에 연결하려는 URL을 넣을 수 있습니다."},"parentFolderId":{"type":"string","description":"업로드할 대상 폴더 ID입니다. 최상위 수준에 삽입하려면 Null로 설정합니다."},"allowOtherAgentsView":{"type":"boolean","description":"다른 에이전트가 이 문서를 볼 수 있도록 허용할지 여부"},"allowOtherUsersView":{"type":"boolean","description":"다른 유저가 이 문서를 볼 수 있도록 허용할지 여부"},"useLayout":{"type":"boolean","description":"Whether to use layout processing for improved document ingestion. If null, project setting will be used."},"useImageDescription":{"type":"boolean","description":"Whether to use image description for improved document ingestion. If null, project setting will be used."},"properties":{"type":"object","description":"Properties for the document.","additionalProperties":{"type":"string"}}}}}}},"responses":{"200":{"description":"파일 업로드 성공","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"id":{"type":"string","description":"업로드된 문서의 ID"},"file_name":{"type":"string","description":"업로드된 문서의 파일 이름"},"hashtags":{"type":"array","description":"업로드된 문서에 추가된 해시태그 배열","items":{"type":"string"}},"footer":{"type":"string","description":"업로드된 문서에 추가된 바닥글(출처) 정보"}}}}}}}},"400":{"description":"잘못된 요청 또는 파일 형식"},"413":{"description":"파일 크기가 제한을 초과합니다."}},"parameters":[{"$ref":"#/components/parameters/AgentEmailHeader"},{"$ref":"#/components/parameters/UserEmailHeader"},{"$ref":"#/components/parameters/OwnUserIdHeader"}]}}}}
```

## S3에서 문서 업로드

> 이 API는 S3에 저장된 문서를 Cognitive Search로 전송할 수 있게 합니다. 이 문서들은 대시보드에 지식베이스 문서로 표시됩니다. 사용 가능한 파일 형식은 "문서 업로드" 섹션과 동일합니다.

```json
{"openapi":"3.1.0","info":{"title":"Alli API Documentation","version":"1.0.0"},"tags":[{"name":"knowledge_bases","description":"Knowledge base related APIs"}],"servers":[{"url":"https://backend.alli.ai","description":"US"}],"security":[{"ApiKeyAuth":[]},{"TokenAuth":[]},{"ProjectIdHeader":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"API-KEY","description":"Your API key for authentication"},"TokenAuth":{"type":"http","scheme":"bearer","description":"Your token for authentication"}},"parameters":{"AgentEmailHeader":{"name":"AGENT-EMAIL","in":"header","required":false,"schema":{"type":"string"},"description":"Optional: Email of the agent to use for this request"},"UserEmailHeader":{"name":"USER-EMAIL","in":"header","required":false,"schema":{"type":"string"},"description":"Optional: Email address to associate with the user"},"OwnUserIdHeader":{"name":"OWN-USER-ID","in":"header","required":false,"schema":{"type":"string"},"description":"Optional: User ID to identify or create a user"}}},"paths":{"/webapi/upload_from_s3":{"post":{"tags":["knowledge_bases"],"operationId":"uploadFromS3","summary":"S3에서 문서 업로드","description":"이 API는 S3에 저장된 문서를 Cognitive Search로 전송할 수 있게 합니다. 이 문서들은 대시보드에 지식베이스 문서로 표시됩니다. 사용 가능한 파일 형식은 \"문서 업로드\" 섹션과 동일합니다.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"path":{"type":"string","description":"파일의 S3 경로. 파일 이름으로 끝나야 합니다. 버킷 이름은 포함하지 마세요."},"secretKey":{"type":"string","description":"귀하의 S3 비밀 키."},"accessKey":{"type":"string","description":"당신의 S3 액세스 키."},"bucket":{"type":"string","description":"파일을 포함하는 S3 버킷의 이름입니다."},"footerTitle":{"type":"string","description":"업로드된 파일의 검색 결과에서 정답의 출처를 각주로 작성할 수 있습니다. 각주 텍스트는 검색 결과에서 '출처' 옆에 나타납니다."},"footerUrl":{"type":"string","description":"당신이 연결하고 싶은 URL을 footerTitle에 넣을 수 있습니다."},"hashtags":{"type":"array","description":"문서의 해시태그.","items":{"type":"string"}},"parentFolderId":{"type":"string","description":"업로드할 타겟 폴더 ID. 최상위 수준에 삽입하려면 null로 설정합니다."},"properties":{"type":"object","description":"Properties for the document.","additionalProperties":{"type":"string"}}}}}}},"responses":{"200":{"description":"S3에서 파일이 성공적으로 업로드되었습니다.","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"id":{"type":"string","description":"전송된 문서의 ID."},"file_name":{"type":"string","description":"전송된 문서의 파일명."},"hashtags":{"type":"array","description":"업로드된 문서에 추가된 해시태그 배열.","items":{"type":"string"}},"footer":{"type":"string","description":"업로드한 문서에 바닥글(출처) 정보가 추가되었습니다."}}}}}}}},"400":{"description":"잘못된 요청 매개변수"},"404":{"description":"S3에서 파일을 찾을 수 없음"}},"parameters":[{"$ref":"#/components/parameters/AgentEmailHeader"},{"$ref":"#/components/parameters/UserEmailHeader"},{"$ref":"#/components/parameters/OwnUserIdHeader"}]}}}}
```

## 문서 상태 확인

> API를 통해 문서를 업로드하면, 변환, 구문 분석 및 벡터로 임베딩됩니다. 이 API는 업로드 중인 문서의 프로세스 상태를 보여줍니다.

```json
{"openapi":"3.1.0","info":{"title":"Alli API Documentation","version":"1.0.0"},"tags":[{"name":"knowledge_bases","description":"Knowledge base related APIs"}],"servers":[{"url":"https://backend.alli.ai","description":"US"}],"security":[{"ApiKeyAuth":[]},{"TokenAuth":[]},{"ProjectIdHeader":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"API-KEY","description":"Your API key for authentication"},"TokenAuth":{"type":"http","scheme":"bearer","description":"Your token for authentication"}},"parameters":{"AgentEmailHeader":{"name":"AGENT-EMAIL","in":"header","required":false,"schema":{"type":"string"},"description":"Optional: Email of the agent to use for this request"},"UserEmailHeader":{"name":"USER-EMAIL","in":"header","required":false,"schema":{"type":"string"},"description":"Optional: Email address to associate with the user"},"OwnUserIdHeader":{"name":"OWN-USER-ID","in":"header","required":false,"schema":{"type":"string"},"description":"Optional: User ID to identify or create a user"}}},"paths":{"/webapi/check_file_status":{"get":{"tags":["knowledge_bases"],"operationId":"checkFileStatus","summary":"문서 상태 확인","description":"API를 통해 문서를 업로드하면, 변환, 구문 분석 및 벡터로 임베딩됩니다. 이 API는 업로드 중인 문서의 프로세스 상태를 보여줍니다.","parameters":[{"$ref":"#/components/parameters/AgentEmailHeader"},{"$ref":"#/components/parameters/UserEmailHeader"},{"$ref":"#/components/parameters/OwnUserIdHeader"},{"name":"id","in":"query","required":true,"schema":{"type":"string"},"description":"The document id to check the status"}],"responses":{"200":{"description":"파일 상태를 성공적으로 가져왔습니다.","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"id":{"type":"string","description":"확인 중인 문서의 ID"},"status":{"type":"string","description":"문서의 상태 (예: 초기화, 처리 중, 완료됨, 실패함)"},"errorName":{"type":"string","description":"상태가 실패를 나타내는 경우 오류 이름"}}}}}}}},"400":{"description":"잘못된 작업 ID 또는 파일을 찾을 수 없음"}}}}}}
```

## 문서 이름 변경 (지식베이스)

> 이 API는 업로드된 문서의 이름을 업데이트할 수 있습니다.

```json
{"openapi":"3.1.0","info":{"title":"Alli API Documentation","version":"1.0.0"},"tags":[{"name":"knowledge_bases","description":"Knowledge base related APIs"}],"servers":[{"url":"https://backend.alli.ai","description":"US"}],"security":[{"ApiKeyAuth":[]},{"TokenAuth":[]},{"ProjectIdHeader":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"API-KEY","description":"Your API key for authentication"},"TokenAuth":{"type":"http","scheme":"bearer","description":"Your token for authentication"}},"parameters":{"AgentEmailHeader":{"name":"AGENT-EMAIL","in":"header","required":false,"schema":{"type":"string"},"description":"Optional: Email of the agent to use for this request"},"UserEmailHeader":{"name":"USER-EMAIL","in":"header","required":false,"schema":{"type":"string"},"description":"Optional: Email address to associate with the user"},"OwnUserIdHeader":{"name":"OWN-USER-ID","in":"header","required":false,"schema":{"type":"string"},"description":"Optional: User ID to identify or create a user"}}},"paths":{"/webapi/update_kb_name":{"post":{"tags":["knowledge_bases"],"operationId":"updateKnowledgeBaseName","summary":"문서 이름 변경 (지식베이스)","description":"이 API는 업로드된 문서의 이름을 업데이트할 수 있습니다.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"변경하려는 문서 ID."},"filename":{"type":"string","description":"지정된 문서의 새 이름."}}}}}},"responses":{"200":{"description":"지식베이스 이름이 성공적으로 업데이트되었습니다.","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"id":{"type":"string","description":"파일 이름이 변경된 문서 ID."},"filename":{"type":"string","description":"문서의 새 이름."}}}}}}}},"400":{"description":"유효하지 않은 매개변수"}},"parameters":[{"$ref":"#/components/parameters/AgentEmailHeader"},{"$ref":"#/components/parameters/UserEmailHeader"},{"$ref":"#/components/parameters/OwnUserIdHeader"}]}}}}
```

## 제목으로 문서 검색

> 이 API는 문서의 내용이 아닌 제목으로 문서를 검색할 수 있게 합니다.

```json
{"openapi":"3.1.0","info":{"title":"Alli API Documentation","version":"1.0.0"},"tags":[{"name":"knowledge_bases","description":"Knowledge base related APIs"}],"servers":[{"url":"https://backend.alli.ai","description":"US"}],"security":[{"ApiKeyAuth":[]},{"TokenAuth":[]},{"ProjectIdHeader":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"API-KEY","description":"Your API key for authentication"},"TokenAuth":{"type":"http","scheme":"bearer","description":"Your token for authentication"}},"parameters":{"AgentEmailHeader":{"name":"AGENT-EMAIL","in":"header","required":false,"schema":{"type":"string"},"description":"Optional: Email of the agent to use for this request"},"UserEmailHeader":{"name":"USER-EMAIL","in":"header","required":false,"schema":{"type":"string"},"description":"Optional: Email address to associate with the user"},"OwnUserIdHeader":{"name":"OWN-USER-ID","in":"header","required":false,"schema":{"type":"string"},"description":"Optional: User ID to identify or create a user"}}},"paths":{"/webapi/search_document_by_title":{"get":{"tags":["knowledge_bases"],"operationId":"searchDocumentByTitle","summary":"제목으로 문서 검색","description":"이 API는 문서의 내용이 아닌 제목으로 문서를 검색할 수 있게 합니다.","parameters":[{"$ref":"#/components/parameters/AgentEmailHeader"},{"$ref":"#/components/parameters/UserEmailHeader"},{"$ref":"#/components/parameters/OwnUserIdHeader"},{"name":"query","in":"query","required":true,"schema":{"type":"string"},"description":"문서를 제외할 해시태그의 쉼표로 구분된 목록."},{"name":"hashtags","in":"query","required":false,"schema":{"type":"string"},"description":"Semantic matching에 벡터 검색을 사용하려면 'true'로 설정하고, 텍스트 기반 검색을 사용하려면 'false'로 설정합니다."},{"name":"combinedHashtags","in":"query","required":false,"schema":{"type":"string"},"description":"결과를 정렬할 속성 필드."},{"name":"excludingHashtags","in":"query","required":false,"schema":{"type":"string"},"description":"결과를 정렬할 방향(오름차순 또는 내림차순)."},{"name":"useVector","in":"query","required":false,"schema":{"type":"string"},"description":"페이지네이션을 위한 생략된 결과 수."},{"name":"sortKey","in":"query","required":false,"schema":{"type":"string"},"description":"반환할 최대 결과 수."},{"name":"sortDirection","in":"query","required":false,"schema":{"type":"string","enum":["asc","desc"]},"description":"The direction to sort results in (ascending or descending)."},{"name":"offset","in":"query","required":false,"schema":{"type":"integer"},"description":"Number of results to skip for pagination."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer"},"description":"Maximum number of results to return."}],"responses":{"200":{"description":"제목으로 문서를 성공적으로 검색했습니다.","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"문서의 ID."},"file_name":{"type":"string","description":"문서의 파일 이름."},"page_count":{"type":"integer","description":"문서의 페이지 수."},"download_url":{"type":"string","description":"문서를 다운로드할 수 있는 URL."},"hashtags":{"type":"array","items":{"type":"string"},"description":"문서와 관련된 해시태그."},"score":{"type":"number","description":"검색 쿼리에 대한 관련성 점수."},"folder":{"type":"string","description":"문서를 포함하는 폴더."},"agentEditor":{"type":"array","items":{"type":"string"},"description":"편집 권한이 있는 에이전트 목록."},"agentViewer":{"type":"array","items":{"type":"string"},"description":"보기 권한이 있는 에이전트 목록."}}}}}}}}}}}}}}
```

## 문서 삭제

> 이 API는 업로드된 파일을 삭제할 수 있게 해줍니다.

```json
{"openapi":"3.1.0","info":{"title":"Alli API Documentation","version":"1.0.0"},"tags":[{"name":"knowledge_bases","description":"Knowledge base related APIs"}],"servers":[{"url":"https://backend.alli.ai","description":"US"}],"security":[{"ApiKeyAuth":[]},{"TokenAuth":[]},{"ProjectIdHeader":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"API-KEY","description":"Your API key for authentication"},"TokenAuth":{"type":"http","scheme":"bearer","description":"Your token for authentication"}},"parameters":{"AgentEmailHeader":{"name":"AGENT-EMAIL","in":"header","required":false,"schema":{"type":"string"},"description":"Optional: Email of the agent to use for this request"},"UserEmailHeader":{"name":"USER-EMAIL","in":"header","required":false,"schema":{"type":"string"},"description":"Optional: Email address to associate with the user"},"OwnUserIdHeader":{"name":"OWN-USER-ID","in":"header","required":false,"schema":{"type":"string"},"description":"Optional: User ID to identify or create a user"}}},"paths":{"/webapi/delete_file":{"post":{"tags":["knowledge_bases"],"operationId":"deleteFile","summary":"문서 삭제","description":"이 API는 업로드된 파일을 삭제할 수 있게 해줍니다.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"type":"array","description":"배열 형식으로 삭제하려는 문서 ID들","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"파일이 성공적으로 삭제되었습니다.","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"ok":{"type":"boolean","description":"삭제가 성공적으로 완료되면 true입니다."}}},"errors":{"type":"object","nullable":true,"description":"삭제가 실패하면, 여기에 오류 메시지가 포함될 것입니다."}}}}}}},"parameters":[{"$ref":"#/components/parameters/AgentEmailHeader"},{"$ref":"#/components/parameters/UserEmailHeader"},{"$ref":"#/components/parameters/OwnUserIdHeader"}]}}}}
```

## List Documents

> This API lets you list out the uploaded documents.<br>

```json
{"openapi":"3.1.0","info":{"title":"Alli API Documentation","version":"1.0.0"},"tags":[{"name":"knowledge_bases","description":"Knowledge base related APIs"}],"servers":[{"url":"https://backend.alli.ai","description":"US"}],"security":[{"ApiKeyAuth":[]},{"TokenAuth":[]},{"ProjectIdHeader":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"API-KEY","description":"Your API key for authentication"},"TokenAuth":{"type":"http","scheme":"bearer","description":"Your token for authentication"}},"parameters":{"AgentEmailHeader":{"name":"AGENT-EMAIL","in":"header","required":false,"schema":{"type":"string"},"description":"Optional: Email of the agent to use for this request"},"UserEmailHeader":{"name":"USER-EMAIL","in":"header","required":false,"schema":{"type":"string"},"description":"Optional: Email address to associate with the user"},"OwnUserIdHeader":{"name":"OWN-USER-ID","in":"header","required":false,"schema":{"type":"string"},"description":"Optional: User ID to identify or create a user"}}},"paths":{"/webapi/knowledge_bases":{"get":{"tags":["knowledge_bases"],"operationId":"knowledgeBases","summary":"List Documents","description":"This API lets you list out the uploaded documents.\n","parameters":[{"$ref":"#/components/parameters/AgentEmailHeader"},{"$ref":"#/components/parameters/UserEmailHeader"},{"$ref":"#/components/parameters/OwnUserIdHeader"},{"name":"hashtagsSearchOperator","in":"query","required":false,"schema":{"type":"string","enum":["AND","OR"],"default":"OR"},"description":"Either AND or OR, logical operator used to match multiple hashtags. Defaults to OR."},{"name":"status","in":"query","required":false,"schema":{"type":"boolean"},"description":"The on/off status of the document to filter the list."},{"name":"searchTerm","in":"query","required":false,"schema":{"type":"string"},"description":"Keyword search query to filter the list. You can use operators to run advanced searches. \"TERM1 TERM2\" for AND, \"TERM1 OR TERM2\" for OR, and \"TERM\\ for exact match."},{"name":"hashtags","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"}},"description":"Hashtag information to filter the list."},{"name":"order","in":"query","required":false,"schema":{"type":"string","enum":["FILE_NAME_ASC","FILE_NAME_DESC","TYPE_ASC","TYPE_DESC","STATUS_ASC","STATUS_DESC","CREATED_AT_ASC","CREATED_AT_DESC"]},"description":"The order type of the list. FILE_NAME_ASC/DESC for file name, TYPE_ASC/DESC for file type, STATUS_ASC/DESC for on/off status, CREATED_AT_ASC/DESC for upload date."},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0},"description":"offset allows you to specify the ranking number of the first item on the page."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100},"description":"limit allows you to set the number of objects returned on one page. The maximum value is 100."}],"responses":{"200":{"description":"Successfully retrieved list of documents","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The ID of the listed document."},"fileName":{"type":"string","description":"The filename of the list document."},"hashtags":{"type":"array","items":{"type":"string"},"description":"The hashtags added on the document."},"autoHashtags":{"type":"array","items":{"type":"object"},"description":"The automatically generated hashtags added to the document."},"folder":{"type":"string","description":"The folder where the document is located."},"agentEditor":{"type":"array","items":{"type":"string"},"description":"List of agent emails with editor permissions."},"agentViewer":{"type":"array","items":{"type":"string"},"description":"List of agent emails with viewer permissions."},"userViewer":{"type":"object","properties":{"variables":{"type":"object"}},"description":"User viewer configuration with variables."},"allowOtherAgentsView":{"type":"boolean","description":"Whether other agents can view this document."},"allowOtherUsersView":{"type":"boolean","description":"Whether other users can view this document."}}}}}},"errors":{"type":"object","nullable":true,"description":"Error information if the request fails"}}}}}}}}}}}
```

## Preview Documents

> This API lets you preview the uploaded documents.<br>

```json
{"openapi":"3.1.0","info":{"title":"Alli API Documentation","version":"1.0.0"},"tags":[{"name":"knowledge_bases","description":"Knowledge base related APIs"}],"servers":[{"url":"https://backend.alli.ai","description":"US"}],"security":[{"ApiKeyAuth":[]},{"TokenAuth":[]},{"ProjectIdHeader":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"API-KEY","description":"Your API key for authentication"},"TokenAuth":{"type":"http","scheme":"bearer","description":"Your token for authentication"}},"parameters":{"AgentEmailHeader":{"name":"AGENT-EMAIL","in":"header","required":false,"schema":{"type":"string"},"description":"Optional: Email of the agent to use for this request"},"UserEmailHeader":{"name":"USER-EMAIL","in":"header","required":false,"schema":{"type":"string"},"description":"Optional: Email address to associate with the user"},"OwnUserIdHeader":{"name":"OWN-USER-ID","in":"header","required":false,"schema":{"type":"string"},"description":"Optional: User ID to identify or create a user"}}},"paths":{"/webapi/knowledge_base_preview":{"get":{"tags":["knowledge_bases"],"operationId":"knowledgeBasePreview","summary":"Preview Documents","description":"This API lets you preview the uploaded documents.\n","parameters":[{"$ref":"#/components/parameters/AgentEmailHeader"},{"$ref":"#/components/parameters/UserEmailHeader"},{"$ref":"#/components/parameters/OwnUserIdHeader"},{"name":"id","in":"query","required":true,"schema":{"type":"string"},"description":"The document ID that you want to preview"},{"name":"pageNo","in":"query","required":true,"schema":{"type":"string"},"description":"Pages of the document you want to preview"}],"responses":{"200":{"description":"Successfully retrieved document preview","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"totalPageCount":{"type":"integer","description":"Total number of pages in the document"},"pageNo":{"type":"integer","description":"Current page number being previewed"},"css":{"type":"string","nullable":true,"description":"CSS styling for the document"},"body":{"type":"string","nullable":true,"description":"HTML body content of the document"},"highlightIndexes":{"type":"array","items":{"type":"integer"},"description":"Array of highlight indexes"},"exactAnswer":{"type":"string","nullable":true,"description":"Exact answer if available"},"pdf":{"type":"string","nullable":true,"description":"PDF content or \"PDF\" string. Returns null if there's an error like invalid pageNo."},"draftjs":{"type":"string","nullable":true,"description":"DraftJS format content"},"highlights":{"type":"object","properties":{"indexes":{"type":"array","nullable":true,"items":{"type":"integer"},"description":"Highlight indexes"},"pageIndexes":{"type":"array","items":{"type":"integer"},"description":"Page-specific highlight indexes"},"__typename":{"type":"string","description":"GraphQL typename"}},"description":"Highlight information for the document"},"knowledgeBase":{"type":"object","properties":{"id":{"type":"string","description":"The ID of the document"},"title":{"type":"string","description":"The title of the document"},"__typename":{"type":"string","description":"GraphQL typename"}},"description":"Knowledge base information"},"__typename":{"type":"string","description":"GraphQL typename"}}},"errors":{"type":"object","nullable":true,"description":"Error information if the request fails"}}}}}}}}}}}
```

## Update Documents

> This API lets you update hashtags, footer title, and footer title link for a document.<br>

```json
{"openapi":"3.1.0","info":{"title":"Alli API Documentation","version":"1.0.0"},"tags":[{"name":"knowledge_bases","description":"Knowledge base related APIs"}],"servers":[{"url":"https://backend.alli.ai","description":"US"}],"security":[{"ApiKeyAuth":[]},{"TokenAuth":[]},{"ProjectIdHeader":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"API-KEY","description":"Your API key for authentication"},"TokenAuth":{"type":"http","scheme":"bearer","description":"Your token for authentication"}},"parameters":{"AgentEmailHeader":{"name":"AGENT-EMAIL","in":"header","required":false,"schema":{"type":"string"},"description":"Optional: Email of the agent to use for this request"},"UserEmailHeader":{"name":"USER-EMAIL","in":"header","required":false,"schema":{"type":"string"},"description":"Optional: Email address to associate with the user"},"OwnUserIdHeader":{"name":"OWN-USER-ID","in":"header","required":false,"schema":{"type":"string"},"description":"Optional: User ID to identify or create a user"}}},"paths":{"/webapi/update_document":{"post":{"tags":["knowledge_bases"],"operationId":"updateDocument","summary":"Update Documents","description":"This API lets you update hashtags, footer title, and footer title link for a document.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"string","description":"The id of the document you want to update"},"footerTitle":{"type":"string","description":"You can type in the source of the answer as a footer for search results from the uploaded file. The footer text will appear next to 'From' in search results."},"footerUrl":{"type":"string","description":"You can put the URL you want to link to the footerTitle."},"folder":{"type":"string","description":"You can assign the destination folder for document upload."},"followFolderPermission":{"type":"boolean","description":"Whether to follow the folder's permission settings."},"agentsEditor":{"type":"array","items":{"type":"string"},"description":"Specify agents that have editor permissions for the file."},"agentsViewer":{"type":"array","items":{"type":"string"},"description":"Specify agents that have viewer permissions for the file."},"userViewer":{"type":"object","description":"Users who have permission to view the document.","properties":{"customer_id":{"type":"array","items":{"type":"string"}},"customer_group":{"type":"array","items":{"type":"string"}}}},"allowOtherAgentsView":{"type":"boolean","description":"Agents not included in viewers/editors can also view the document."},"allowOtherUsersView":{"type":"boolean","description":"Users not included in viewers/editors can also view the document."},"hashtags":{"type":"array","items":{"type":"string"},"description":"List of string hashtags you want to add to the document"},"properties":{"type":"object","description":"Properties for the document.","additionalProperties":{"type":"string"}}}}}}},"responses":{"200":{"description":"Document updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"knowledgeBase":{"type":"object","properties":{"id":{"type":"string","description":"The id of the document to which the hashtags correspond"},"hashtags":{"type":"array","items":{"type":"string"},"description":"Hashtags attached to the document after update"},"footer":{"type":"string","description":"The footer (source) info added to the uploaded document. It can be the default one or the one specified by footerTitle and footerUrl parameters. Formatted in HTML."}}}}},"errors":{"type":"object","nullable":true,"description":"Error information if the request fails"}}}}}}},"parameters":[{"$ref":"#/components/parameters/AgentEmailHeader"},{"$ref":"#/components/parameters/UserEmailHeader"},{"$ref":"#/components/parameters/OwnUserIdHeader"}]}}}}
```

## Knowledge Base Toggle Status

> This API lets you change the status of many documents (AKA knowledge bases) at once<br>

```json
{"openapi":"3.1.0","info":{"title":"Alli API Documentation","version":"1.0.0"},"tags":[{"name":"knowledge_bases","description":"Knowledge base related APIs"}],"servers":[{"url":"https://backend.alli.ai","description":"US"}],"security":[{"ApiKeyAuth":[]},{"TokenAuth":[]},{"ProjectIdHeader":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"API-KEY","description":"Your API key for authentication"},"TokenAuth":{"type":"http","scheme":"bearer","description":"Your token for authentication"}},"parameters":{"AgentEmailHeader":{"name":"AGENT-EMAIL","in":"header","required":false,"schema":{"type":"string"},"description":"Optional: Email of the agent to use for this request"},"UserEmailHeader":{"name":"USER-EMAIL","in":"header","required":false,"schema":{"type":"string"},"description":"Optional: Email address to associate with the user"},"OwnUserIdHeader":{"name":"OWN-USER-ID","in":"header","required":false,"schema":{"type":"string"},"description":"Optional: User ID to identify or create a user"}}},"paths":{"/webapi/toggle_documents":{"post":{"tags":["knowledge_bases"],"operationId":"toggleDocuments","summary":"Knowledge Base Toggle Status","description":"This API lets you change the status of many documents (AKA knowledge bases) at once\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["use","ids"],"properties":{"use":{"type":"boolean","description":"Whether to turn all the status of all the knowledge bases to on (True) or off (False)"},"ids":{"type":"array","items":{"type":"string"},"description":"This is a list of the ids of the knowledge bases that you want to toggle."}}}}}},"responses":{"200":{"description":"Knowledge base statuses toggled successfully","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"knowledgeBases":{"type":"array","description":"A list of ONLY the knowledge bases whose status were toggled","items":{"type":"object","properties":{"id":{"type":"string","description":"id of knowledge base"},"status":{"type":"boolean","description":"new status of knowledge base (boolean). true meaning status is now on."}}}}}},"errors":{"type":"object","nullable":true,"description":"Error information if the request fails"}}}}}}},"parameters":[{"$ref":"#/components/parameters/AgentEmailHeader"},{"$ref":"#/components/parameters/UserEmailHeader"},{"$ref":"#/components/parameters/OwnUserIdHeader"}]}}}}
```
