IFS Analyzer
POST/api/v1/ifs-analyzer/analyze

Arbitrate one IFS Food v8 observation graded "D": keep D or requalify as a Major non-conformity.

Authentication

Requires ifs-analyzer:analyze permission. See Authentication.

Request — JSON

curl -X POST https://api.myqateam.com/api/v1/ifs-analyzer/analyze \
-H "Authorization: Bearer myqa_..." \
-H "Content-Type: application/json" \
-d '{
"requirement": "4.12.1",
"scope": "Production de plats cuisinés réfrigérés",
"observation": "Le test du détecteur de métaux de la ligne 2 n'\''a pas été réalisé au démarrage de 6h.",
"validator_remark": "Risque de corps étrangers sur les lots de 6h à 10h.",
"reference": "NC-2026-0042",
"critic": true
}'

Fields

FieldTypeRequiredDescription
requirementstringYesIFS Food v8 requirement number, e.g. 4.12.1. We use the official text (its KO flag comes back as requirement.is_ko); unknown numbers return REQUIREMENT_NOT_FOUND. List them with GET /api/v1/standards/IFS-FOOD/clauses.
scopestringYesScope (périmètre) of the audited process. The analysis weighs the hazards of this process. ≤ 1,000 characters.
observationstringYesThe auditor's observation graded D. ≤ 5,000 characters.
validator_remarkstringNoThe technical validator's remark (VT). Used by the critic. ≤ 3,000 characters.
referencestringNoYour own id for the observation, echoed back as-is. ≤ 200 characters.
criticbooleanNotrue runs the critic, a second opinion that checks the analysis against validator_remark; false skips it (faster, fewer tokens, critic is null in the response). Omit it to use the default, which is on.

Text is sent to Google Gemini on the EU multi-region endpoint. Emails, phone numbers and similar identifiers are removed before the model sees them. The analysis is written in French.

Response — synchronous

json
{
"success": true,
"data": {
"analysis_id": "6f0c…",
"reference": "NC-2026-0042",
"requirement": { "number": "4.12.1", "text": "Sur la base des risques, des procédures…", "is_ko": true },
"grade": "Majeur",
"reasoning": "1. **Analyse du Risque lié au Scope :** …",
"critic": {
"verdict": "L'analyse de l'IA ne valide pas la notation en D, et la demande de la VT est pertinente"
},
"model": { "analyst": "gemini-3.5-flash", "critic": "gemini-3.5-flash" },
"prompt_versions": { "analyst": 1, "critic": 1 },
"settings_version": 1,
"processing_time_ms": 18450,
"token_usage": { "input_tokens": 2100, "output_tokens": 950, "total_tokens": 3050 },
"validation_status": "pending_validation",
"requires_human_validation": true,
"created_at": "2026-10-01T12:00:00Z"
}
}
  • grade: one of A, B, C, D, Majeur, KO.
  • reasoning: the technical justification, in markdown.
  • critic: null when you sent critic: false (or the critic is turned off by default). Otherwise verdict is one of: "L'analyse de l'IA valide la notation "D"", "L'analyse de l'IA ne valide pas la notation en D, et la demande de la VT est pertinente", or "L'analyse de l'IA ne valide pas la notation en D, Pas de remarque de la VT".
  • prompt_versions / settings_version: which configuration produced the result, for traceability.
  • requires_human_validation is always true: an IFS expert must confirm the suggestion.

Errors

HTTPCodeDescription
400INVALID_INPUTMissing field, wrong type, too long, or invalid JSON. details.errors lists every problem.
400REQUIREMENT_NOT_FOUNDThe requirement number does not exist in IFS Food v8.
402COIN_LIMIT_EXCEEDEDYour organization has used its coins for the month.
502MODEL_ERRORThe model answer was cut off or unreadable. Safe to retry.
503AI_RATE_LIMITEDThe AI model is temporarily overloaded. We already retried for about a minute; retry after the Retry-After header (60 s).
500PROCESSING_ERRORUnexpected failure. Retry, and quote the X-Request-Id if it persists.

See the full error code reference on the authentication page.

API Documentation — myQA.team