# FAQs

FAQ related APIs

## Select Answer

> This method should be used to simulate a user looking up a specific FAQ

```json
{"openapi":"3.1.0","info":{"title":"Alli API Documentation","version":"1.0.0"},"tags":[{"name":"FAQs","description":"FAQ 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/faq/select_answer":{"post":{"tags":["FAQs"],"operationId":"selectFaq","summary":"Select Answer","description":"This method should be used to simulate a user looking up a specific FAQ","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The id of the FAQ that you would like to select"},"hashId":{"type":"string","description":"The id of the Q&A search return result"}}}}}},"responses":{"200":{"description":"Successfully selected FAQ","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"string","description":"In case of success, returns \"Success\""}}}}}},"404":{"description":"In case you provide an invalid FAQ"}},"parameters":[{"$ref":"#/components/parameters/AgentEmailHeader"},{"$ref":"#/components/parameters/UserEmailHeader"},{"$ref":"#/components/parameters/OwnUserIdHeader"}]}}}}
```

## Search from Q\&A

> This API lets you find the most relevant question and answer pairs from your Q\&A knowledge base.<br>

```json
{"openapi":"3.1.0","info":{"title":"Alli API Documentation","version":"1.0.0"},"tags":[{"name":"FAQs","description":"FAQ 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/faq":{"post":{"tags":["FAQs"],"operationId":"searchFaq","summary":"Search from Q&A","description":"This API lets you find the most relevant question and answer pairs from your Q&A knowledge base.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"autoRegisterCandidates":{"type":"boolean","description":"The default value is true. When this option has set false, it'll not automatically register the query to candidates when there was no answer for the given query."},"hashtagsOperator":{"type":"string","enum":["AND","OR"],"description":"Either AND or OR.\nChoose AND if you want each returned result to contain all hashtags.\nChoose OR if you want each returned result to contain at least one of the hashtags.\n"},"hashtags":{"type":"array","items":{"type":"string"},"description":"An array of all the hashtags that you would like to appear."},"maxResults":{"type":"integer","description":"The maximum number of results to be returned."},"query":{"type":"string","description":"This is a query string.","required":true},"format":{"type":"string","enum":["html","text"],"description":"html or text. If it's text, the return value will be in plain text. If it's html, it will return html. If your answer contains styled html, such as different font size and color, you can use html. If you simply want to get an answer as a text, you can use the text. The default value is html."}}}}}},"responses":{"200":{"description":"The API will find the most relevant question and answers from your Q&A database.","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"type":"object","properties":{"confidence":{"type":"number","description":"It shows the confidence value from AI model. Shown as a number value between 0 and 1."},"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."},"question":{"type":"string","description":"This is the question part of the selected Q&A pair."},"answer":{"type":"string","description":"This is the answer part of the selected Q&A pair."},"id":{"type":"string","description":"This is used to identify the result to give or cancel feedback."},"hashtags":{"type":"array","items":{"type":"string"},"description":"Hashtags registered for the Q&A."},"lastUpdatedDate":{"type":"string","format":"date","description":"The date when the Q&A is last updated."},"agentFeedback":{"type":"object","properties":{"positiveCount":{"type":"integer","description":"The number of positive feedbacks from agents."},"negativeCount":{"type":"integer","description":"The number of negative feedbacks from agents."}},"description":"The feedback from agents (through dashboard and REST calls) about this Q&A."},"userFeedback":{"type":"object","properties":{"positiveCount":{"type":"integer","description":"The number of positive feedbacks from users."},"negativeCount":{"type":"integer","description":"The number of negative feedbacks from users."}},"description":"The feedback from users (through conversation) about this Q&A."}}}},"count":{"type":"integer","description":"The number of suggested Q&As."},"hashId":{"type":"string","description":"This hash id is being used when you call select_answer later."}}}}}}},"parameters":[{"$ref":"#/components/parameters/AgentEmailHeader"},{"$ref":"#/components/parameters/UserEmailHeader"},{"$ref":"#/components/parameters/OwnUserIdHeader"}]}}}}
```

## Get Single Q\&A

> This is the method to get all the details of a single Q\&A.<br>

