{"components":{"schemas":{"ApiProblem":{"additionalProperties":false,"properties":{"code":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"},"status":{"maximum":599,"minimum":400,"type":"integer"},"title":{"type":"string"},"type":{"format":"uri","type":"string"}},"required":["type","title","status","detail","code","request_id"],"type":"object"},"ExactAmbiguous":{"additionalProperties":false,"properties":{"candidates":{"items":{"$ref":"#/components/schemas/ExactCandidate"},"maxItems":10,"minItems":2,"type":"array"},"candidates_truncated":{"type":"boolean"},"match":{"type":"null"},"request_id":{"type":"string"},"requested":{"$ref":"#/components/schemas/ExactRequested"},"retrieval":{"$ref":"#/components/schemas/ExactRetrieval"},"status":{"const":"ambiguous"}},"required":["request_id","status","requested","match","candidates","retrieval","candidates_truncated"],"type":"object"},"ExactCandidate":{"additionalProperties":false,"properties":{"article_id":{"type":"string"},"article_number":{"type":"string"},"article_number_raw":{"type":"string"},"date_end":{"format":"date","type":"string"},"date_start":{"format":"date","type":"string"},"parent_id":{"type":"string"},"parent_nature":{"type":"string"},"parent_title":{"type":"string"},"state":{"type":"string"}},"required":["article_id","article_number","article_number_raw","state","date_start","date_end","parent_id","parent_title","parent_nature"],"type":"object"},"ExactComparison":{"additionalProperties":false,"properties":{"request_id":{"type":"string"},"requested":{"$ref":"#/components/schemas/ExactComparisonRequest"},"results":{"items":{"oneOf":[{"$ref":"#/components/schemas/ExactComparisonDecisionResolved"},{"$ref":"#/components/schemas/ExactComparisonDecisionNotFound"},{"$ref":"#/components/schemas/ExactComparisonDecisionAmbiguous"}]},"maxItems":2,"minItems":2,"type":"array"},"retrieval":{"additionalProperties":false,"properties":{"elapsed_ms":{"minimum":0,"type":"number"},"proof_authority":{"const":"structured_metadata"},"snapshot_id":{"type":["string","null"]},"source_latest":{"type":["string","null"]},"strategy":{"const":"exact_comparison"}},"required":["strategy","proof_authority","snapshot_id","source_latest","elapsed_ms"],"type":"object"},"status":{"const":"compared"}},"required":["request_id","status","requested","results","retrieval"],"type":"object"},"ExactComparisonDecisionAmbiguous":{"additionalProperties":false,"properties":{"candidates":{"items":{"$ref":"#/components/schemas/ExactCandidate"},"maxItems":10,"minItems":2,"type":"array"},"candidates_truncated":{"type":"boolean"},"effective_date":{"format":"date","type":"string"},"match":{"type":"null"},"status":{"const":"ambiguous"}},"required":["effective_date","status","match","candidates","candidates_truncated"],"type":"object"},"ExactComparisonDecisionNotFound":{"additionalProperties":false,"properties":{"candidates":{"maxItems":0,"type":"array"},"effective_date":{"format":"date","type":"string"},"match":{"type":"null"},"status":{"const":"not_found"}},"required":["effective_date","status","match","candidates"],"type":"object"},"ExactComparisonDecisionResolved":{"additionalProperties":false,"properties":{"candidates":{"maxItems":0,"type":"array"},"effective_date":{"format":"date","type":"string"},"match":{"$ref":"#/components/schemas/ExactMatch"},"status":{"const":"resolved"}},"required":["effective_date","status","match","candidates"],"type":"object"},"ExactComparisonRequest":{"additionalProperties":false,"anyOf":[{"properties":{"parent_title":{"pattern":".*\\S.*","type":"string"}},"required":["parent_title"]},{"properties":{"parent_id":{"pattern":"^(?:LEGI|JORF)TEXT[0-9]{12}$","type":"string"}},"required":["parent_id"]}],"properties":{"article_number":{"maxLength":64,"minLength":1,"type":"string"},"dates":{"items":{"format":"date","type":"string"},"maxItems":2,"minItems":2,"type":"array","uniqueItems":true},"parent_id":{"pattern":"^(?:LEGI|JORF)TEXT[0-9]{12}$","type":["string","null"]},"parent_nature":{"enum":["ARRETE","AVIS","CIRCULAIRE","CODE","CONSTIT","CONSTITUTION","DECISION","DECRET","DELIBERATION","LOI","LOI_CONSTIT","LOI_ORGANIQUE","ORDONNANCE"],"type":"string"},"parent_title":{"maxLength":500,"pattern":".*\\S.*","type":["string","null"]}},"required":["article_number","parent_nature","dates"],"type":"object"},"ExactDocumentNotFound":{"additionalProperties":false,"properties":{"match":{"type":"null"},"request_id":{"type":"string"},"requested":{"$ref":"#/components/schemas/ExactDocumentRequested"},"retrieval":{"$ref":"#/components/schemas/ExactDocumentRetrieval"},"status":{"const":"not_found"}},"required":["request_id","status","requested","match","retrieval"],"type":"object"},"ExactDocumentRequested":{"additionalProperties":false,"properties":{"official_id":{"pattern":"^(?:LEGI|JORF)ARTI[0-9]{12}$","type":"string"}},"required":["official_id"],"type":"object"},"ExactDocumentResolved":{"additionalProperties":false,"properties":{"match":{"$ref":"#/components/schemas/ExactMatch"},"request_id":{"type":"string"},"requested":{"$ref":"#/components/schemas/ExactDocumentRequested"},"retrieval":{"$ref":"#/components/schemas/ExactDocumentRetrieval"},"status":{"const":"resolved"}},"required":["request_id","status","requested","match","retrieval"],"type":"object"},"ExactDocumentRetrieval":{"additionalProperties":false,"properties":{"elapsed_ms":{"minimum":0,"type":"number"},"proof_authority":{"const":"structured_metadata"},"snapshot_id":{"type":["string","null"]},"source_latest":{"type":["string","null"]},"strategy":{"const":"exact_identifier"}},"required":["strategy","proof_authority","snapshot_id","source_latest","elapsed_ms"],"type":"object"},"ExactDocumentSourceAnomaly":{"additionalProperties":false,"properties":{"match":{"$ref":"#/components/schemas/ExactMatch"},"request_id":{"type":"string"},"requested":{"$ref":"#/components/schemas/ExactDocumentRequested"},"retrieval":{"$ref":"#/components/schemas/ExactDocumentRetrieval"},"status":{"const":"source_anomaly"},"temporal_quality":{"$ref":"#/components/schemas/ExactDocumentTemporalQuality"}},"required":["request_id","status","requested","match","temporal_quality","retrieval"],"type":"object"},"ExactDocumentTemporalQuality":{"additionalProperties":false,"properties":{"applicability":{"const":"not_asserted"},"status":{"enum":["zero_length","reversed"],"type":"string"}},"required":["status","applicability"],"type":"object"},"ExactMatch":{"additionalProperties":false,"properties":{"article_id":{"type":"string"},"article_number":{"type":"string"},"article_number_raw":{"type":"string"},"content_html":{"type":["string","null"]},"content_sha256":{"pattern":"^[a-f0-9]{64}$","type":"string"},"content_text":{"type":"string"},"date_end":{"format":"date","type":"string"},"date_start":{"format":"date","type":"string"},"parent_id":{"type":"string"},"parent_nature":{"type":"string"},"parent_title":{"type":"string"},"source_url":{"format":"uri","type":["string","null"]},"source_url_qualified":{"type":"boolean"},"state":{"type":"string"}},"required":["article_id","article_number","article_number_raw","state","date_start","date_end","parent_id","parent_title","parent_nature","content_html","content_text","content_sha256","source_url","source_url_qualified"],"type":"object"},"ExactNotFound":{"additionalProperties":false,"properties":{"candidates":{"maxItems":0,"type":"array"},"match":{"type":"null"},"request_id":{"type":"string"},"requested":{"$ref":"#/components/schemas/ExactRequested"},"retrieval":{"$ref":"#/components/schemas/ExactRetrieval"},"status":{"const":"not_found"}},"required":["request_id","status","requested","match","candidates","retrieval"],"type":"object"},"ExactRequested":{"additionalProperties":false,"properties":{"article_number":{"type":"string"},"article_number_canonical":{"type":"string"},"effective_date":{"format":"date","type":"string"},"parent_id":{"type":["string","null"]},"parent_nature":{"type":"string"},"parent_title":{"type":["string","null"]}},"required":["article_number","article_number_canonical","parent_title","parent_nature","parent_id","effective_date"],"type":"object"},"ExactResolved":{"additionalProperties":false,"properties":{"candidates":{"maxItems":0,"type":"array"},"match":{"$ref":"#/components/schemas/ExactMatch"},"request_id":{"type":"string"},"requested":{"$ref":"#/components/schemas/ExactRequested"},"retrieval":{"$ref":"#/components/schemas/ExactRetrieval"},"status":{"const":"resolved"}},"required":["request_id","status","requested","match","candidates","retrieval"],"type":"object"},"ExactRetrieval":{"additionalProperties":false,"properties":{"elapsed_ms":{"minimum":0,"type":"number"},"proof_authority":{"const":"structured_metadata"},"snapshot_id":{"type":["string","null"]},"source_latest":{"type":["string","null"]},"strategy":{"const":"exact_metadata"}},"required":["strategy","proof_authority","snapshot_id","source_latest","elapsed_ms"],"type":"object"}},"securitySchemes":{"ApiKeyBearer":{"bearerFormat":"LexMachine API key","scheme":"bearer","type":"http"}}},"info":{"description":"Recherche en lecture seule et r\u00e9solution documentaire exacte dans les corpus de Lex Machine.","title":"Lex Machine Search API","version":"1.3.1"},"openapi":"3.1.0","paths":{"/api/v1/documents/{official_id}":{"get":{"description":"Extension V3 activable s\u00e9par\u00e9ment, sans recherche. La V3.1 peut restituer une anomalie temporelle brute sans affirmer l'applicabilit\u00e9 du document.","operationId":"getExactLegislationDocument","parameters":[{"in":"path","name":"official_id","required":true,"schema":{"pattern":"^(?:LEGI|JORF)ARTI[0-9]{12}$","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"discriminator":{"mapping":{"not_found":"#/components/schemas/ExactDocumentNotFound","resolved":"#/components/schemas/ExactDocumentResolved","source_anomaly":"#/components/schemas/ExactDocumentSourceAnomaly"},"propertyName":"status"},"oneOf":[{"$ref":"#/components/schemas/ExactDocumentResolved"},{"$ref":"#/components/schemas/ExactDocumentNotFound"},{"$ref":"#/components/schemas/ExactDocumentSourceAnomaly"}]}}},"description":"Document exact ou absence exacte"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ApiProblem"}}},"description":"Cl\u00e9 absente ou invalide"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ApiProblem"}}},"description":"Op\u00e9ration absente, d\u00e9sactiv\u00e9e ou non autoris\u00e9e"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ApiProblem"}}},"description":"Identifiant invalide"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ApiProblem"}}},"description":"Limite atteinte"},"503":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ApiProblem"}}},"description":"Lecture temporairement indisponible"}},"security":[{"ApiKeyBearer":[]}],"summary":"Lire une version exacte par identifiant officiel"}},"/api/v1/indexes":{"get":{"operationId":"listKnowledgeIndexes","responses":{"200":{"description":"Corpus accessibles"}},"security":[{"ApiKeyBearer":[]}],"summary":"Lister les corpus accessibles"}},"/api/v1/indexes/legislation/compare":{"post":{"description":"Extension V3 activable s\u00e9par\u00e9ment. Elle ex\u00e9cute deux r\u00e9solutions exactes et ne produit aucune interpr\u00e9tation juridique.","operationId":"compareExactLegislationArticle","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExactComparisonRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExactComparison"}}},"description":"Deux d\u00e9cisions exactes s\u00e9par\u00e9es"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ApiProblem"}}},"description":"JSON invalide"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ApiProblem"}}},"description":"Cl\u00e9 absente ou invalide"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ApiProblem"}}},"description":"Op\u00e9ration absente, d\u00e9sactiv\u00e9e ou non autoris\u00e9e"},"413":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ApiProblem"}}},"description":"Corps trop volumineux"},"415":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ApiProblem"}}},"description":"Type MIME invalide"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ApiProblem"}}},"description":"Comparaison invalide"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ApiProblem"}}},"description":"Limite atteinte"},"503":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ApiProblem"}}},"description":"Comparaison temporairement indisponible"}},"security":[{"ApiKeyBearer":[]}],"summary":"Comparer exactement le m\u00eame article \u00e0 deux dates"}},"/api/v1/indexes/legislation/resolve":{"post":{"description":"R\u00e9solution structur\u00e9e par num\u00e9ro, texte parent, nature et date. Cette op\u00e9ration n'effectue aucune recherche vectorielle ou FTS.","operationId":"resolveExactLegislationArticle","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"anyOf":[{"properties":{"parent_title":{"maxLength":500,"minLength":1,"pattern":".*\\S.*","type":"string"}},"required":["parent_title"]},{"properties":{"parent_id":{"pattern":"^(?:LEGI|JORF)TEXT[0-9]{12}$","type":"string"}},"required":["parent_id"]}],"properties":{"article_number":{"examples":["L. 3121-18"],"maxLength":64,"minLength":1,"type":"string"},"effective_date":{"examples":["2026-08-11"],"format":"date","type":"string"},"parent_id":{"pattern":"^(?:LEGI|JORF)TEXT[0-9]{12}$","type":["string","null"]},"parent_nature":{"enum":["ARRETE","AVIS","CIRCULAIRE","CODE","CONSTIT","CONSTITUTION","DECISION","DECRET","DELIBERATION","LOI","LOI_CONSTIT","LOI_ORGANIQUE","ORDONNANCE"],"type":"string"},"parent_title":{"examples":["Code du travail"],"maxLength":500,"minLength":1,"pattern":".*\\S.*","type":["string","null"]}},"required":["article_number","parent_nature","effective_date"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"discriminator":{"mapping":{"ambiguous":"#/components/schemas/ExactAmbiguous","not_found":"#/components/schemas/ExactNotFound","resolved":"#/components/schemas/ExactResolved"},"propertyName":"status"},"oneOf":[{"$ref":"#/components/schemas/ExactResolved"},{"$ref":"#/components/schemas/ExactNotFound"},{"$ref":"#/components/schemas/ExactAmbiguous"}]}}},"description":"D\u00e9cision resolved, not_found ou ambiguous"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ApiProblem"}}},"description":"JSON invalide"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ApiProblem"}}},"description":"Cl\u00e9 absente ou invalide"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ApiProblem"}}},"description":"Op\u00e9ration absente ou non autoris\u00e9e"},"413":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ApiProblem"}}},"description":"Corps trop volumineux"},"415":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ApiProblem"}}},"description":"Type MIME invalide"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ApiProblem"}}},"description":"R\u00e9f\u00e9rence structur\u00e9e invalide"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ApiProblem"}}},"description":"Limite atteinte"},"503":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ApiProblem"}}},"description":"R\u00e9solveur temporairement indisponible"}},"security":[{"ApiKeyBearer":[]}],"summary":"R\u00e9soudre exactement un article et sa version applicable"}},"/api/v1/indexes/{index_id}/search":{"post":{"operationId":"searchKnowledgeIndex","parameters":[{"in":"path","name":"index_id","required":true,"schema":{"enum":["amendements","circulaires","cnil","cour-comptes","dossiers-legislatifs","hatvp","jorf","jurisprudence","kali","legislation","plf-pli","propositions-loi","questions-ecrites"],"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"mode":{"description":"Mode optionnel, selon le corpus.","enum":["semantic","keywords","hybrid"],"type":"string"},"query":{"maxLength":2000,"minLength":1,"type":"string"},"top_k":{"default":10,"maximum":20,"minimum":1,"type":"integer"}},"required":["query"],"type":"object"}}},"required":true},"responses":{"200":{"description":"Passages class\u00e9s par pertinence"},"401":{"description":"Cl\u00e9 absente ou invalide"},"404":{"description":"Corpus absent ou non autoris\u00e9"},"422":{"description":"Param\u00e8tres invalides"},"429":{"description":"Limite atteinte"}},"security":[{"ApiKeyBearer":[]}],"summary":"Rechercher des passages dans un corpus"}}},"servers":[{"url":"https://api.lexmachine.net"}]}
