> 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/mrc.md).

# MRC

MRC related APIs

## Documents Search User Feedback

> Provide user feedback to the Documents search result.<br>

```json
{"openapi":"3.1.0","info":{"title":"Alli API Documentation","version":"1.0.0"},"tags":[{"name":"MRC","description":"MRC 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/mrc/user_feedback":{"post":{"tags":["MRC"],"operationId":"registerMrcUserFeedback","summary":"Documents Search User Feedback","description":"Provide user feedback to the Documents search result.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["answerHash","answer","id","query"],"properties":{"answerHash":{"type":"string","description":"The ID of the Document search result you want to give or cancel feedback for the query. It is created whenever a Documents search happens and bound to the query and the answer pair. It can be retrieved using the Documents API above."},"answer":{"type":"string","description":"The answer that you received to your query from this document."},"id":{"type":"string","description":"The ID for the document where the answer was extracted from."},"positive":{"type":"boolean","nullable":true,"description":"When the value is true, positive feedback is given to the extracted answer for the query. When it's false, negative feedback is given. When it's null, it cancels the feedback."},"query":{"type":"string","description":"The query you want to give or cancel feedback for, toward the extracted search result."}}}}}},"responses":{"200":{"description":"Feedback submitted successfully","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"userFeedback":{"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."}}}}}}}}}},"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."}},"parameters":[{"$ref":"#/components/parameters/AgentEmailHeader"},{"$ref":"#/components/parameters/UserEmailHeader"},{"$ref":"#/components/parameters/OwnUserIdHeader"}]}}}}
```

## Documents Feedbacks

> This API lets you get the list of feedbacks given to Document search results (AI-extracted answers from uploaded documents) for each search query.<br>

```json
{"openapi":"3.1.0","info":{"title":"Alli API Documentation","version":"1.0.0"},"tags":[{"name":"MRC","description":"MRC 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/mrc_feedbacks":{"get":{"tags":["MRC"],"operationId":"mrcFeedbacks","summary":"Documents Feedbacks","description":"This API lets you get the list of feedbacks given to Document search results (AI-extracted answers from uploaded documents) for each search query.\n","parameters":[{"$ref":"#/components/parameters/AgentEmailHeader"},{"$ref":"#/components/parameters/UserEmailHeader"},{"$ref":"#/components/parameters/OwnUserIdHeader"},{"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":"MRC feedbacks retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"type":"object","properties":{"query":{"type":"string","description":"The search query for the extracted answer."},"feedbacks":{"type":"array","items":{"type":"object","properties":{"document_id":{"type":"string","description":"The ID of the document where the answer was extracted from."},"answer":{"type":"string","description":"The answer part extracted from the document for the query."},"answer_hash":{"type":"string","description":"The ID for the answer part extracted from the document for the query. It is created whenever a Documents search happens and bound to the query and the answer pair. It's the same value from the POST Documents API above."},"positive":{"type":"boolean","description":"true or false. true indicates that the extracted answer has positive feedback upon the search, and false indicates negative feedback."}}}}}}},"count":{"type":"integer","description":"The total number of feedbacks listed."}}}}}},"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."}}}}}}
```

## Documents Search Feedback

> This API lets you give or cancel feedback given to a Document search result for a search query.<br>

```json
{"openapi":"3.1.0","info":{"title":"Alli API Documentation","version":"1.0.0"},"tags":[{"name":"MRC","description":"MRC 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/mrc_feedback":{"post":{"tags":["MRC"],"operationId":"mrcFeedback","summary":"Documents Search Feedback","description":"This API lets you give or cancel feedback given to a Document search result for a search query.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["query","id","answerHash"],"properties":{"query":{"type":"string","description":"The query you want to give or cancel feedback for, toward the extracted search result."},"id":{"type":"string","description":"The ID for the document where the answer was extracted from."},"answerHash":{"type":"string","description":"The ID of the Document search result you want to give or cancel feedback for the query. It is created whenever a Documents search happens and bound to the query and the answer pair. It can be retrieved using the Documents API above."},"isPositive":{"type":"boolean","nullable":true,"description":"When the value is true, positive feedback is given to the extracted answer 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":{"mrcFeedbackSearchResult":{"type":"object","properties":{"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}}}}}},"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."}},"parameters":[{"$ref":"#/components/parameters/AgentEmailHeader"},{"$ref":"#/components/parameters/UserEmailHeader"},{"$ref":"#/components/parameters/OwnUserIdHeader"}]}}}}
```

## Documents Query History

> Returns the past Documents 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":"MRC","description":"MRC 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/mrc_histories":{"get":{"tags":["MRC"],"operationId":"mrcHistories","summary":"Documents Query History","description":"Returns the past Documents 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":"searchTerm","in":"query","required":false,"schema":{"type":"string"},"description":"The term that should have appeared in the query"},{"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":"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":"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)"}],"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 request"}}},"question":{"type":"string","description":"The actual question asked"},"answers":{"type":"array","items":{"type":"object","properties":{"knowledgeBase":{"type":"object","properties":{"id":{"type":"string","description":"ID of the knowledge base used to source the answer"},"fileName":{"type":"string","description":"Filename of the knowledge base used to source the answer"}}},"answer":{"type":"string","description":"The actual answer content, formatted according to answerFormat"},"answerHash":{"type":"string","description":"A hash of the answer for reference"},"answerFormat":{"type":"string","description":"Format of the answer (e.g., DRAFTJS)"},"hashtags":{"type":"array","items":{"type":"string"},"description":"Hashtags associated with the knowledge base"},"feedbackAvailable":{"type":"boolean","description":"Whether feedback can be provided for this answer"},"columnFilterValues":{"type":"array","items":{"type":"string"},"description":"Any column filter values associated with the answer"}}}}}}},"count":{"type":"integer","description":"Total number of query histories returned"}}},"errors":{"type":"object","nullable":true,"description":"Error information if the request fails"}}}}}},"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."}}}}}}
```