```json
{"openapi":"3.1.0","info":{"title":"Alli API Documentation","version":"1.0.0"},"tags":[{"name":"FAQs","description":"FAQ 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/single_faq":{"get":{"tags":["FAQs"],"operationId":"getExactFaq","summary":"Get Single Q&A","description":"This is the method to get all the details of a single Q&A.\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 id of the FAQ you are looking for."},{"name":"format","in":"query","required":false,"schema":{"type":"string","enum":["html","text"]},"description":"The format of the answer value for this FAQ. Default is HTML."}],"responses":{"200":{"description":"Successfully retrieved FAQ details","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"question":{"type":"string","description":"The question associated with the Q&A."},"similar_questions":{"type":"array","items":{"type":"string"},"description":"Similar questions that have the same answer."},"answer":{"type":"string","description":"The answer to the question."},"id":{"type":"string","description":"The id of this Q&A."},"userFeedback":{"type":"object","properties":{"positiveCount":{"type":"integer","description":"The number of positive feedbacks from users."},"negativeCount":{"type":"integer","description":"The number of negative feedbacks from users."}},"description":"The feedback from users (through conversation) about this Q&A."},"agentFeedback":{"type":"object","properties":{"positiveCount":{"type":"integer","description":"The number of positive feedbacks from agents."},"negativeCount":{"type":"integer","description":"The number of negative feedbacks from agents."}},"description":"The feedback from agents (through dashboard and REST calls) about this Q&A."},"lastUpdatedDate":{"type":"string","format":"date","description":"The date when the Q&A was last updated."},"createdDate":{"type":"string","format":"date","description":"The date when the Q&A was first created."},"hashtags":{"type":"array","items":{"type":"string"},"description":"All hashtags associated with this question."},"statusOnAt":{"type":"string","format":"date-time","description":"The date and time when the Q&A was turned on."},"statusOffAt":{"type":"string","format":"date-time","description":"The date and time when the Q&A was turned off."},"folder":{"type":"string","description":"The folder where this Q&A is stored."},"agentEditor":{"type":"array","items":{"type":"string"},"description":"List of agents who have editing permission for this Q&A."},"agentViewer":{"type":"array","items":{"type":"string"},"description":"List of agents who have viewing permission for this Q&A."},"allowOtherAgentsView":{"type":"boolean","description":"Whether agents not in the editor/viewer list can view this Q&A."},"allowOtherUsersView":{"type":"boolean","description":"Whether users not in the viewer list can view this Q&A."}}}}}}}},"404":{"description":"FAQ not found","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"string"}}}}}}}}}}}
```

## List Q\&As

> You can list Q\&As in the Knowledge Base using this API.<br>

```json
{"openapi":"3.1.0","info":{"title":"Alli API Documentation","version":"1.0.0"},"tags":[{"name":"FAQs","description":"FAQ 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/faqs":{"get":{"tags":["FAQs"],"operationId":"getFaqs","summary":"List Q&As","description":"You can list Q&As in the Knowledge Base using this API.\n","parameters":[{"$ref":"#/components/parameters/AgentEmailHeader"},{"$ref":"#/components/parameters/UserEmailHeader"},{"$ref":"#/components/parameters/OwnUserIdHeader"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":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","default":1000},"description":"Limit allows you to set the number of objects returned on one page. The maximum and the default value is 1000."},{"name":"format","in":"query","required":false,"schema":{"type":"string","enum":["text","html"],"default":"html"},"description":"If your answers contain styled html, such as different font size or color, you can use html to get answers in html format. If you simply want to get answers as a text, you can use the text."}],"responses":{"200":{"description":"Successfully retrieved FAQs","content":{"application/json":{"schema":{"type":"object","properties":{"offset":{"type":"integer","description":"The same offset value with the offset request parameter."},"count":{"type":"integer","description":"Total number of Q&As listed after limit is applied."},"total_count":{"type":"integer","description":"Total number of Q&As as the result of applied filters."},"results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The ID of the Q&A."},"question":{"type":"string","description":"The question part of the Q&A."},"answer":{"type":"string","description":"The answer part of the Q&A."},"hashtags":{"type":"array","items":{"type":"string"},"description":"The hashtags added on the Q&A."},"userFeedback":{"type":"object","properties":{"positiveCount":{"type":"integer","description":"Number of positive user feedbacks."},"negativeCount":{"type":"integer","description":"Number of negative user feedbacks."}},"description":"User feedbacks affects the search result for future queries."},"agentFeedback":{"type":"object","properties":{"positiveCount":{"type":"integer","description":"Number of positive agent feedbacks."},"negativeCount":{"type":"integer","description":"Number of negative agent feedbacks."}},"description":"Agent feedbacks affects the search result for future queries."},"lastUpdatedDate":{"type":"string","format":"date","description":"The date when the Q&A is last updated."},"createdDate":{"type":"string","format":"date","description":"The date when the Q&A is created."}}}}}}}}}}}}}}
```

