IFS Analyzer
POST
/api/v1/ifs-analyzer/analyzeArbitrate 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
| Field | Type | Required | Description |
|---|---|---|---|
requirement | string | Yes | IFS 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. |
scope | string | Yes | Scope (périmètre) of the audited process. The analysis weighs the hazards of this process. ≤ 1,000 characters. |
observation | string | Yes | The auditor's observation graded D. ≤ 5,000 characters. |
validator_remark | string | No | The technical validator's remark (VT). Used by the critic. ≤ 3,000 characters. |
reference | string | No | Your own id for the observation, echoed back as-is. ≤ 200 characters. |
critic | boolean | No | true 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 ofA,B,C,D,Majeur,KO.reasoning: the technical justification, in markdown.critic:nullwhen you sentcritic: false(or the critic is turned off by default). Otherwiseverdictis 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_validationis alwaystrue: an IFS expert must confirm the suggestion.
Errors
| HTTP | Code | Description |
|---|---|---|
| 400 | INVALID_INPUT | Missing field, wrong type, too long, or invalid JSON. details.errors lists every problem. |
| 400 | REQUIREMENT_NOT_FOUND | The requirement number does not exist in IFS Food v8. |
| 402 | COIN_LIMIT_EXCEEDED | Your organization has used its coins for the month. |
| 502 | MODEL_ERROR | The model answer was cut off or unreadable. Safe to retry. |
| 503 | AI_RATE_LIMITED | The AI model is temporarily overloaded. We already retried for about a minute; retry after the Retry-After header (60 s). |
| 500 | PROCESSING_ERROR | Unexpected failure. Retry, and quote the X-Request-Id if it persists. |
See the full error code reference on the authentication page.