Rest API
Generate a quality control report
POST
/api/v1/ai/quality/control/report
const url = 'https://api.unless.com/api/v1/ai/quality/control/report';const options = { method: 'POST', headers: { 'x-api-key': 'example', 'x-user-email': 'example', 'x-account-id': 'example', 'x-website-id': 'example' }};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.unless.com/api/v1/ai/quality/control/report \ --header 'x-account-id: example' \ --header 'x-api-key: example' \ --header 'x-user-email: example' \ --header 'x-website-id: example'Start a run that asks the account’s AI every control question and grades each answer against the expected one. Returns immediately with the reportId; the grading happens asynchronously.
Notes
- Every control question costs one AI call, so this is only available on the Enterprise, Flex, Fixed and Plus plans. Other plans get
403 - Answers
400when the website has no control questions yet - Poll
GET /api/v1/ai/quality/control/reportfor progress. The report is absent from the list until its first question has been scored
Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”x-api-key
required
string
Your API key from account settings.
x-user-email
required
string
The email address of your user.
x-account-id
required
string
The ID of your account. You can find this in the account settings.
x-website-id
required
string
The ID of the workspace you want to use.
Responses
Section titled “Responses”Report generation was started.
Media typeapplication/json
object
message
string
reportId
Poll the report list for this id.
string
Example
{ "message": "Report generation initiated", "reportId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}Bad request - missing websiteId, or the website has no control questions.
Unauthorized - invalid API key.
The account’s plan does not include quality control reports.