## Search Q\&As

> You can search and filter Q\&As in the Knowledge Base using this API.<br>

```json
{"openapi":"3.1.0","info":{"title":"Alli API Documentation","version":"1.0.0"},"tags":[{"name":"FAQs","description":"FAQ 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/faqs":{"post":{"tags":["FAQs"],"operationId":"searchFaqs","summary":"Search Q&As","description":"You can search and filter Q&As in the Knowledge Base using this API.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"searchTerm":{"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."},"isUsed":{"type":"boolean","description":"If true, only turned-on Q&As will be listed, If false, only turned-off Q&As will."},"hashtags":{"type":"array","items":{"type":"string"},"description":"Hashtags to filter the list. You can add multiple hashtags."},"hashtagsOperator":{"type":"string","enum":["and","or"],"description":"If it's and, hashtags filter for multiple hashtags works with AND logic. If or, OR logic."},"createdByAgent":{"type":"boolean","description":"If true, the list will only include Q&As created by agents. If false, only the other Q&As will be included. Please note that createdByAgent, answeredByMrc, autoGenerated, editedByAgent filters are mutually exclusive, and OR logic is applied if two or more of them are used."},"answeredByMrc":{"type":"boolean","description":"If true, the list will only include Q&As that are the answers are automatically extracted from uploaded Documents. If false, only the other Q&As will be included."},"autoGenerated":{"type":"boolean","description":"If true, the list will only include auto-generated Q&As. If false, only the other Q&As will be included."},"editedByAgent":{"type":"boolean","description":"If true, the list will only include Q&A's edited by any agent after registered. If false, only the other Q&As will be included."},"format":{"type":"string","enum":["html","text"],"description":"If your answers contain styled html, such as different font size or color, you can use html to get answers in html format. If you simply want to get answers as a text, you can use the text. The default value is html."},"offset":{"type":"integer","description":"Offset allows you to specify the ranking number of the first item on the page."},"limit":{"type":"integer","description":"Limit allows you to set the number of objects returned on one page. The maximum and the default value is 1000."}}}}}},"responses":{"200":{"description":"Successfully searched FAQs","content":{"application/json":{"schema":{"type":"object","properties":{"offset":{"type":"integer","description":"The same offset value with the offset request parameter."},"count":{"type":"integer","description":"Total number of Q&As listed after limit is applied."},"total_count":{"type":"integer","description":"Total number of Q&As as the result of applied filters."},"results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The ID of the Q&A."},"question":{"type":"string","description":"The question part of the Q&A."},"answer":{"type":"string","description":"The answer part of the Q&A."},"hashtags":{"type":"array","items":{"type":"string"},"description":"The hashtags added on the Q&A."},"userFeedback":{"type":"object","properties":{"positiveCount":{"type":"integer","description":"Number of positive user feedbacks."},"negativeCount":{"type":"integer","description":"Number of negative user feedbacks."}},"description":"User feedbacks affects the search result for future queries."},"agentFeedback":{"type":"object","properties":{"positiveCount":{"type":"integer","description":"Number of positive agent feedbacks."},"negativeCount":{"type":"integer","description":"Number of negative agent feedbacks."}},"description":"Agent feedbacks affects the search result for future queries."},"lastUpdatedDate":{"type":"string","format":"date","description":"The date when the Q&A is last updated."},"createdDate":{"type":"string","format":"date","description":"The date when the Q&A is created."}}}}}}}}}},"parameters":[{"$ref":"#/components/parameters/AgentEmailHeader"},{"$ref":"#/components/parameters/UserEmailHeader"},{"$ref":"#/components/parameters/OwnUserIdHeader"}]}}}}
```

