> For the complete documentation index, see [llms.txt](https://docs.allganize.ai/api-reference/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.allganize.ai/api-reference/rag.md).

# RAG

Retrieval, generative answer, and highlight related APIs

## Get Answer Highlight

> This API allows you to retrieve bounding box coordinates for answer highlights in a knowledge base document page.\
> \
> \## Headers\
> \
> \- API-KEY (string, required): Your assigned API key. You can find it in the Settings menu of the dashboard.\
> \- AGENT-EMAIL (string, optional): The email address of the agent performing the API call.\
> \- USER-EMAIL (string, optional): The email address to associate with the user.\
> \- OWN-USER-ID (string, optional): The user ID to identify or create a user.

```json
{"openapi":"3.1.0","info":{"title":"Alli API Documentation","version":"1.0.0"},"tags":[{"name":"RAG","description":"Retrieval, generative answer, and highlight related APIs"}],"servers":[{"url":"https://backend.alli.ai","description":"US"},{"url":"https://backend-ja.alli.ai","description":"JA"}],"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":{"HighlightResponse":{"properties":{"bboxes":{"items":{"$ref":"#/components/schemas/BboxResponse"},"title":"Bboxes","type":"array"},"type":{"$ref":"#/components/schemas/AnswerType"}},"required":["bboxes","type"],"title":"HighlightResponse","type":"object"},"BboxResponse":{"properties":{"left":{"title":"Left","type":"number"},"top":{"title":"Top","type":"number"},"right":{"title":"Right","type":"number"},"bottom":{"title":"Bottom","type":"number"}},"required":["left","top","right","bottom"],"title":"BboxResponse","type":"object"},"AnswerType":{"description":"Enum representing different types of answers that can be provided.","enum":["PARAGRAPH","TABLE","IMAGE"],"title":"AnswerType","type":"string"}}},"paths":{"/webapi/v2/highlights/{clue_id}":{"get":{"operationId":"django_server_rag_views_rest_answer_highlight_api_get_highlight","summary":"Get Answer Highlight","parameters":[{"$ref":"#/components/parameters/AgentEmailHeader"},{"$ref":"#/components/parameters/UserEmailHeader"},{"$ref":"#/components/parameters/OwnUserIdHeader"},{"in":"path","name":"clue_id","schema":{"title":"Clue Id","type":"string"},"required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HighlightResponse"}}}},"400":{"description":"Invalid request parameters."},"401":{"description":"Authentication failed. The API-KEY header is missing or invalid."},"403":{"description":"Access denied. The project is inactive or the request IP is not allowed."},"500":{"description":"Internal server error."}},"description":"This API allows you to retrieve bounding box coordinates for answer highlights in a knowledge base document page.\n\n## Headers\n\n- API-KEY (string, required): Your assigned API key. You can find it in the Settings menu of the dashboard.\n- AGENT-EMAIL (string, optional): The email address of the agent performing the API call.\n- USER-EMAIL (string, optional): The email address to associate with the user.\n- OWN-USER-ID (string, optional): The user ID to identify or create a user.","tags":["RAG"]}}}}
```

## Highlight Retrieval Result

> Return highlight bboxes for a single Retrieval result resolved straight from the retrieved page chunk (kbId + pageNo + subTextIndex), without a generative-answer clue id.

```json
{"openapi":"3.1.0","info":{"title":"Alli API Documentation","version":"1.0.0"},"tags":[{"name":"RAG","description":"Retrieval, generative answer, and highlight related APIs"}],"servers":[{"url":"https://backend.alli.ai","description":"US"},{"url":"https://backend-ja.alli.ai","description":"JA"}],"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":{"HighlightResponse":{"properties":{"bboxes":{"items":{"$ref":"#/components/schemas/BboxResponse"},"title":"Bboxes","type":"array"},"type":{"$ref":"#/components/schemas/AnswerType"}},"required":["bboxes","type"],"title":"HighlightResponse","type":"object"},"BboxResponse":{"properties":{"left":{"title":"Left","type":"number"},"top":{"title":"Top","type":"number"},"right":{"title":"Right","type":"number"},"bottom":{"title":"Bottom","type":"number"}},"required":["left","top","right","bottom"],"title":"BboxResponse","type":"object"},"AnswerType":{"description":"Enum representing different types of answers that can be provided.","enum":["PARAGRAPH","TABLE","IMAGE"],"title":"AnswerType","type":"string"},"RetrievalHighlightRequest":{"properties":{"kbId":{"minLength":1,"title":"Kbid","type":"string"},"pageNo":{"minimum":1,"title":"Pageno","type":"integer"},"subTextIndex":{"default":1,"minimum":0,"title":"Subtextindex","type":"integer"},"passageText":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Passagetext"},"question":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Question"},"answer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Answer"}},"required":["kbId","pageNo"],"title":"RetrievalHighlightRequest","type":"object"}}},"paths":{"/webapi/v2/retrieval/highlight":{"post":{"operationId":"django_server_rag_views_rest_retrieval_v2_api_retrieval_highlight","summary":"Highlight Retrieval Result","parameters":[{"$ref":"#/components/parameters/AgentEmailHeader"},{"$ref":"#/components/parameters/UserEmailHeader"},{"$ref":"#/components/parameters/OwnUserIdHeader"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HighlightResponse"}}}},"400":{"description":"Invalid request parameters."},"401":{"description":"Authentication failed. The API-KEY header is missing or invalid."},"403":{"description":"Access denied. The project is inactive or the request IP is not allowed."},"500":{"description":"Internal server error."}},"description":"Return highlight bboxes for a single Retrieval result resolved straight from the retrieved page chunk (kbId + pageNo + subTextIndex), without a generative-answer clue id.","tags":["RAG"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetrievalHighlightRequest"}}},"required":true}}}}}
```

## Get RARE Status

> This API allows you to retrieve the RARE build/generate status for the project.\
> \
> \## Headers\
> \
> \- API-KEY (string, required): Your assigned API key. You can find it in the Settings menu of the dashboard.\
> \- AGENT-EMAIL (string, optional): The email address of the agent performing the API call.\
> \- USER-EMAIL (string, optional): The email address to associate with the user.\
> \- OWN-USER-ID (string, optional): The user ID to identify or create a user.

```json
{"openapi":"3.1.0","info":{"title":"Alli API Documentation","version":"1.0.0"},"tags":[{"name":"RAG","description":"Retrieval, generative answer, and highlight related APIs"}],"servers":[{"url":"https://backend.alli.ai","description":"US"},{"url":"https://backend-ja.alli.ai","description":"JA"}],"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":{"RareStatusResponse":{"properties":{"build_status":{"title":"Build Status","type":"string"},"job_status":{"title":"Job Status","type":"string"},"job_type":{"title":"Job Type","type":"string"},"build_run_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Build Run Id"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"build_progress":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Build Progress"},"generate_progress":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Generate Progress"},"build_stats":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Build Stats"},"generate_stats":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Generate Stats"},"folder_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Folder Ids"},"default_model":{"default":"","title":"Default Model","type":"string"},"generation_model":{"default":"","title":"Generation Model","type":"string"}},"required":["build_status","job_status","job_type"],"title":"RareStatusResponse","type":"object"}}},"paths":{"/webapi/v2/rare/status":{"get":{"operationId":"django_server_rag_views_rest_rare_api_rare_status","summary":"Get RARE Status","parameters":[{"$ref":"#/components/parameters/AgentEmailHeader"},{"$ref":"#/components/parameters/UserEmailHeader"},{"$ref":"#/components/parameters/OwnUserIdHeader"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RareStatusResponse"}}}},"400":{"description":"Invalid request parameters."},"401":{"description":"Authentication failed. The API-KEY header is missing or invalid."},"403":{"description":"Access denied. The project is inactive or the request IP is not allowed."},"500":{"description":"Internal server error."}},"description":"This API allows you to retrieve the RARE build/generate status for the project.\n\n## Headers\n\n- API-KEY (string, required): Your assigned API key. You can find it in the Settings menu of the dashboard.\n- AGENT-EMAIL (string, optional): The email address of the agent performing the API call.\n- USER-EMAIL (string, optional): The email address to associate with the user.\n- OWN-USER-ID (string, optional): The user ID to identify or create a user.","tags":["RAG"]}}}}
```

## Start RARE Build

> This API allows you to start a RARE build task for the project.\
> \
> \## Headers\
> \
> \- API-KEY (string, required): Your assigned API key. You can find it in the Settings menu of the dashboard.\
> \- AGENT-EMAIL (string, optional): The email address of the agent performing the API call.\
> \- USER-EMAIL (string, optional): The email address to associate with the user.\
> \- OWN-USER-ID (string, optional): The user ID to identify or create a user.\
> \
> \## Request Body\
> \
> \- language (string, optional): Language for the build.\
> \- default\_model (string, optional): Default LLM model to use.\
> \- similarity\_threshold (number, optional): Similarity threshold for matching.\
> \- top\_k\_per\_chunk (integer, optional): Top K results per chunk.\
> \- max\_similar\_items (integer, optional): Maximum similar items to return.\
> \- max\_workers (integer, optional): Maximum parallel workers.\
> \- folder\_ids (array\[string], optional): Folder IDs to include in the build.

```json
{"openapi":"3.1.0","info":{"title":"Alli API Documentation","version":"1.0.0"},"tags":[{"name":"RAG","description":"Retrieval, generative answer, and highlight related APIs"}],"servers":[{"url":"https://backend.alli.ai","description":"US"},{"url":"https://backend-ja.alli.ai","description":"JA"}],"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":{"RareJobResponse":{"properties":{"message":{"title":"Message","type":"string"},"task_id":{"title":"Task Id","type":"string"}},"required":["message","task_id"],"title":"RareJobResponse","type":"object"},"RareBuildRequest":{"properties":{"language":{"default":"Korean","title":"Language","type":"string"},"default_model":{"default":"gpt54_nano","title":"Default Model","type":"string"},"similarity_threshold":{"default":0.5,"title":"Similarity Threshold","type":"number"},"top_k_per_chunk":{"default":1,"title":"Top K Per Chunk","type":"integer"},"max_similar_items":{"default":256,"title":"Max Similar Items","type":"integer"},"max_workers":{"default":100,"title":"Max Workers","type":"integer"},"folder_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Folder Ids"}},"title":"RareBuildRequest","type":"object"}}},"paths":{"/webapi/v2/rare/build":{"post":{"operationId":"django_server_rag_views_rest_rare_api_rare_build","summary":"Start RARE Build","parameters":[{"$ref":"#/components/parameters/AgentEmailHeader"},{"$ref":"#/components/parameters/UserEmailHeader"},{"$ref":"#/components/parameters/OwnUserIdHeader"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RareJobResponse"}}}},"400":{"description":"Invalid request parameters."},"401":{"description":"Authentication failed. The API-KEY header is missing or invalid."},"403":{"description":"Access denied. The project is inactive or the request IP is not allowed."},"500":{"description":"Internal server error."}},"description":"This API allows you to start a RARE build task for the project.\n\n## Headers\n\n- API-KEY (string, required): Your assigned API key. You can find it in the Settings menu of the dashboard.\n- AGENT-EMAIL (string, optional): The email address of the agent performing the API call.\n- USER-EMAIL (string, optional): The email address to associate with the user.\n- OWN-USER-ID (string, optional): The user ID to identify or create a user.\n\n## Request Body\n\n- language (string, optional): Language for the build.\n- default_model (string, optional): Default LLM model to use.\n- similarity_threshold (number, optional): Similarity threshold for matching.\n- top_k_per_chunk (integer, optional): Top K results per chunk.\n- max_similar_items (integer, optional): Maximum similar items to return.\n- max_workers (integer, optional): Maximum parallel workers.\n- folder_ids (array[string], optional): Folder IDs to include in the build.","tags":["RAG"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RareBuildRequest"}}},"required":true}}}}}
```

## Start RARE Generate

> This API allows you to start a RARE generate task. Requires build to be completed first.\
> \
> \## Headers\
> \
> \- API-KEY (string, required): Your assigned API key. You can find it in the Settings menu of the dashboard.\
> \- AGENT-EMAIL (string, optional): The email address of the agent performing the API call.\
> \- USER-EMAIL (string, optional): The email address to associate with the user.\
> \- OWN-USER-ID (string, optional): The user ID to identify or create a user.\
> \
> \## Request Body\
> \
> \- num\_samples (integer, optional): Number of samples to generate.\
> \- input\_pool\_size (integer, optional): Input pool size.\
> \- num\_questions (integer, optional): Number of questions per sample.\
> \- num\_information (integer, optional): Number of information items per sample.\
> \- language (string, optional): Language for generation.\
> \- default\_model (string, optional): Default LLM model.\
> \- generation\_model (string, optional): Model to use for generation.\
> \- rare\_user\_prompt (string, optional): Custom user prompt for generation.

```json
{"openapi":"3.1.0","info":{"title":"Alli API Documentation","version":"1.0.0"},"tags":[{"name":"RAG","description":"Retrieval, generative answer, and highlight related APIs"}],"servers":[{"url":"https://backend.alli.ai","description":"US"},{"url":"https://backend-ja.alli.ai","description":"JA"}],"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":{"RareJobResponse":{"properties":{"message":{"title":"Message","type":"string"},"task_id":{"title":"Task Id","type":"string"}},"required":["message","task_id"],"title":"RareJobResponse","type":"object"},"RareGenerateRequest":{"properties":{"num_samples":{"default":10,"title":"Num Samples","type":"integer"},"input_pool_size":{"default":50,"title":"Input Pool Size","type":"integer"},"num_questions":{"default":10,"title":"Num Questions","type":"integer"},"num_information":{"default":2,"title":"Num Information","type":"integer"},"language":{"default":"Korean","title":"Language","type":"string"},"default_model":{"default":"gpt54_nano","title":"Default Model","type":"string"},"generation_model":{"default":"gpt54","title":"Generation Model","type":"string"},"rare_user_prompt":{"default":"","title":"Rare User Prompt","type":"string"}},"title":"RareGenerateRequest","type":"object"}}},"paths":{"/webapi/v2/rare/generate":{"post":{"operationId":"django_server_rag_views_rest_rare_api_rare_generate","summary":"Start RARE Generate","parameters":[{"$ref":"#/components/parameters/AgentEmailHeader"},{"$ref":"#/components/parameters/UserEmailHeader"},{"$ref":"#/components/parameters/OwnUserIdHeader"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RareJobResponse"}}}},"400":{"description":"Invalid request parameters."},"401":{"description":"Authentication failed. The API-KEY header is missing or invalid."},"403":{"description":"Access denied. The project is inactive or the request IP is not allowed."},"500":{"description":"Internal server error."}},"description":"This API allows you to start a RARE generate task. Requires build to be completed first.\n\n## Headers\n\n- API-KEY (string, required): Your assigned API key. You can find it in the Settings menu of the dashboard.\n- AGENT-EMAIL (string, optional): The email address of the agent performing the API call.\n- USER-EMAIL (string, optional): The email address to associate with the user.\n- OWN-USER-ID (string, optional): The user ID to identify or create a user.\n\n## Request Body\n\n- num_samples (integer, optional): Number of samples to generate.\n- input_pool_size (integer, optional): Input pool size.\n- num_questions (integer, optional): Number of questions per sample.\n- num_information (integer, optional): Number of information items per sample.\n- language (string, optional): Language for generation.\n- default_model (string, optional): Default LLM model.\n- generation_model (string, optional): Model to use for generation.\n- rare_user_prompt (string, optional): Custom user prompt for generation.","tags":["RAG"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RareGenerateRequest"}}},"required":true}}}}}
```

## Cancel RARE Job

> This API allows you to request cooperative cancellation for a running RARE job.\
> \
> \## Headers\
> \
> \- API-KEY (string, required): Your assigned API key. You can find it in the Settings menu of the dashboard.\
> \- AGENT-EMAIL (string, optional): The email address of the agent performing the API call.\
> \- USER-EMAIL (string, optional): The email address to associate with the user.\
> \- OWN-USER-ID (string, optional): The user ID to identify or create a user.

```json
{"openapi":"3.1.0","info":{"title":"Alli API Documentation","version":"1.0.0"},"tags":[{"name":"RAG","description":"Retrieval, generative answer, and highlight related APIs"}],"servers":[{"url":"https://backend.alli.ai","description":"US"},{"url":"https://backend-ja.alli.ai","description":"JA"}],"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":{"RareJobResponse":{"properties":{"message":{"title":"Message","type":"string"},"task_id":{"title":"Task Id","type":"string"}},"required":["message","task_id"],"title":"RareJobResponse","type":"object"}}},"paths":{"/webapi/v2/rare/cancel":{"post":{"operationId":"django_server_rag_views_rest_rare_api_rare_cancel","summary":"Cancel RARE Job","parameters":[{"$ref":"#/components/parameters/AgentEmailHeader"},{"$ref":"#/components/parameters/UserEmailHeader"},{"$ref":"#/components/parameters/OwnUserIdHeader"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RareJobResponse"}}}},"400":{"description":"Invalid request parameters."},"401":{"description":"Authentication failed. The API-KEY header is missing or invalid."},"403":{"description":"Access denied. The project is inactive or the request IP is not allowed."},"500":{"description":"Internal server error."}},"description":"This API allows you to request cooperative cancellation for a running RARE job.\n\n## Headers\n\n- API-KEY (string, required): Your assigned API key. You can find it in the Settings menu of the dashboard.\n- AGENT-EMAIL (string, optional): The email address of the agent performing the API call.\n- USER-EMAIL (string, optional): The email address to associate with the user.\n- OWN-USER-ID (string, optional): The user ID to identify or create a user.","tags":["RAG"]}}}}
```

## List RARE Results

> This API allows you to list recent RARE generate results for the project.\
> \
> \## Headers\
> \
> \- API-KEY (string, required): Your assigned API key. You can find it in the Settings menu of the dashboard.\
> \- AGENT-EMAIL (string, optional): The email address of the agent performing the API call.\
> \- USER-EMAIL (string, optional): The email address to associate with the user.\
> \- OWN-USER-ID (string, optional): The user ID to identify or create a user.

```json
{"openapi":"3.1.0","info":{"title":"Alli API Documentation","version":"1.0.0"},"tags":[{"name":"RAG","description":"Retrieval, generative answer, and highlight related APIs"}],"servers":[{"url":"https://backend.alli.ai","description":"US"},{"url":"https://backend-ja.alli.ai","description":"JA"}],"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":{"RareResultsResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/RareResultItem"},"title":"Results","type":"array"}},"required":["results"],"title":"RareResultsResponse","type":"object"},"RareResultItem":{"properties":{"id":{"title":"Id","type":"string"},"created_at":{"title":"Created At","type":"string"},"n_samples":{"title":"N Samples","type":"integer"},"rare_config":{"title":"Rare Config","type":"string"},"result_file_url":{"title":"Result File Url","type":"string"}},"required":["id","created_at","n_samples","rare_config","result_file_url"],"title":"RareResultItem","type":"object"}}},"paths":{"/webapi/v2/rare/results":{"get":{"operationId":"django_server_rag_views_rest_rare_api_rare_results","summary":"List RARE Results","parameters":[{"$ref":"#/components/parameters/AgentEmailHeader"},{"$ref":"#/components/parameters/UserEmailHeader"},{"$ref":"#/components/parameters/OwnUserIdHeader"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RareResultsResponse"}}}},"400":{"description":"Invalid request parameters."},"401":{"description":"Authentication failed. The API-KEY header is missing or invalid."},"403":{"description":"Access denied. The project is inactive or the request IP is not allowed."},"500":{"description":"Internal server error."}},"description":"This API allows you to list recent RARE generate results for the project.\n\n## Headers\n\n- API-KEY (string, required): Your assigned API key. You can find it in the Settings menu of the dashboard.\n- AGENT-EMAIL (string, optional): The email address of the agent performing the API call.\n- USER-EMAIL (string, optional): The email address to associate with the user.\n- OWN-USER-ID (string, optional): The user ID to identify or create a user.","tags":["RAG"]}}}}
```

## Delete RARE Result

> This API allows you to delete a RARE generate result by ID.\
> \
> \## Headers\
> \
> \- API-KEY (string, required): Your assigned API key. You can find it in the Settings menu of the dashboard.\
> \- AGENT-EMAIL (string, optional): The email address of the agent performing the API call.\
> \- USER-EMAIL (string, optional): The email address to associate with the user.\
> \- OWN-USER-ID (string, optional): The user ID to identify or create a user.

```json
{"openapi":"3.1.0","info":{"title":"Alli API Documentation","version":"1.0.0"},"tags":[{"name":"RAG","description":"Retrieval, generative answer, and highlight related APIs"}],"servers":[{"url":"https://backend.alli.ai","description":"US"},{"url":"https://backend-ja.alli.ai","description":"JA"}],"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/v2/rare/results/{result_id}":{"delete":{"operationId":"django_server_rag_views_rest_rare_api_rare_delete_result","summary":"Delete RARE Result","parameters":[{"$ref":"#/components/parameters/AgentEmailHeader"},{"$ref":"#/components/parameters/UserEmailHeader"},{"$ref":"#/components/parameters/OwnUserIdHeader"},{"in":"path","name":"result_id","schema":{"title":"Result Id","type":"string"},"required":true}],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid request parameters."},"401":{"description":"Authentication failed. The API-KEY header is missing or invalid."},"403":{"description":"Access denied. The project is inactive or the request IP is not allowed."},"500":{"description":"Internal server error."}},"description":"This API allows you to delete a RARE generate result by ID.\n\n## Headers\n\n- API-KEY (string, required): Your assigned API key. You can find it in the Settings menu of the dashboard.\n- AGENT-EMAIL (string, optional): The email address of the agent performing the API call.\n- USER-EMAIL (string, optional): The email address to associate with the user.\n- OWN-USER-ID (string, optional): The user ID to identify or create a user.","tags":["RAG"]}}}}
```

## Download RARE CSV

> This API allows you to download a RARE CSV result file from storage.\
> \
> \## Headers\
> \
> \- API-KEY (string, required): Your assigned API key. You can find it in the Settings menu of the dashboard.\
> \- AGENT-EMAIL (string, optional): The email address of the agent performing the API call.\
> \- USER-EMAIL (string, optional): The email address to associate with the user.\
> \- OWN-USER-ID (string, optional): The user ID to identify or create a user.\
> \
> \## Query Parameters\
> \
> \- path (string, optional): The storage path of the CSV file.

```json
{"openapi":"3.1.0","info":{"title":"Alli API Documentation","version":"1.0.0"},"tags":[{"name":"RAG","description":"Retrieval, generative answer, and highlight related APIs"}],"servers":[{"url":"https://backend.alli.ai","description":"US"},{"url":"https://backend-ja.alli.ai","description":"JA"}],"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/v2/rare/csv":{"get":{"operationId":"django_server_rag_views_rest_rare_api_rare_csv","summary":"Download RARE CSV","parameters":[{"$ref":"#/components/parameters/AgentEmailHeader"},{"$ref":"#/components/parameters/UserEmailHeader"},{"$ref":"#/components/parameters/OwnUserIdHeader"},{"in":"query","name":"path","schema":{"default":"","title":"Path","type":"string"},"required":false}],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid request parameters."},"401":{"description":"Authentication failed. The API-KEY header is missing or invalid."},"403":{"description":"Access denied. The project is inactive or the request IP is not allowed."},"500":{"description":"Internal server error."}},"description":"This API allows you to download a RARE CSV result file from storage.\n\n## Headers\n\n- API-KEY (string, required): Your assigned API key. You can find it in the Settings menu of the dashboard.\n- AGENT-EMAIL (string, optional): The email address of the agent performing the API call.\n- USER-EMAIL (string, optional): The email address to associate with the user.\n- OWN-USER-ID (string, optional): The user ID to identify or create a user.\n\n## Query Parameters\n\n- path (string, optional): The storage path of the CSV file.","tags":["RAG"]}}}}
```

## Run Bulk Processing

> This API allows you to start bulk processing (GA or RAG) by uploading a CSV file.\
> \
> \## Headers\
> \
> \- API-KEY (string, required): Your assigned API key. You can find it in the Settings menu of the dashboard.\
> \- AGENT-EMAIL (string, optional): The email address of the agent performing the API call.\
> \- USER-EMAIL (string, optional): The email address to associate with the user.\
> \- OWN-USER-ID (string, optional): The user ID to identify or create a user.\
> \
> \## Query Parameters\
> \
> \- bulk\_type (string, optional): Must be \`ga\`, \`rag\`, or \`rag\_agent\_v2\`. Defaults to \*\*ga\*\*. \`rag\_agent\_v2\` runs RAG Agent V2 (General Agent) with the same CSV as \`rag\`.\
> \
> \## Request Body (multipart/form-data)\
> \
> \- file (binary, required): CSV file with columns: question, model, search\_type.

```json
{"openapi":"3.1.0","info":{"title":"Alli API Documentation","version":"1.0.0"},"tags":[{"name":"RAG","description":"Retrieval, generative answer, and highlight related APIs"}],"servers":[{"url":"https://backend.alli.ai","description":"US"},{"url":"https://backend-ja.alli.ai","description":"JA"}],"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/v2/bulk_processing/run":{"post":{"operationId":"django_server_rag_views_rest_bulk_processing_api_run_bulk","summary":"Run Bulk Processing","parameters":[{"$ref":"#/components/parameters/AgentEmailHeader"},{"$ref":"#/components/parameters/UserEmailHeader"},{"$ref":"#/components/parameters/OwnUserIdHeader"},{"in":"query","name":"bulk_type","schema":{"default":"ga","enum":["ga","rag","rag_agent_v2"],"title":"Bulk Type","type":"string"},"required":false}],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid request parameters."},"401":{"description":"Authentication failed. The API-KEY header is missing or invalid."},"403":{"description":"Access denied. The project is inactive or the request IP is not allowed."},"500":{"description":"Internal server error."}},"description":"This API allows you to start bulk processing (GA or RAG) by uploading a CSV file.\n\n## Headers\n\n- API-KEY (string, required): Your assigned API key. You can find it in the Settings menu of the dashboard.\n- AGENT-EMAIL (string, optional): The email address of the agent performing the API call.\n- USER-EMAIL (string, optional): The email address to associate with the user.\n- OWN-USER-ID (string, optional): The user ID to identify or create a user.\n\n## Query Parameters\n\n- bulk_type (string, optional): Must be `ga`, `rag`, or `rag_agent_v2`. Defaults to **ga**. `rag_agent_v2` runs RAG Agent V2 (General Agent) with the same CSV as `rag`.\n\n## Request Body (multipart/form-data)\n\n- file (binary, required): CSV file with columns: question, model, search_type.","tags":["RAG"],"requestBody":{"content":{"multipart/form-data":{"schema":{"properties":{"file":{"format":"binary","title":"File","type":"string"}},"required":["file"],"title":"FileParams","type":"object"}}},"required":true}}}}}
```

## List Bulk Processing Results

> This API allows you to list bulk processing results with pagination.\
> \
> \## Headers\
> \
> \- API-KEY (string, required): Your assigned API key. You can find it in the Settings menu of the dashboard.\
> \- AGENT-EMAIL (string, optional): The email address of the agent performing the API call.\
> \- USER-EMAIL (string, optional): The email address to associate with the user.\
> \- OWN-USER-ID (string, optional): The user ID to identify or create a user.\
> \
> \## Query Parameters\
> \
> \- page (integer, optional): Page number for pagination. Defaults to \*\*1\*\*.

```json
{"openapi":"3.1.0","info":{"title":"Alli API Documentation","version":"1.0.0"},"tags":[{"name":"RAG","description":"Retrieval, generative answer, and highlight related APIs"}],"servers":[{"url":"https://backend.alli.ai","description":"US"},{"url":"https://backend-ja.alli.ai","description":"JA"}],"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/v2/bulk_processing/results":{"get":{"operationId":"django_server_rag_views_rest_bulk_processing_api_list_results","summary":"List Bulk Processing Results","parameters":[{"$ref":"#/components/parameters/AgentEmailHeader"},{"$ref":"#/components/parameters/UserEmailHeader"},{"$ref":"#/components/parameters/OwnUserIdHeader"},{"in":"query","name":"page","schema":{"default":1,"title":"Page","type":"integer"},"required":false}],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid request parameters."},"401":{"description":"Authentication failed. The API-KEY header is missing or invalid."},"403":{"description":"Access denied. The project is inactive or the request IP is not allowed."},"500":{"description":"Internal server error."}},"description":"This API allows you to list bulk processing results with pagination.\n\n## Headers\n\n- API-KEY (string, required): Your assigned API key. You can find it in the Settings menu of the dashboard.\n- AGENT-EMAIL (string, optional): The email address of the agent performing the API call.\n- USER-EMAIL (string, optional): The email address to associate with the user.\n- OWN-USER-ID (string, optional): The user ID to identify or create a user.\n\n## Query Parameters\n\n- page (integer, optional): Page number for pagination. Defaults to **1**.","tags":["RAG"]}}}}
```

## Download Bulk Processing Result

> This API allows you to download a bulk processing result as a CSV file.\
> \
> \## Headers\
> \
> \- API-KEY (string, required): Your assigned API key. You can find it in the Settings menu of the dashboard.\
> \- AGENT-EMAIL (string, optional): The email address of the agent performing the API call.\
> \- USER-EMAIL (string, optional): The email address to associate with the user.\
> \- OWN-USER-ID (string, optional): The user ID to identify or create a user.\
> \
> \## Query Parameters\
> \
> \- file\_url (string, required): The URL of the result file to download.

```json
{"openapi":"3.1.0","info":{"title":"Alli API Documentation","version":"1.0.0"},"tags":[{"name":"RAG","description":"Retrieval, generative answer, and highlight related APIs"}],"servers":[{"url":"https://backend.alli.ai","description":"US"},{"url":"https://backend-ja.alli.ai","description":"JA"}],"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/v2/bulk_processing/download":{"get":{"operationId":"django_server_rag_views_rest_bulk_processing_api_download_result","summary":"Download Bulk Processing Result","parameters":[{"$ref":"#/components/parameters/AgentEmailHeader"},{"$ref":"#/components/parameters/UserEmailHeader"},{"$ref":"#/components/parameters/OwnUserIdHeader"},{"in":"query","name":"file_url","schema":{"title":"File Url","type":"string"},"required":true}],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid request parameters."},"401":{"description":"Authentication failed. The API-KEY header is missing or invalid."},"403":{"description":"Access denied. The project is inactive or the request IP is not allowed."},"500":{"description":"Internal server error."}},"description":"This API allows you to download a bulk processing result as a CSV file.\n\n## Headers\n\n- API-KEY (string, required): Your assigned API key. You can find it in the Settings menu of the dashboard.\n- AGENT-EMAIL (string, optional): The email address of the agent performing the API call.\n- USER-EMAIL (string, optional): The email address to associate with the user.\n- OWN-USER-ID (string, optional): The user ID to identify or create a user.\n\n## Query Parameters\n\n- file_url (string, required): The URL of the result file to download.","tags":["RAG"]}}}}
```

## Delete Bulk Processing Result

> This API allows you to delete a bulk processing result by ID.\
> \
> \## Headers\
> \
> \- API-KEY (string, required): Your assigned API key. You can find it in the Settings menu of the dashboard.\
> \- AGENT-EMAIL (string, optional): The email address of the agent performing the API call.\
> \- USER-EMAIL (string, optional): The email address to associate with the user.\
> \- OWN-USER-ID (string, optional): The user ID to identify or create a user.

```json
{"openapi":"3.1.0","info":{"title":"Alli API Documentation","version":"1.0.0"},"tags":[{"name":"RAG","description":"Retrieval, generative answer, and highlight related APIs"}],"servers":[{"url":"https://backend.alli.ai","description":"US"},{"url":"https://backend-ja.alli.ai","description":"JA"}],"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/v2/bulk_processing/results/{result_id}":{"delete":{"operationId":"django_server_rag_views_rest_bulk_processing_api_delete_result","summary":"Delete Bulk Processing Result","parameters":[{"$ref":"#/components/parameters/AgentEmailHeader"},{"$ref":"#/components/parameters/UserEmailHeader"},{"$ref":"#/components/parameters/OwnUserIdHeader"},{"in":"path","name":"result_id","schema":{"title":"Result Id","type":"string"},"required":true}],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid request parameters."},"401":{"description":"Authentication failed. The API-KEY header is missing or invalid."},"403":{"description":"Access denied. The project is inactive or the request IP is not allowed."},"500":{"description":"Internal server error."}},"description":"This API allows you to delete a bulk processing result by ID.\n\n## Headers\n\n- API-KEY (string, required): Your assigned API key. You can find it in the Settings menu of the dashboard.\n- AGENT-EMAIL (string, optional): The email address of the agent performing the API call.\n- USER-EMAIL (string, optional): The email address to associate with the user.\n- OWN-USER-ID (string, optional): The user ID to identify or create a user.","tags":["RAG"]}}}}
```

## Generative Answer API

> Generative Answer API finds an answer from your unstructured text documents, Q\&A, and even from complex tables. It synthesizes information from various sources to provide comprehensive responses to user queries.<br>

```json
{"openapi":"3.1.0","info":{"title":"Alli API Documentation","version":"1.0.0"},"tags":[{"name":"RAG","description":"Retrieval, generative answer, and highlight related APIs"}],"servers":[{"url":"https://backend.alli.ai","description":"US"},{"url":"https://backend-ja.alli.ai","description":"JA"}],"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/generative_answer":{"post":{"tags":["RAG"],"operationId":"getGenerativeAnswer","summary":"Generative Answer API","description":"Generative Answer API finds an answer from your unstructured text documents, Q&A, and even from complex tables. It synthesizes information from various sources to provide comprehensive responses to user queries.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string","required":true,"description":"This is a query string."},"model":{"type":"string","description":"Utilize the LLM of your choice when generating answers. Default model is GPT4o. Please see documentation for available options.\n"},"answerFormat":{"type":"string","description":"Determine the format of the response given for easier integrations. Acceptable values are DRAFTJS and MARKDOWN. Default format is DRAFTJS.\n"},"isStateful":{"type":"boolean","description":"To use follow-up question, previous conversation history is required. The conversation history is managed by threadId. If you set isStateful option to True and enter a threadId, the query will be rewritten with reference to the previous conversation history. Default = False.\n"},"threadId":{"type":"string","format":"uuid","description":"threadId is used when isStateful = True. The first time you start a conversation, send it empty, and from the next query on, send it using the threadId from the output. However, if you want to set the threadId from the beginning, write it as a UUID and send it. Example UUID - 36e7bb2b-1063-47ec-. Default = None.\n"},"promptGroupId":{"type":"string","description":"Select which group prompt from your project to use for generating responses. The ID is located within the URL when viewing the group prompt within the Settings page. This is a very helpful option for a project with multiple different group prompts that are altered for specific tasks.\n"},"mode":{"type":"string","description":"Whether to output data as stream or sync. Current available values: sync OR stream (default=sync). When in stream mode, .json strings with the same output format as sync are outputted as streaming.\n"},"clueText":{"type":"boolean","description":"Whether to include the text of the document used as a clue. Default = False. ONLY works if clues is enabled.\n"},"clues":{"type":"boolean","description":"Whether to include clues in the output that will be used to create a generative answer. Default = False.\n"},"includeCitations":{"type":"boolean","description":"Whether to include detailed citation information in the response. Citations provide structured references to source documents used in generating the answer. Default = False.\n"},"hashtags":{"type":"object","description":"Utilize this feature to scope the search via hashtags on documents or Q&A's. You can include or exclude certain hashtags as well as provide an option of and/or for the hashtags selected.\n","properties":{"qnaInclude":{"type":"array","items":{"type":"string"},"description":"FAQ hashtags to include in the search"},"qnaIncludeOption":{"type":"string","enum":["and","or"],"default":"or","description":"Operator for FAQ include hashtags (and/or)"},"qnaExclude":{"type":"array","items":{"type":"string"},"description":"FAQ hashtags to exclude from the search"},"qnaExcludeOption":{"type":"string","enum":["and","or"],"default":"or","description":"Operator for FAQ exclude hashtags (and/or)"},"docsInclude":{"type":"array","items":{"type":"string"},"description":"Document hashtags to include in the search"},"docsIncludeOption":{"type":"string","enum":["and","or"],"default":"or","description":"Operator for document include hashtags (and/or)"},"docsExclude":{"type":"array","items":{"type":"string"},"description":"Document hashtags to exclude from the search"},"docsExcludeOption":{"type":"string","enum":["and","or"],"default":"or","description":"Operator for document exclude hashtags (and/or)"}}},"search_from":{"type":"array","items":{"type":"string"},"description":"Specifies the range of source data for Generative Answer to find data from. Currently available values are: web, qna, document, and enter data in the form of a list. For example -> [\"web\", \"qna\"]\n"},"temperature":{"type":"number","description":"Controls the randomness of the output. Higher values make the output more random. Default = 0."},"source":{"type":"object","description":"Source configuration for knowledge bases and folders. This is the preferred way to specify search scope. Use this instead of the legacy knowledgeBaseIds/folderIds parameters.\n","properties":{"sharedKnowledgeBaseNodeIds":{"type":"array","items":{"type":"string"},"description":"List of shared knowledge base or folder node IDs (global IDs) to search. Use empty array [] to search all shared documents. Use null to exclude shared documents from search.\n"},"personalKnowledgeBaseNodeIds":{"type":"array","items":{"type":"string"},"description":"List of personal knowledge base or folder node IDs (global IDs) to search. Use empty array [] to search all personal documents. Use null to exclude personal documents from search.\n"},"webSites":{"type":"array","items":{"type":"string"},"description":"List of web sites to search."}}},"knowledgeBaseIds":{"type":"array","items":{"type":"string"},"description":"(Legacy) Limits the search to specific knowledge base IDs. Use 'source' parameter instead for better control over shared/personal documents.\n"},"folderIds":{"type":"array","items":{"type":"string"},"description":"(Legacy) Limits the search to specific folder IDs. Use 'source' parameter instead for better control over shared/personal documents.\n"}}}}}},"responses":{"200":{"description":"Successfully generated answer","content":{"application/json":{"schema":{"type":"object","properties":{"answer":{"type":"object","description":"It's the answer extracted from uploaded documents in the dashboard, formatted according to the answerFormat parameter.\n"},"answerHash":{"type":"string","description":"This is used to identify the answer to give or cancel feedback."},"confidence":{"type":"number","description":"It shows the confidence value from AI model. Shown as a number value between 0 and 1.\n"},"effectiveConfidence":{"type":"number","description":"When you provide feedback to the query result, it automatically trains the AI model. Effective confidence is the adjusted score with these users' and agents' feedback. Shown as a number value between 0 and 1.\n"},"documentId":{"type":"string","description":"The document's ID where the answer is extracted from."},"documentName":{"type":"string","description":"The document's name where the answer is extracted from."},"hashtags":{"type":"array","description":"The hashtags attached to the document."},"pageNo":{"type":"integer","description":"The page number in the document where the answer was derived."},"createdDate":{"type":"string","format":"date","description":"The date when the document was uploaded."},"agentFeedback":{"type":"object","description":"The feedback from agents (through dashboard and REST calls) about this document."},"userFeedback":{"type":"object","description":"The feedback from users about this document."},"body":{"type":"string","description":"If returnPreview is true in the request, the html body of the document search preview is displayed."},"css":{"type":"string","description":"If returnPreview is true in the request, the css of the document search preview is displayed."},"pdfPreview":{"type":"string","description":"If returnPdfPreview is true in the request, the URL to a PDF preview of the document with the answer highlighted is displayed. Note that the URL can be restricted using the Download IP Allowlist setting.\n"},"folder":{"type":"string","description":"If the answer is found from a folder under the Documents database, the folder name will be returned here."},"editor":{"type":"array","items":{"type":"string"},"description":"List of the agents' email who has the editor access to the documents (if they're set in the Alli dashboard)."},"viewer":{"type":"array","items":{"type":"string"},"description":"List of the agents' email who has the viewer access to the documents (if they're set in the Alli dashboard)."},"threadId":{"type":"string","description":"A UUID that can be used for follow-up questions when isStateful is true."},"fuQuestion":{"type":"string","description":"Suggested follow-up question for the user when isStateful is true."},"intent":{"type":"string","description":"The detected intent of the query."},"clues":{"type":"array","description":"If clues is true in the request, the sources used to generate the answer are returned here.\n"},"citations":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","description":"Citation number referenced in the answer text as [1], [2], etc."},"clueId":{"type":"string","description":"Unique identifier for the source clue"},"source":{"type":"string","description":"Type of source (DOCUMENT, FAQ, WEB)"},"title":{"type":"string","description":"Title of the source document or FAQ"},"pageNo":{"type":"integer","description":"Page number in the source document"},"knowledgeBaseId":{"type":"string","description":"ID of the knowledge base document"},"faqId":{"type":"string","description":"ID of the FAQ entry"},"url":{"type":"string","description":"URL of web source"},"text":{"type":"string","description":"Excerpt of the source text (limited to 500 characters)"}}},"description":"If includeCitations is true in the request, structured citation information is returned here. Each citation corresponds to a [number] reference in the answer text.\n"}}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"string","description":"Error message"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"string","description":"Error message"}}}}}},"403":{"description":"Access denied. The project is inactive or the request IP is not allowed."},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"string","description":"Rate Limit Exceed"}}}}}},"500":{"description":"Internal server error."}},"parameters":[{"$ref":"#/components/parameters/AgentEmailHeader"},{"$ref":"#/components/parameters/UserEmailHeader"},{"$ref":"#/components/parameters/OwnUserIdHeader"}]}}}}
```

## Alli Retrieval API

> The Retrieval API allows you to obtain the top N page information related to a question from documents uploaded to Alli. This API combines keyword search and semantic search capabilities to provide the most relevant document pages for your queries.<br>

```json
{"openapi":"3.1.0","info":{"title":"Alli API Documentation","version":"1.0.0"},"tags":[{"name":"RAG","description":"Retrieval, generative answer, and highlight related APIs"}],"servers":[{"url":"https://backend.alli.ai","description":"US"},{"url":"https://backend-ja.alli.ai","description":"JA"}],"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/retrieval":{"post":{"tags":["RAG"],"operationId":"retrievalPost","summary":"Alli Retrieval API","description":"The Retrieval API allows you to obtain the top N page information related to a question from documents uploaded to Alli. This API combines keyword search and semantic search capabilities to provide the most relevant document pages for your queries.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"question":{"type":"string","description":"Question to search for in the document base","required":true},"maxDocumentClues":{"type":"integer","description":"Determines how many related pages to retrieve. The default value is 3.\n"},"bm25_score_weight":{"type":"number","format":"float","description":"This is the weight for keyword search. The higher this value, the more the keyword score is reflected. Values between 0-9 are appropriate, with a value of 0 meaning keyword search is not used. The default value is 9.\n"},"text_vector_score_weight":{"type":"number","format":"float","description":"This is the weight for semantic search on document content. The higher this value, the more it is reflected. Values between 0-9 are appropriate, with a value of 0 meaning semantic search on document content is not used. The default value is 1.\n"},"title_vector_score_weight":{"type":"number","format":"float","description":"This is the weight for semantic search on document titles. Similarly, values between 0-9 are appropriate, with a value of 0 meaning semantic search on document titles is not used. The default value is 0.\n"},"hashtags":{"type":"array","items":{"type":"string"},"description":"Filter results to include only documents with these hashtags"},"hashtags_operator":{"type":"string","enum":["and","or"],"description":"Logical operator for hashtags (default is \"or\")"},"exclude_hashtags":{"type":"array","items":{"type":"string"},"description":"Filter results to exclude documents with these hashtags"},"exclude_hashtags_operator":{"type":"string","enum":["and","or"],"description":"Logical operator for exclude_hashtags (default is \"or\")"},"targetFolders":{"type":"array","items":{"type":"string"},"description":"Names of folders to search within"},"folderIds":{"type":"array","items":{"type":"string"},"description":"IDs of folders to search within"},"knowledgeBaseIds":{"type":"array","items":{"type":"string"},"description":"IDs of specific knowledge bases to search within"},"enablePersonalFolderSearch":{"type":"boolean","description":"Also search the requesting user's personal documents (default false). Takes effect only when the request also carries a user identity (Own-User-Id / User-Email) AND names personal ids below; otherwise the personal half is skipped and only shared documents are searched. There is deliberately no \"all of my personal documents\" mode.\n"},"personalFolderIds":{"type":"array","items":{"type":"string"},"description":"IDs of the requesting user's personal folders to search within. Ids the user does not own are dropped. Personal ids belong here, not in folderIds — the shared and personal scopes are OR-ed, so a personal id sent as a shared one matches nothing.\n"},"personalDocumentIds":{"type":"array","items":{"type":"string"},"description":"IDs of the requesting user's personal knowledge bases to search within. See personalFolderIds.\n"},"use_keywords":{"type":"boolean","description":"Whether to extract and use keywords for search"},"use_clue_feedback":{"type":"boolean","description":"Whether to use feedback data to improve search results"},"use_reranker":{"type":"boolean","description":"Overrides the project's cognitive_config.use_reranker for this request. When omitted, the project config value is used.\n"},"reranker_candidates_num":{"type":"integer","description":"Overrides the number of candidate pages passed to the reranker. Only effective when reranking is enabled. Defaults to 16 when omitted.\n"},"reranker_max_tokens":{"type":"integer","description":"Overrides the maximum token length per candidate sent to the reranker. Only effective when reranking is enabled. Defaults to 1024 when omitted.\n"}}}}}},"responses":{"200":{"description":"Successfully retrieved results","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"type":"object","properties":{"ranking":{"type":"integer","description":"Rank of the page related to the question"},"title":{"type":"string","description":"Title of the document related to the question"},"text":{"type":"string","description":"Content of the page related to the question"},"pageNo":{"type":"integer","description":"Page number"},"kb_id":{"type":"string","description":"ID of the knowledge base document"}}}}}}}}},"400":{"description":"Invalid parameters","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"string"}}}}}},"401":{"description":"Authentication failed. The API-KEY header is missing or invalid."},"403":{"description":"Access denied. The project is inactive or the request IP is not allowed."},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}},"parameters":[{"$ref":"#/components/parameters/AgentEmailHeader"},{"$ref":"#/components/parameters/UserEmailHeader"},{"$ref":"#/components/parameters/OwnUserIdHeader"}]}}}}
```
