{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"https://api.authenica.tech","description":"Generated server url"}],"tags":[{"name":"Listes","description":"Sources servies et leur version courante"},{"name":"Criblage","description":"Recherche d'une identité dans les listes de sanctions et de PPE"},{"name":"Administration","description":"Consommateurs d'API et trace des appels"}],"paths":{"/api/v1/screenings":{"post":{"tags":["Criblage"],"summary":"Crible une identité","description":"Retourne les correspondances dont le score atteint le seuil, chacune avec sa liste et la version de la liste. Champs : fullName (obligatoire), entityType (NATURAL_PERSON ou LEGAL_ENTITY), listTypes (SANCTIONS, PPE, LOCAL), dateOfBirth, nationality, placeOfBirth ; documentNumber est réservé aux consommateurs autorisés (sinon ignoré, et nommé dans ignoredFields). Une réponse vide signifie qu'aucune correspondance n'existe dans les listes publiées ; une indisponibilité répond 503, jamais une réponse vide. Clé d'API requise (en-tête X-Api-Key).","operationId":"screen","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemoteScreeningRequest"}}},"required":true},"responses":{"200":{"description":"Correspondances (éventuellement aucune)","content":{"*/*":{"schema":{"$ref":"#/components/schemas/RemoteScreeningResponse"}}}},"400":{"description":"Demande invalide (nom vide, seuil hors de 0 à 1)","content":{"*/*":{"schema":{"$ref":"#/components/schemas/RemoteScreeningResponse"}}}},"401":{"description":"Clé d'API absente, inconnue ou révoquée","content":{"*/*":{"schema":{"$ref":"#/components/schemas/RemoteScreeningResponse"}}}},"429":{"description":"Quota par minute atteint","content":{"*/*":{"schema":{"$ref":"#/components/schemas/RemoteScreeningResponse"}}}},"503":{"description":"Référentiel indisponible","content":{"*/*":{"schema":{"$ref":"#/components/schemas/RemoteScreeningResponse"}}}}},"security":[{"X-Api-Key":[]}]}},"/api/v1/admin/consumers":{"get":{"tags":["Administration"],"summary":"Liste les consommateurs (sans leur clé)","operationId":"consumers","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ConsumerView"}}}}}},"security":[{"X-Admin-Key":[]}]},"post":{"tags":["Administration"],"summary":"Crée un consommateur et sa clé d'API","description":"La clé est tirée au hasard et remise une seule fois dans cette réponse.","operationId":"create","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateConsumerRequest"}}},"required":true},"responses":{"201":{"description":"Created","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CreatedConsumer"}}}}},"security":[{"X-Admin-Key":[]}]}},"/api/v1/admin/consumers/{id}/validity":{"post":{"tags":["Administration"],"summary":"Fixe la durée de validité de la clé, à compter de maintenant","description":"Sans durée, la clé n'expire plus. La clé elle-même ne change pas.","operationId":"validity","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidityRequest"}}}},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ConsumerView"}}}}},"security":[{"X-Admin-Key":[]}]}},"/api/v1/admin/consumers/{id}/rotate":{"post":{"tags":["Administration"],"summary":"Remplace la clé d'un consommateur : l'ancienne cesse de fonctionner aussitôt","description":"La nouvelle clé n'apparaît que dans cette réponse. Durée de validité facultative.","operationId":"rotate","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidityRequest"}}}},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CreatedConsumer"}}}}},"security":[{"X-Admin-Key":[]}]}},"/api/v1/admin/consumers/{id}/revoke":{"post":{"tags":["Administration"],"summary":"Révoque un consommateur : sa clé est refusée aussitôt","operationId":"revoke","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ConsumerView"}}}}},"security":[{"X-Admin-Key":[]}]}},"/api/v1/admin/consumers/{id}/quota":{"post":{"tags":["Administration"],"summary":"Fixe le quota par minute d'un consommateur, sans changer sa clé","description":"Entre 1 et 100 000 appels par minute. Effet immédiat : le quota est relu à chaque appel.","operationId":"quota","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuotaRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ConsumerView"}}}}},"security":[{"X-Admin-Key":[]}]}},"/api/v1/lists/sources":{"get":{"tags":["Listes"],"summary":"Sources servies","description":"Une entrée par liste : émetteur, type (sanctions ou PPE), dernier lot chargé et sa date. Aucune donnée personnelle.","operationId":"sources","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/SourcesResponse"}}}}},"security":[{"X-Api-Key":[]}]}},"/api/v1/admin/summary":{"get":{"tags":["Administration"],"summary":"Résumé des appels par consommateur sur les dernières heures","description":"Servis, erreurs, refus d'authentification, quotas atteints, durée moyenne.","operationId":"summary","parameters":[{"name":"hours","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":24}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Summary"}}}}}},"security":[{"X-Admin-Key":[]}]}},"/api/v1/admin/calls":{"get":{"tags":["Administration"],"summary":"Trace des appels, du plus récent au plus ancien","description":"Appels servis et refusés. Filtre optionnel par consommateur. Ni clé, ni identité soumise.","operationId":"calls","parameters":[{"name":"consumer","in":"query","required":false,"schema":{"type":"string"}},{"name":"outcome","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":100}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Call"}}}}}},"security":[{"X-Admin-Key":[]}]}}},"components":{"schemas":{"RemoteScreeningRequest":{"type":"object","properties":{"reference":{"type":"string"},"fullName":{"type":"string"},"dateOfBirth":{"type":"string","format":"date"},"nationality":{"type":"string"},"placeOfBirth":{"type":"string"},"documentNumber":{"type":"string"},"scoreThreshold":{"type":"number"},"corroboratedThreshold":{"type":"number"},"entityType":{"type":"string","enum":["NATURAL_PERSON","LEGAL_ENTITY"]},"listTypes":{"type":"array","items":{"type":"string","enum":["SANCTIONS","PPE","LOCAL"]},"uniqueItems":true}}},"FieldEvidence":{"type":"object","properties":{"field":{"type":"string","enum":["DOCUMENT_NUMBER","DATE_OF_BIRTH","NATIONALITY","PLACE_OF_BIRTH"]},"status":{"type":"string","enum":["MATCH","CONFLICT","UNKNOWN"]},"customerValue":{"type":"string"},"listValue":{"type":"string"}}},"ListInfo":{"type":"object","properties":{"label":{"type":"string"},"publisher":{"type":"string"}}},"MatchDetails":{"type":"object","properties":{"entityType":{"type":"string"},"list":{"$ref":"#/components/schemas/ListInfo"},"sanctionPrograms":{"type":"array","items":{"type":"string"}},"title":{"type":"string"},"description":{"type":"string"},"nationalities":{"type":"array","items":{"type":"string"}},"datesOfBirth":{"type":"array","items":{"type":"string"}},"placesOfBirth":{"type":"array","items":{"type":"string"}}}},"RemoteScreeningResponse":{"type":"object","properties":{"requestId":{"type":"string"},"matches":{"type":"array","items":{"$ref":"#/components/schemas/ScreeningMatch"}},"ignoredFields":{"type":"array","items":{"type":"string"}}}},"ScreeningMatch":{"type":"object","properties":{"listType":{"type":"string","enum":["SANCTIONS","PPE","LOCAL"]},"listName":{"type":"string"},"listVersion":{"type":"string"},"targetLabel":{"type":"string"},"score":{"type":"number"},"confidence":{"type":"string","enum":["CORROBORATED","MIXED","UNCORROBORATED","LIKELY_HOMONYM"]},"evidence":{"type":"array","items":{"$ref":"#/components/schemas/FieldEvidence"}},"details":{"$ref":"#/components/schemas/MatchDetails"}}},"CreateConsumerRequest":{"type":"object","properties":{"name":{"type":"string"},"quotaPerMinute":{"type":"integer","format":"int32"},"allowDocumentNumber":{"type":"boolean"},"validityDays":{"type":"integer","format":"int32"}}},"CreatedConsumer":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"quotaPerMinute":{"type":"integer","format":"int32"},"allowDocumentNumber":{"type":"boolean"},"apiKey":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"}}},"ValidityRequest":{"type":"object","properties":{"validityDays":{"type":"integer","format":"int32"}}},"ConsumerView":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"quotaPerMinute":{"type":"integer","format":"int32"},"active":{"type":"boolean"},"allowDocumentNumber":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"revokedAt":{"type":"string","format":"date-time"},"expiresAt":{"type":"string","format":"date-time"}}},"QuotaRequest":{"type":"object","properties":{"quotaPerMinute":{"type":"integer","format":"int32"}}},"SourceView":{"type":"object","properties":{"code":{"type":"string"},"label":{"type":"string"},"publisher":{"type":"string"},"listType":{"type":"string"},"lastBatchId":{"type":"string"},"lastLoadedAt":{"type":"string","format":"date-time"},"status":{"type":"string"},"entityCount":{"type":"integer","format":"int32"}}},"SourcesResponse":{"type":"object","properties":{"requestId":{"type":"string"},"sources":{"type":"array","items":{"$ref":"#/components/schemas/SourceView"}}}},"Summary":{"type":"object","properties":{"consumerName":{"type":"string"},"served":{"type":"integer","format":"int64"},"clientErrors":{"type":"integer","format":"int64"},"serverErrors":{"type":"integer","format":"int64"},"unauthenticated":{"type":"integer","format":"int64"},"rateLimited":{"type":"integer","format":"int64"},"adminRefused":{"type":"integer","format":"int64"},"averageMs":{"type":"integer","format":"int64"}}},"Call":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"requestId":{"type":"string","format":"uuid"},"calledAt":{"type":"string","format":"date-time"},"consumerName":{"type":"string"},"method":{"type":"string"},"path":{"type":"string"},"status":{"type":"integer","format":"int32"},"outcome":{"type":"string"},"durationMs":{"type":"integer","format":"int32"},"remoteAddr":{"type":"string"},"detail":{"type":"string"}}}}}}