## Add Q\&A

> You can add a new Q\&A or update an existing Q\&A using this API.<br>

```json
{"openapi":"3.1.0","info":{"title":"Alli API Documentation","version":"1.0.0"},"tags":[{"name":"FAQs","description":"FAQ 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/register_faq":{"post":{"tags":["FAQs"],"operationId":"createFaq","summary":"Add Q&A","description":"You can add a new Q&A or update an existing Q&A using this API.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"question":{"type":"string","required":true,"description":"The question part of the Q&A."},"similarQuestions":{"type":"array","items":{"type":"string"},"description":"Similar questions that has the same answer."},"answer":{"type":"string","required":true,"description":"The answer part of the Q&A. If the same question exists in the database, this answer will replace the existing one."},"hashtags":{"type":"array","items":{"type":"string"},"description":"Hashtags added to the Q&A."},"status":{"type":"string","enum":[true,false],"required":true,"description":"ON or OFF. When on, registered Q&A will be turned on for Q&A search."},"memo":{"type":"string","description":"Memo on the Q&A to share with agents."},"target_folder_id":{"type":"string"},"allowOtherAgentsView":{"type":"boolean"},"allowOtherUsersView":{"type":"boolean"}}}}}},"responses":{"200":{"description":"FAQ created successfully","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"status":{"type":"string","description":"The status of the registered Q&A. 'created' means the Q&A is newly created. 'updated' means an existing Q&A is updated with a new answer."},"id":{"type":"string","description":"The registered Q&A's ID."}}},"errors":{"type":"string"}}}}}}},"parameters":[{"$ref":"#/components/parameters/AgentEmailHeader"},{"$ref":"#/components/parameters/UserEmailHeader"},{"$ref":"#/components/parameters/OwnUserIdHeader"}]}}}}
```

## Update Q\&A

> You can update an existing Q\&A using this API.<br>

```json
{"openapi":"3.1.0","info":{"title":"Alli API Documentation","version":"1.0.0"},"tags":[{"name":"FAQs","description":"FAQ 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/register_faq":{"put":{"tags":["FAQs"],"operationId":"updateFaq","summary":"Update Q&A","description":"You can update an existing Q&A using this API.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","required":true,"description":"The ID of the Q&A to update."},"question":{"type":"string","description":"The question part of the Q&A."},"similar_questions":{"type":"array","items":{"type":"string"},"description":"Similar questions that has the same answer."},"answer":{"type":"string","description":"The answer part of the Q&A."},"hashtags":{"type":"array","items":{"type":"string"},"description":"Hashtags added to the Q&A."},"status":{"type":"string","enum":[true,false],"description":"ON or OFF. When on, Q&A will be turned on for Q&A search."},"target_folder_id":{"type":"string"},"allowOtherAgentsView":{"type":"boolean"},"allowOtherUsersView":{"type":"boolean"}}}}}},"responses":{"200":{"description":"FAQ updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"status":{"type":"string","description":"The status of the update. 'updated' means the Q&A was successfully updated."},"id":{"type":"string","description":"The updated Q&A's ID."}}},"errors":{"type":"string"}}}}}}},"parameters":[{"$ref":"#/components/parameters/AgentEmailHeader"},{"$ref":"#/components/parameters/UserEmailHeader"},{"$ref":"#/components/parameters/OwnUserIdHeader"}]}}}}
```

## Delete Q\&A

> You can delete a Q\&A using this API.<br>

```json
{"openapi":"3.1.0","info":{"title":"Alli API Documentation","version":"1.0.0"},"tags":[{"name":"FAQs","description":"FAQ 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/delete_faq":{"post":{"tags":["FAQs"],"operationId":"deleteFaq","summary":"Delete Q&A","description":"You can delete a Q&A using this API.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","required":true,"description":"The ID of the Q&A you want to delete."}}}}}},"responses":{"200":{"description":"FAQ deleted successfully","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"status":{"type":"string","description":"deleted if the Q&A is successfully deleted."}}},"errors":{"type":"string"}}}}}},"404":{"description":"FAQ not found","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"string","description":"Error message indicating the Q&A was not found."}}}}}}},"parameters":[{"$ref":"#/components/parameters/AgentEmailHeader"},{"$ref":"#/components/parameters/UserEmailHeader"},{"$ref":"#/components/parameters/OwnUserIdHeader"}]}}}}
```

