{"openapi":"3.1.0","info":{"title":"OAuth Biometry Service","description":"Scalable biometric verification service — face detection, OCR, cross-validation pipeline.","version":"1.0.0"},"paths":{"/":{"get":{"tags":["meta"],"summary":"API home","description":"Biometry service homepage.","operationId":"home__get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/health":{"get":{"summary":"Health","description":"Health check endpoint.","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/version":{"get":{"summary":"Version","description":"Service version endpoint.","operationId":"version_version_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/jobs/submit":{"post":{"tags":["jobs"],"summary":"Submit Job","description":"Submit a single verification job (fire-and-forget).","operationId":"submit_job_jobs_submit_post","parameters":[{"name":"X-Service-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Service-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitJobRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitJobResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/jobs/submit-batch":{"post":{"tags":["jobs"],"summary":"Submit Batch","description":"Submit a batch of verification jobs.","operationId":"submit_batch_jobs_submit_batch_post","parameters":[{"name":"X-Service-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Service-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitBatchRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitBatchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/jobs/results":{"get":{"tags":["jobs"],"summary":"Poll Results","description":"Poll completed results (Identity Admin calls this periodically).","operationId":"poll_results_jobs_results_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}},{"name":"X-Service-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Service-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PollResultsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/jobs/ack":{"post":{"tags":["jobs"],"summary":"Ack Results","description":"Acknowledge processed results (removes from Redis).","operationId":"ack_results_jobs_ack_post","parameters":[{"name":"X-Service-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Service-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AckRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AckResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/jobs/{job_id}":{"get":{"tags":["jobs"],"summary":"Get Job Status","description":"Get status of a specific job.","operationId":"get_job_status_jobs__job_id__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"X-Service-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Service-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AckRequest":{"properties":{"job_ids":{"items":{"type":"string"},"type":"array","title":"Job Ids"}},"type":"object","required":["job_ids"],"title":"AckRequest"},"AckResponse":{"properties":{"acked":{"type":"integer","title":"Acked"},"not_found":{"type":"integer","title":"Not Found"}},"type":"object","required":["acked","not_found"],"title":"AckResponse"},"DeclaredIdentity":{"properties":{"first_name":{"type":"string","title":"First Name"},"last_name":{"type":"string","title":"Last Name"},"date_of_birth":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date Of Birth"},"gender":{"anyOf":[{"type":"string","enum":["M","F","O","N"]},{"type":"null"}],"title":"Gender"},"nationality":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Nationality"}},"type":"object","required":["first_name","last_name"],"title":"DeclaredIdentity"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"JobResult":{"properties":{"job_id":{"type":"string","title":"Job Id"},"citizen_code":{"type":"string","title":"Citizen Code"},"status":{"type":"string","enum":["completed","error"],"title":"Status"},"outcome":{"type":"string","enum":["verified","pending_review","rejected","error"],"title":"Outcome"},"completed_at":{"type":"string","title":"Completed At"},"processing_time_ms":{"type":"integer","title":"Processing Time Ms"},"failure_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Failure Reason"},"cross_validations":{"additionalProperties":true,"type":"object","title":"Cross Validations"},"scores":{"additionalProperties":true,"type":"object","title":"Scores"}},"type":"object","required":["job_id","citizen_code","status","outcome","completed_at","processing_time_ms","cross_validations","scores"],"title":"JobResult"},"JobStatusResponse":{"properties":{"job_id":{"type":"string","title":"Job Id"},"status":{"type":"string","enum":["queued","processing","completed","error"],"title":"Status"},"citizen_code":{"type":"string","title":"Citizen Code"},"queued_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Queued At"},"started_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Started At"},"worker_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Worker Id"}},"type":"object","required":["job_id","status","citizen_code"],"title":"JobStatusResponse"},"PollResultsResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/JobResult"},"type":"array","title":"Results"},"total_ready":{"type":"integer","title":"Total Ready"},"returned":{"type":"integer","title":"Returned"},"queue_depth":{"type":"integer","title":"Queue Depth"},"workers_active":{"type":"integer","title":"Workers Active"}},"type":"object","required":["results","total_ready","returned","queue_depth","workers_active"],"title":"PollResultsResponse"},"SubmitBatchRequest":{"properties":{"jobs":{"items":{"$ref":"#/components/schemas/SubmitJobRequest"},"type":"array","title":"Jobs"}},"type":"object","required":["jobs"],"title":"SubmitBatchRequest"},"SubmitBatchResponse":{"properties":{"batch_id":{"type":"string","title":"Batch Id"},"job_ids":{"items":{"type":"string"},"type":"array","title":"Job Ids"},"total":{"type":"integer","title":"Total"},"queued":{"type":"integer","title":"Queued"},"queue_depth":{"type":"integer","title":"Queue Depth","default":0}},"type":"object","required":["batch_id","job_ids","total","queued"],"title":"SubmitBatchResponse"},"SubmitJobRequest":{"properties":{"citizen_code":{"type":"string","title":"Citizen Code"},"document_type":{"type":"string","enum":["CNI","PASSPORT","TITRE_DE_SEJOUR","NATIONAL_ID"],"title":"Document Type"},"country_code":{"type":"string","title":"Country Code"},"selfie_b64":{"type":"string","title":"Selfie B64"},"cni_recto_b64":{"type":"string","title":"Cni Recto B64"},"cni_verso_b64":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cni Verso B64"},"declared_identity":{"$ref":"#/components/schemas/DeclaredIdentity"},"priority":{"type":"string","enum":["normal","high"],"title":"Priority","default":"normal"},"callback_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Callback Url"}},"type":"object","required":["citizen_code","document_type","country_code","selfie_b64","cni_recto_b64","declared_identity"],"title":"SubmitJobRequest"},"SubmitJobResponse":{"properties":{"job_id":{"type":"string","title":"Job Id"},"status":{"type":"string","const":"queued","title":"Status","default":"queued"},"queue_position":{"type":"integer","title":"Queue Position","default":0},"estimated_wait_seconds":{"type":"integer","title":"Estimated Wait Seconds","default":0}},"type":"object","required":["job_id"],"title":"SubmitJobResponse"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}