## Upload Q\&As

> You can upload multiple Q\&As in the tsv, csv, xlsx, and zip format using this API.<br>

```json
{"openapi":"3.1.0","info":{"title":"Alli API Documentation","version":"1.0.0"},"tags":[{"name":"FAQs","description":"FAQ 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/upload_faq_file":{"post":{"tags":["FAQs"],"operationId":"uploadFaqWithFile","summary":"Upload Q&As","description":"You can upload multiple Q&As in the tsv, csv, xlsx, and zip format using this API.\n","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary","description":"Your local Q&A file location. xlsx, tsv, csv, and zip files are supported."}}}}}},"responses":{"200":{"description":"FAQ file upload successful","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"string","description":"Success status of the upload operation"},"notUploaded":{"type":"array","items":{"type":"object","properties":{"question":{"type":"string","description":"The question part of not-uploaded or updated Q&A"},"state":{"type":"string","description":"dup if the Q&A is not uploaded due to duplication in 'similar questions' content. up if the Q&A updated an existing one due to the same question content."}}}}}}}}},"400":{"description":"Invalid parameters"}},"parameters":[{"$ref":"#/components/parameters/AgentEmailHeader"},{"$ref":"#/components/parameters/UserEmailHeader"},{"$ref":"#/components/parameters/OwnUserIdHeader"}]}}}}
```

## Q\&A Feedback

> This API lets you give or cancel feedback given to a Q\&A pair for a search query.<br>

```json
{"openapi":"3.1.0","info":{"title":"Alli API Documentation","version":"1.0.0"},"tags":[{"name":"FAQs","description":"FAQ 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/faq_feedback":{"post":{"tags":["FAQs"],"operationId":"faqFeedback","summary":"Q&A Feedback","description":"This API lets you give or cancel feedback given to a Q&A pair for a search query.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["query","id","isPositive"],"properties":{"query":{"type":"string","description":"The query you want to give or cancel feedback for, toward the Q&A."},"id":{"type":"string","description":"The ID for the Q&A you want to give or cancel feedback for the query. It is created whenever a Q&A search happens and bound to the query and the Q&A pair. It can be retrieved using the Q&A API above."},"isPositive":{"type":"boolean","nullable":true,"description":"When the value is true, positive feedback is given to the Q&A for the query. When it's false, negative feedback is given. When it's null, it cancels the feedback."}}}}}},"responses":{"200":{"description":"Feedback submitted successfully","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"faqTrainSearchResult":{"type":"object","properties":{"faq":{"type":"object","properties":{"id":{"type":"string","description":"The ID for the Q&A you want to give or cancel feedback for the query. It's the same one you used for the request."}}},"agentFeedback":{"type":"object","properties":{"positiveCount":{"type":"integer","description":"The total number of positive feedbacks after the request is processed."},"negativeCount":{"type":"integer","description":"The total number of negative feedbacks after the request is processed."}}}}}}},"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"}]}}}}
```

## Q\&A Query History

> Returns the past Q\&A Searches that have been done, both through the REST API and the Alli dashboard.<br>

```json
{"openapi":"3.1.0","info":{"title":"Alli API Documentation","version":"1.0.0"},"tags":[{"name":"FAQs","description":"FAQ 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/faq_histories":{"get":{"tags":["FAQs"],"operationId":"faqHistories","summary":"Q&A Query History","description":"Returns the past Q&A Searches that have been done, both through the REST API and the Alli dashboard.\n","parameters":[{"$ref":"#/components/parameters/AgentEmailHeader"},{"$ref":"#/components/parameters/UserEmailHeader"},{"$ref":"#/components/parameters/OwnUserIdHeader"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer"},"description":"A limit on the number of results to show (used for pagination)"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer"},"description":"In the list of all results, the index from which to start listing results (used for pagination)"},{"name":"endDate","in":"query","required":false,"schema":{"type":"string"},"description":"The latest date from which you want to get history (dates should be in the form YYYY-MM-DD)"},{"name":"startDate","in":"query","required":false,"schema":{"type":"string"},"description":"The earliest date from which you want to get history (dates should be in the form YYYY-MM-DD)"},{"name":"order","in":"query","required":false,"schema":{"type":"string"},"description":"Can either be DESC (meaning latest queries come first), or ASC (meaning earliest queries come first)"},{"name":"searchTerm","in":"query","required":false,"schema":{"type":"string"},"description":"The term that should have appeared in the query"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"histories":{"type":"array","items":{"type":"object","properties":{"agent":{"type":"object","properties":{"id":{"type":"string","description":"The ID of the agent who made the query"}}},"question":{"type":"string","description":"The question actually asked in the query"},"answers":{"type":"array","items":{"type":"object","properties":{"faq":{"type":"object","properties":{"id":{"type":"string","description":"The ID of the Q&A that was referred to"}}},"effectiveConfidence":{"type":"number","description":"The effective confidence score of the answer"},"confidence":{"type":"number","description":"The raw confidence score of the answer"}}}}}}},"count":{"type":"integer","description":"Total number of queries returned"}}},"errors":{"type":"object","nullable":true,"description":"Error information if the request fails"}}}}}}}}}}}
```

## Q\&A Candidates

> Using this API, you can get the list of unanswered questions from customers. They're called Candidates.<br>

```json
{"openapi":"3.1.0","info":{"title":"Alli API Documentation","version":"1.0.0"},"tags":[{"name":"FAQs","description":"FAQ 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/faq_candidates":{"get":{"tags":["FAQs"],"operationId":"faqCandidates","summary":"Q&A Candidates","description":"Using this API, you can get the list of unanswered questions from customers. They're called Candidates.\n","parameters":[{"$ref":"#/components/parameters/AgentEmailHeader"},{"$ref":"#/components/parameters/UserEmailHeader"},{"$ref":"#/components/parameters/OwnUserIdHeader"},{"name":"hashtags","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"}},"description":"Hashtag array if you want to limit the search scope to the given hashtags"},{"name":"searchTerm","in":"query","required":false,"schema":{"type":"string"},"description":"Search query to filter the candidates to see. You can use operators to run advanced searches. \"TERM1 TERM2\" for AND, \"TERM1 OR TERM2\" for OR, and \"TERM\" for exact match."},{"name":"order","in":"query","required":false,"schema":{"type":"string"},"description":"How to order the candidates. You can use ATTRIBUTE_[DESC or ASC] format. ATTRIBUTE can be FREQUENCY or CREATED_AT."},{"name":"state","in":"query","required":false,"schema":{"type":"string"},"description":"Status of the candidates to see. It can be ALL or ACTIVE or ARCHIVED."},{"name":"offset","in":"query","required":false,"schema":{"type":"integer"},"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"},"description":"limit allows you to set the number of objects returned on one page. The maximum value is 100."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"faqCandidates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The ID of the extracted answer to the unanswered question."},"frequency":{"type":"integer","description":"Sum of all the frequency numbers under the questions."},"textAnswer":{"type":"string","description":"The answer extracted from the uploaded documents for the question."},"state":{"type":"string","description":"The status of the candidate. ACTIVE if the candidate is not added to the Q&A database yet. ARCHIVED if the candidate is added to the Q&A database."},"createdAt":{"type":"number","description":"The timestamp of when the candidate was created."},"questions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The ID of the unanswered question from customers."},"question":{"type":"string","description":"The unanswered question from customers."},"frequency":{"type":"integer","description":"How many times the question was asked by customers."},"history":{"type":"object","properties":{"id":{"type":"string","description":"The ID of the history information of the unanswered question."}}}}}}}}},"count":{"type":"integer","description":"The total number of candidates."}}},"errors":{"type":"object","nullable":true}}}}}}}}}}}
```

## Daily FAQ Count

> Daily trend of Q\&A from FAQ in given date range.

```json
{"openapi":"3.1.0","info":{"title":"Alli API Documentation","version":"1.0.0"},"tags":[{"name":"FAQs","description":"FAQ 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/faq_daily_count":{"get":{"tags":["FAQs"],"operationId":"faqDailyCount","summary":"Daily FAQ Count","description":"Daily trend of Q&A from FAQ in given date range.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"startDate":{"type":"string","description":"Start of range of dates to query in YYYY-MM-DD format."},"endDate":{"type":"string","description":"End of range of dates to query in YYYY-MM-DD format."}}}}}},"responses":{"200":{"description":"Successfully retrieved daily FAQ count","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"dailyTotalCount":{"type":"array","description":"List of date and count pairs, where count is the number of FAQs selected on date.","items":{"type":"object","properties":{"date":{"type":"string","description":"Date in YYYY-MM-DD format"},"count":{"type":"integer","description":"Number of FAQs selected on this date"}}}},"state":{"type":"string","description":"State of the request"},"campaignCount":{"type":"integer","description":"Number of campaigns"}}},"errors":{"type":"object","nullable":true}}}}}}},"parameters":[{"$ref":"#/components/parameters/AgentEmailHeader"},{"$ref":"#/components/parameters/UserEmailHeader"},{"$ref":"#/components/parameters/OwnUserIdHeader"}]}}}}
```

## Daily FAQ Analytics

> Analytics information for the most frequently asked Q\&As.

```json
{"openapi":"3.1.0","info":{"title":"Alli API Documentation","version":"1.0.0"},"tags":[{"name":"FAQs","description":"FAQ 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/faq_daily_analytics":{"get":{"tags":["FAQs"],"operationId":"faqDailyAnalytics","summary":"Daily FAQ Analytics","description":"Analytics information for the most frequently asked Q&As.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"topN":{"type":"integer","description":"Top N of the most frequently asked Q&A. Maximum value for N is 20. Please use 1, 5, 10, or 20 for N."},"startDate":{"type":"string","description":"Start of range of dates to query in YYYY-MM-DD format."},"endDate":{"type":"string","description":"End of range of dates to query in YYYY-MM-DD format."}}}}}},"responses":{"200":{"description":"Successfully retrieved FAQ analytics","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"faqDailyAnalytics":{"type":"array","description":"List of JSON objects, each containing analytics information for one FAQ.","items":{"type":"object","properties":{"totalCount":{"type":"integer","description":"Total number of times Q&A was selected."},"totalShownCount":{"type":"integer","description":"Total number of times Q&A was displayed."},"selectedRatio":{"type":"number","description":"Ratio of times Q&A was selected to times Q&A was displayed."},"faq":{"type":"object","properties":{"id":{"type":"string","description":"FAQ ID"},"question":{"type":"string","description":"FAQ question"}}},"stats":{"type":"array","description":"List of date and selectedCount pairs where selectedCount is the number of times the FAQ was selected on date.","items":{"type":"object","properties":{"date":{"type":"string","description":"Date in YYYY-MM-DD format"},"selectedCount":{"type":"integer","description":"Number of times the FAQ was selected on this date"}}}}}}}}},"errors":{"type":"object","nullable":true}}}}}}},"parameters":[{"$ref":"#/components/parameters/AgentEmailHeader"},{"$ref":"#/components/parameters/UserEmailHeader"},{"$ref":"#/components/parameters/OwnUserIdHeader"}]}}}}
```

## Q\&A Candidates

> Registers a new Q\&A Candidate with the system.<br>

```json
{"openapi":"3.1.0","info":{"title":"Alli API Documentation","version":"1.0.0"},"tags":[{"name":"FAQs","description":"FAQ 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/add_faq_candidates":{"post":{"tags":["FAQs"],"operationId":"addFaqCandidates","summary":"Q&A Candidates","description":"Registers a new Q&A Candidate with the system.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["queries"],"properties":{"queries":{"type":"array","items":{"type":"string"},"description":"The list of all queries you would like to register"}}}}}},"responses":{"200":{"description":"Candidates registered successfully","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"candidates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The id of the candidate registered."}}}}}},"errors":{"type":"object","nullable":true}}}}}}},"parameters":[{"$ref":"#/components/parameters/AgentEmailHeader"},{"$ref":"#/components/parameters/UserEmailHeader"},{"$ref":"#/components/parameters/OwnUserIdHeader"}]}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.allganize.ai/api-reference/faqs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
