{"openapi":"3.1.0","info":{"title":"Safegate API","description":"Fraud scoring and AML screening for Mexico / LATAM.\n\nIP geolocation (`signals.ip.facts.country`, `asn`, `as_org`): [IP Geolocation by DB-IP](https://db-ip.com), licensed under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/). If you display these values, include the same attribution.","version":"0.1.0"},"paths":{"/health":{"get":{"tags":["health"],"summary":"Health","description":"Liveness. Readiness checks (DB/Redis) come with the deployment work.","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Health Health Get"}}}}}}},"/v1/score":{"post":{"tags":["score"],"summary":"Post Score","operationId":"post_score_v1_score_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScoreRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScoreResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/screen":{"post":{"tags":["screening"],"summary":"Post Screen","operationId":"post_screen_v1_screen_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScreenRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScreenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/lists":{"get":{"tags":["lists"],"summary":"List Lists","operationId":"list_lists_v1_lists_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListsOut"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["lists"],"summary":"Create List","operationId":"create_list_v1_lists_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/lists/{list_id}":{"get":{"tags":["lists"],"summary":"Get List","operationId":"get_list_v1_lists__list_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"list_id","in":"path","required":true,"schema":{"type":"string","title":"List Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["lists"],"summary":"Delete List","operationId":"delete_list_v1_lists__list_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"list_id","in":"path","required":true,"schema":{"type":"string","title":"List Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/lists/{list_id}/entries":{"post":{"tags":["lists"],"summary":"Add Entries","operationId":"add_entries_v1_lists__list_id__entries_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"list_id","in":"path","required":true,"schema":{"type":"string","title":"List Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntriesIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntriesAdded"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["lists"],"summary":"List Entries","operationId":"list_entries_v1_lists__list_id__entries_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"list_id","in":"path","required":true,"schema":{"type":"string","title":"List Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}},{"name":"after","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"After"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntriesPage"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/lists/{list_id}/entries/remove":{"post":{"tags":["lists"],"summary":"Remove Entries","operationId":"remove_entries_v1_lists__list_id__entries_remove_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"list_id","in":"path","required":true,"schema":{"type":"string","title":"List Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntriesRemove"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntriesRemoved"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/lists/{list_id}/entries/{entry_id}":{"delete":{"tags":["lists"],"summary":"Delete Entry","operationId":"delete_entry_v1_lists__list_id__entries__entry_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"list_id","in":"path","required":true,"schema":{"type":"string","title":"List Id"}},{"name":"entry_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Entry Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/device":{"post":{"tags":["device"],"summary":"Post Device","operationId":"post_device_v1_device_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/keys":{"get":{"tags":["keys"],"summary":"List Keys","operationId":"list_keys_v1_keys_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeysOut"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["keys"],"summary":"Create Key","operationId":"create_key_v1_keys_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyIssued"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/keys/{key_id}/rotate":{"post":{"tags":["keys"],"summary":"Rotate Key","operationId":"rotate_key_v1_keys__key_id__rotate_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Key Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/KeyRotate"},{"type":"null"}],"title":"Body"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyIssued"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/keys/{key_id}":{"delete":{"tags":["keys"],"summary":"Revoke Key","operationId":"revoke_key_v1_keys__key_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Key Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rules":{"get":{"tags":["rules"],"summary":"Get Rules","operationId":"get_rules_v1_rules_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RulesOut"}}}}},"security":[{"HTTPBearer":[]}]},"put":{"tags":["rules"],"summary":"Put Rules","description":"Insert or replace rules by id; rules not in the request are kept (DELETE removes).","operationId":"put_rules_v1_rules_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RulesIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RulesWritten"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/rules/{rule_id}":{"delete":{"tags":["rules"],"summary":"Delete Rule","operationId":"delete_rule_v1_rules__rule_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/settings":{"get":{"tags":["rules"],"summary":"Get Tenant Settings","operationId":"get_tenant_settings_v1_settings_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettingsOut"}}}}},"security":[{"HTTPBearer":[]}]},"put":{"tags":["rules"],"summary":"Put Tenant Settings","operationId":"put_tenant_settings_v1_settings_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettingsIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettingsOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/usage":{"get":{"tags":["usage"],"summary":"Get Usage","description":"Default range: the current UTC month to date.","operationId":"get_usage_v1_usage_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"From"}},{"name":"to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"To"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageReport"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/labels":{"post":{"tags":["labels"],"summary":"Post Label","operationId":"post_label_v1_labels_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LabelRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LabelOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/webhooks":{"get":{"tags":["webhooks"],"summary":"List Webhooks","operationId":"list_webhooks_v1_webhooks_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhooksOut"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["webhooks"],"summary":"Create Webhook","operationId":"create_webhook_v1_webhooks_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookCreated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/webhooks/{endpoint_id}":{"delete":{"tags":["webhooks"],"summary":"Delete Webhook","operationId":"delete_webhook_v1_webhooks__endpoint_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","title":"Endpoint Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/webhooks/{endpoint_id}/rotate-secret":{"post":{"tags":["webhooks"],"summary":"Rotate Secret","description":"Immediate: pending retries are signed with the new secret from now on.","operationId":"rotate_secret_v1_webhooks__endpoint_id__rotate_secret_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","title":"Endpoint Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookCreated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/webhooks/{endpoint_id}/test":{"post":{"tags":["webhooks"],"summary":"Send Test","operationId":"send_test_v1_webhooks__endpoint_id__test_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","title":"Endpoint Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliveriesOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/webhooks/{endpoint_id}/deliveries":{"get":{"tags":["webhooks"],"summary":"List Deliveries","description":"Newest first, last 200 per endpoint, kept 14 days. ``status=dead`` is the DLQ.","operationId":"list_deliveries_v1_webhooks__endpoint_id__deliveries_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","title":"Endpoint Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"enum":["pending","delivered","dead","dropped"],"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliveriesOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/webhooks/deliveries/{delivery_id}/retry":{"post":{"tags":["webhooks"],"summary":"Retry Delivery","description":"Re-queue a dead (or delivered) delivery now, with a fresh retry budget.","operationId":"retry_delivery_v1_webhooks_deliveries__delivery_id__retry_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"delivery_id","in":"path","required":true,"schema":{"type":"string","title":"Delivery Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliveryOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/subjects/{subject_id}":{"delete":{"tags":["subjects"],"summary":"Erase Subject","operationId":"erase_subject_v1_subjects__subject_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"subject_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"title":"Subject Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErasureReceipt"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AutomationSignals":{"properties":{"webdriver":{"type":"boolean","title":"Webdriver","default":false},"headless":{"type":"boolean","title":"Headless","default":false},"automation_globals":{"type":"boolean","title":"Automation Globals","default":false}},"additionalProperties":false,"type":"object","title":"AutomationSignals","description":"Browser automation / emulator indicators the SDK reads client-side (spoofable: they\nraise risk when present, their absence proves nothing)."},"Decision":{"type":"string","enum":["approve","review","decline"],"title":"Decision"},"DeliveriesOut":{"properties":{"data":{"items":{"$ref":"#/components/schemas/DeliveryOut"},"type":"array","title":"Data"}},"type":"object","required":["data"],"title":"DeliveriesOut"},"DeliveryOut":{"properties":{"id":{"type":"string","title":"Id"},"endpoint_id":{"type":"string","title":"Endpoint Id"},"type":{"type":"string","title":"Type"},"event_id":{"type":"string","title":"Event Id"},"status":{"type":"string","enum":["pending","delivered","dead","dropped"],"title":"Status"},"attempts":{"type":"integer","title":"Attempts"},"last_status_code":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Last Status Code"},"last_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Error"},"next_attempt_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Next Attempt At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","endpoint_id","type","event_id","status","attempts","last_status_code","last_error","next_attempt_at","created_at","updated_at"],"title":"DeliveryOut"},"DeviceRequest":{"properties":{"visitor_id":{"type":"string","maxLength":128,"minLength":8,"title":"Visitor Id"},"confidence":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Confidence"},"collector":{"type":"string","pattern":"^[a-z0-9_.-]{1,32}$","title":"Collector"},"collector_version":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Collector Version"},"automation":{"$ref":"#/components/schemas/AutomationSignals"}},"additionalProperties":false,"type":"object","required":["visitor_id","collector"],"title":"DeviceRequest","description":"Body of ``POST /v1/device``, sent by ``@sentinel-mx/device`` from the browser.\nOnly the visitor ID and these few indicators are sent; raw fingerprint components stay\nin the browser."},"DeviceResponse":{"properties":{"device_id":{"type":"string","title":"Device Id"},"created":{"type":"boolean","title":"Created"},"first_seen_at":{"type":"string","format":"date-time","title":"First Seen At"}},"type":"object","required":["device_id","created","first_seen_at"],"title":"DeviceResponse"},"EntriesAdded":{"properties":{"added":{"type":"integer","title":"Added"},"duplicates":{"type":"integer","title":"Duplicates"},"lists_version":{"type":"integer","title":"Lists Version"}},"type":"object","required":["added","duplicates","lists_version"],"title":"EntriesAdded"},"EntriesIn":{"properties":{"values":{"anyOf":[{"items":{"$ref":"#/components/schemas/ValueEntryIn"},"type":"array","maxItems":1000},{"type":"null"}],"title":"Values"},"names":{"anyOf":[{"items":{"$ref":"#/components/schemas/NameEntryIn"},"type":"array","maxItems":1000},{"type":"null"}],"title":"Names"}},"type":"object","title":"EntriesIn","description":"Exactly one of ``values`` (values lists) or ``names`` (names lists)."},"EntriesPage":{"properties":{"data":{"items":{"$ref":"#/components/schemas/EntryOut"},"type":"array","title":"Data"},"next_after":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next After"}},"type":"object","required":["data"],"title":"EntriesPage"},"EntriesRemove":{"properties":{"values":{"items":{"type":"string"},"type":"array","maxItems":1000,"title":"Values","description":"values lists: raw values; names lists: external_id"},"entry_ids":{"items":{"type":"string"},"type":"array","maxItems":1000,"title":"Entry Ids"}},"type":"object","title":"EntriesRemove"},"EntriesRemoved":{"properties":{"removed":{"type":"integer","title":"Removed"},"lists_version":{"type":"integer","title":"Lists Version"}},"type":"object","required":["removed","lists_version"],"title":"EntriesRemoved"},"EntryOut":{"properties":{"id":{"type":"string","title":"Id"},"display":{"type":"string","title":"Display"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"},"data":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Data"},"created_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","display","note","created_by","created_at"],"title":"EntryOut"},"ErasureCounts":{"properties":{"events_unlinked":{"type":"integer","title":"Events Unlinked"},"labels_deleted":{"type":"integer","title":"Labels Deleted"},"device_links_deleted":{"type":"integer","title":"Device Links Deleted"},"case_rows_deleted":{"type":"integer","title":"Case Rows Deleted"},"velocity_sets_deleted":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Velocity Sets Deleted"}},"type":"object","required":["events_unlinked","labels_deleted","device_links_deleted","case_rows_deleted","velocity_sets_deleted"],"title":"ErasureCounts"},"ErasureReceipt":{"properties":{"erasure_id":{"type":"string","title":"Erasure Id"},"environment":{"type":"string","title":"Environment"},"erased_at":{"type":"string","format":"date-time","title":"Erased At"},"counts":{"$ref":"#/components/schemas/ErasureCounts"}},"type":"object","required":["erasure_id","environment","erased_at","counts"],"title":"ErasureReceipt"},"EventType":{"type":"string","enum":["signup","login","deposit","withdrawal","bet","bonus_claim","kyc","profile_update","custom"],"title":"EventType"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"KeyCreate":{"properties":{"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name"},"kind":{"type":"string","enum":["secret","publishable"],"title":"Kind","default":"secret"},"scopes":{"anyOf":[{"items":{"type":"string","enum":["score","screen","lists:read","lists:write","rules:read","rules:write","admin"]},"type":"array"},{"type":"null"}],"title":"Scopes","description":"secret keys; omitted = score + screen"},"allowed_origins":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":20},{"type":"null"}],"title":"Allowed Origins","description":"publishable keys: exact browser origins (scheme://host[:port], https; http only for localhost), e.g. https://casino.example"}},"type":"object","required":["name"],"title":"KeyCreate"},"KeyIssued":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"kind":{"type":"string","title":"Kind"},"environment":{"type":"string","title":"Environment"},"prefix":{"type":"string","title":"Prefix"},"scopes":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Scopes","description":"null = unrestricted (pre-scope key)"},"allowed_origins":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Allowed Origins"},"state":{"type":"string","enum":["active","rotating","expired","revoked"],"title":"State"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"revoked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Revoked At"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Used At"},"key":{"type":"string","title":"Key","description":"the full key; shown only in this response"}},"type":"object","required":["id","name","kind","environment","prefix","scopes","allowed_origins","state","created_at","expires_at","revoked_at","last_used_at","key"],"title":"KeyIssued"},"KeyOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"kind":{"type":"string","title":"Kind"},"environment":{"type":"string","title":"Environment"},"prefix":{"type":"string","title":"Prefix"},"scopes":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Scopes","description":"null = unrestricted (pre-scope key)"},"allowed_origins":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Allowed Origins"},"state":{"type":"string","enum":["active","rotating","expired","revoked"],"title":"State"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"revoked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Revoked At"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Used At"}},"type":"object","required":["id","name","kind","environment","prefix","scopes","allowed_origins","state","created_at","expires_at","revoked_at","last_used_at"],"title":"KeyOut"},"KeyRotate":{"properties":{"grace_hours":{"type":"number","maximum":168.0,"minimum":0.0,"title":"Grace Hours","description":"how long the old key keeps working","default":24}},"type":"object","title":"KeyRotate"},"KeysOut":{"properties":{"data":{"items":{"$ref":"#/components/schemas/KeyOut"},"type":"array","title":"Data"}},"type":"object","required":["data"],"title":"KeysOut"},"LabelOut":{"properties":{"id":{"type":"string","title":"Id"},"event_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Id"},"user_linked":{"type":"boolean","title":"User Linked","description":"the label is linked to a user (given or from the event)"},"label":{"type":"string","enum":["fraud","legit","chargeback","bonus_abuse","multi_account","ato","money_laundering","other"],"title":"Label"},"source":{"anyOf":[{"type":"string","enum":["manual_review","chargeback","customer_report","internal_rule"]},{"type":"null"}],"title":"Source"},"occurred_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Occurred At"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","event_id","user_linked","label","source","occurred_at","created_at"],"title":"LabelOut"},"LabelRequest":{"properties":{"event_id":{"anyOf":[{"type":"string","pattern":"^(evt|scr)_[0-9a-f]{24}$"},{"type":"null"}],"title":"Event Id"},"user_id":{"anyOf":[{"type":"string","maxLength":128,"minLength":1},{"type":"null"}],"title":"User Id"},"label":{"type":"string","enum":["fraud","legit","chargeback","bonus_abuse","multi_account","ato","money_laundering","other"],"title":"Label"},"source":{"anyOf":[{"type":"string","enum":["manual_review","chargeback","customer_report","internal_rule"]},{"type":"null"}],"title":"Source"},"occurred_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Occurred At"},"notes":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Notes","description":"free text; don't put personal data here"}},"type":"object","required":["label"],"title":"LabelRequest"},"ListCreate":{"properties":{"id":{"type":"string","pattern":"^[a-z0-9_]{1,64}$","title":"Id","description":"Used by rules: in_list <id>"},"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name"},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Description"},"type":{"type":"string","enum":["values","names"],"title":"Type"},"field":{"anyOf":[{"type":"string","enum":["email","email_domain","phone","ip","device_id","user_id","bin","clabe","curp","rfc","string"]},{"type":"null"}],"title":"Field","description":"values lists: identifier type"},"kind":{"anyOf":[{"type":"string","enum":["sanction","pep"]},{"type":"null"}],"title":"Kind","description":"names lists: sanction (e.g. UIF LPB) or pep"}},"type":"object","required":["id","name","type"],"title":"ListCreate"},"ListOut":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"type":{"type":"string","enum":["values","names"],"title":"Type"},"field":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Field"},"kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kind"},"entries":{"type":"integer","title":"Entries"},"stale_entries":{"type":"integer","title":"Stale Entries","description":"values entries hashed under a retired lists pepper; they no longer match until re-uploaded","default":0},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","name","description","type","field","kind","entries","created_at","updated_at"],"title":"ListOut"},"ListsOut":{"properties":{"data":{"items":{"$ref":"#/components/schemas/ListOut"},"type":"array","title":"Data"},"lists_version":{"type":"integer","title":"Lists Version"}},"type":"object","required":["data","lists_version"],"title":"ListsOut"},"NameEntryIn":{"properties":{"full_name":{"type":"string","maxLength":300,"minLength":1,"title":"Full Name"},"entity_type":{"type":"string","enum":["person","organization"],"title":"Entity Type","default":"person"},"date_of_birth":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Date Of Birth"},"birth_year":{"anyOf":[{"type":"integer","maximum":2100.0,"minimum":1900.0},{"type":"null"}],"title":"Birth Year","description":"if no full DOB"},"nationality":{"anyOf":[{"type":"string","maxLength":2,"minLength":2},{"type":"null"}],"title":"Nationality"},"curp":{"anyOf":[{"type":"string","pattern":"^[A-Z0-9]{18}$"},{"type":"null"}],"title":"Curp"},"rfc":{"anyOf":[{"type":"string","pattern":"^[A-ZÑ&]{3,4}[0-9]{6}[A-Z0-9]{3}$"},{"type":"null"}],"title":"Rfc"},"passport":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Passport"},"aliases":{"items":{"type":"string","maxLength":300},"type":"array","maxItems":50,"title":"Aliases"},"position":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}],"title":"Position"},"external_id":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"External Id","description":"Your reference (LPB folio, PEP source id)"},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Note"}},"type":"object","required":["full_name"],"title":"NameEntryIn"},"Person":{"properties":{"full_name":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}],"title":"Full Name"},"date_of_birth":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Date Of Birth"},"curp":{"anyOf":[{"type":"string","pattern":"^[A-Z0-9]{18}$"},{"type":"null"}],"title":"Curp"},"rfc":{"anyOf":[{"type":"string","pattern":"^[A-ZÑ&]{3,4}[0-9]{6}[A-Z0-9]{3}$"},{"type":"null"}],"title":"Rfc"},"nationality":{"anyOf":[{"type":"string","maxLength":2,"minLength":2},{"type":"null"}],"title":"Nationality"}},"type":"object","title":"Person"},"Reason":{"properties":{"code":{"type":"string","title":"Code"},"module":{"type":"string","title":"Module"},"weight":{"type":"integer","maximum":100.0,"minimum":0.0,"title":"Weight"},"description_es":{"type":"string","title":"Description Es"},"description_en":{"type":"string","title":"Description En"}},"type":"object","required":["code","module","weight","description_es","description_en"],"title":"Reason"},"RuleTriggered":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"action":{"type":"string","enum":["add_reason","set_weight","force_review","force_decline","force_approve"],"title":"Action"},"mode":{"type":"string","enum":["active","shadow"],"title":"Mode","default":"active"}},"type":"object","required":["id","name","action"],"title":"RuleTriggered"},"RulesIn":{"properties":{"rules":{"items":{"additionalProperties":true,"type":"object"},"type":"array","maxItems":500,"minItems":1,"title":"Rules"},"params":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Params"},"set":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Set","description":"pack param overrides"}},"type":"object","required":["rules"],"title":"RulesIn","description":"A plain rule list, or a parameterized pack (`params` + `{\"$param\": name}`) with\nper-tenant overrides in `set`."},"RulesOut":{"properties":{"ruleset_version":{"type":"integer","title":"Ruleset Version"},"data":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Data"}},"type":"object","required":["ruleset_version","data"],"title":"RulesOut"},"RulesWritten":{"properties":{"ruleset_version":{"type":"integer","title":"Ruleset Version"},"rules":{"type":"integer","title":"Rules","description":"rules in the request (unchanged ones are not rewritten)"}},"type":"object","required":["ruleset_version","rules"],"title":"RulesWritten"},"ScoreRequest":{"properties":{"event_type":{"$ref":"#/components/schemas/EventType"},"user_id":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"User Id"},"session_id":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Session Id"},"email":{"anyOf":[{"type":"string","maxLength":320},{"type":"null"}],"title":"Email"},"phone":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Phone"},"ip":{"anyOf":[{"type":"string","maxLength":45},{"type":"null"}],"title":"Ip"},"bin":{"anyOf":[{"type":"string","pattern":"^[0-9]{6,8}$"},{"type":"null"}],"title":"Bin"},"device_id":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Device Id"},"person":{"anyOf":[{"$ref":"#/components/schemas/Person"},{"type":"null"}]},"clabe":{"anyOf":[{"type":"string","pattern":"^[0-9]{18}$"},{"type":"null"}],"title":"Clabe"},"transaction":{"anyOf":[{"$ref":"#/components/schemas/Transaction"},{"type":"null"}]},"screen":{"type":"boolean","title":"Screen","default":false},"custom":{"additionalProperties":true,"type":"object","title":"Custom","description":"Free-form facts for rules: up to 50 keys, 3 levels deep, 8 KB as JSON"}},"type":"object","required":["event_type"],"title":"ScoreRequest"},"ScoreResponse":{"properties":{"id":{"type":"string","title":"Id"},"score":{"type":"integer","maximum":100.0,"minimum":0.0,"title":"Score","description":"Higher = riskier"},"decision":{"$ref":"#/components/schemas/Decision"},"reasons":{"items":{"$ref":"#/components/schemas/Reason"},"type":"array","title":"Reasons"},"signals":{"additionalProperties":{"$ref":"#/components/schemas/SignalResult"},"type":"object","title":"Signals"},"rules_triggered":{"items":{"$ref":"#/components/schemas/RuleTriggered"},"type":"array","title":"Rules Triggered"},"screening":{"$ref":"#/components/schemas/ScreeningResult"},"ruleset_version":{"type":"integer","title":"Ruleset Version","default":0},"latency_ms":{"type":"integer","title":"Latency Ms"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","score","decision","reasons","signals","latency_ms","created_at"],"title":"ScoreResponse"},"ScreenRequest":{"properties":{"full_name":{"type":"string","maxLength":300,"minLength":1,"title":"Full Name"},"entity_type":{"type":"string","enum":["person","organization"],"title":"Entity Type","default":"person"},"date_of_birth":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Date Of Birth"},"nationality":{"anyOf":[{"type":"string","maxLength":2,"minLength":2},{"type":"null"}],"title":"Nationality"},"curp":{"anyOf":[{"type":"string","pattern":"^[A-Z0-9]{18}$"},{"type":"null"}],"title":"Curp"},"rfc":{"anyOf":[{"type":"string","pattern":"^[A-ZÑ&]{3,4}[0-9]{6}[A-Z0-9]{3}$"},{"type":"null"}],"title":"Rfc"},"passport":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Passport"},"lists":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Lists","description":"Restrict to these list ids (default: all)"}},"type":"object","required":["full_name"],"title":"ScreenRequest","description":"POST /v1/screen: standalone sanctions/PEP screening (no fraud score)."},"ScreenResponse":{"properties":{"status":{"type":"string","enum":["not_requested","clear","potential_match","match","unavailable"],"title":"Status","default":"not_requested"},"hits":{"items":{"$ref":"#/components/schemas/ScreeningHit"},"type":"array","title":"Hits"},"lists_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lists Version"},"thresholds":{"anyOf":[{"$ref":"#/components/schemas/ScreeningThresholds"},{"type":"null"}]},"id":{"type":"string","title":"Id"},"latency_ms":{"type":"integer","title":"Latency Ms"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","latency_ms","created_at"],"title":"ScreenResponse"},"ScreeningBands":{"properties":{"potential_at":{"type":"number","title":"Potential At"},"match_at":{"type":"number","title":"Match At"}},"type":"object","required":["potential_at","match_at"],"title":"ScreeningBands"},"ScreeningHit":{"properties":{"list":{"type":"string","title":"List"},"kind":{"type":"string","enum":["sanction","pep"],"title":"Kind"},"entity_id":{"type":"string","title":"Entity Id"},"matched_name":{"type":"string","title":"Matched Name"},"score":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Score"},"explanation":{"items":{"type":"string"},"type":"array","title":"Explanation"}},"type":"object","required":["list","kind","entity_id","matched_name","score"],"title":"ScreeningHit"},"ScreeningResult":{"properties":{"status":{"type":"string","enum":["not_requested","clear","potential_match","match","unavailable"],"title":"Status","default":"not_requested"},"hits":{"items":{"$ref":"#/components/schemas/ScreeningHit"},"type":"array","title":"Hits"},"lists_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lists Version"},"thresholds":{"anyOf":[{"$ref":"#/components/schemas/ScreeningThresholds"},{"type":"null"}]}},"type":"object","title":"ScreeningResult"},"ScreeningThresholds":{"properties":{"potential_at":{"type":"number","maximum":1.0,"exclusiveMinimum":0.0,"title":"Potential At"},"match_at":{"type":"number","maximum":1.0,"exclusiveMinimum":0.0,"title":"Match At"}},"type":"object","required":["potential_at","match_at"],"title":"ScreeningThresholds","description":"Name-match bands a search was classified with: platform defaults or the tenant's."},"SettingsIn":{"properties":{"thresholds":{"anyOf":[{"$ref":"#/components/schemas/Thresholds"},{"type":"null"}]},"screening":{"anyOf":[{"$ref":"#/components/schemas/ScreeningBands"},{"type":"null"}]}},"type":"object","title":"SettingsIn","description":"Only the groups present are changed; `null` resets a group to platform defaults."},"SettingsOut":{"properties":{"thresholds":{"anyOf":[{"$ref":"#/components/schemas/Thresholds"},{"type":"null"}],"description":"null = platform defaults"},"screening":{"anyOf":[{"$ref":"#/components/schemas/ScreeningBands"},{"type":"null"}],"description":"null = platform defaults"},"defaults":{"additionalProperties":true,"type":"object","title":"Defaults"}},"type":"object","required":["thresholds","screening","defaults"],"title":"SettingsOut"},"SignalResult":{"properties":{"status":{"$ref":"#/components/schemas/SignalStatus"},"cached":{"type":"boolean","title":"Cached","default":false},"latency_ms":{"type":"integer","title":"Latency Ms","default":0},"mock":{"type":"boolean","title":"Mock","default":false},"facts":{"additionalProperties":true,"type":"object","title":"Facts"}},"type":"object","required":["status"],"title":"SignalResult"},"SignalStatus":{"type":"string","enum":["ok","skipped","timeout","error"],"title":"SignalStatus"},"Thresholds":{"properties":{"review":{"type":"integer","title":"Review"},"decline":{"type":"integer","title":"Decline"}},"type":"object","required":["review","decline"],"title":"Thresholds"},"Transaction":{"properties":{"amount":{"anyOf":[{"type":"string","pattern":"^\\d+(\\.\\d{1,4})?$"},{"type":"null"}],"title":"Amount"},"currency":{"type":"string","title":"Currency","default":"MXN"},"method":{"anyOf":[{"type":"string","enum":["card","spei","oxxo","codi","wallet","crypto","other"]},{"type":"null"}],"title":"Method"}},"type":"object","title":"Transaction"},"UsageCounts":{"properties":{"checks":{"type":"integer","title":"Checks","description":"billed calls: /v1/score + /v1/screen"},"events":{"additionalProperties":{"type":"integer"},"type":"object","title":"Events","description":"checks by kind: `score.<event_type>`, `screen`"},"modules":{"additionalProperties":{"type":"integer"},"type":"object","title":"Modules","description":"module calls (status ok, timeout or error)"}},"type":"object","required":["checks"],"title":"UsageCounts"},"UsageDay":{"properties":{"checks":{"type":"integer","title":"Checks","description":"billed calls: /v1/score + /v1/screen"},"events":{"additionalProperties":{"type":"integer"},"type":"object","title":"Events","description":"checks by kind: `score.<event_type>`, `screen`"},"modules":{"additionalProperties":{"type":"integer"},"type":"object","title":"Modules","description":"module calls (status ok, timeout or error)"},"day":{"type":"string","format":"date","title":"Day"},"source":{"type":"string","enum":["rollup","live"],"title":"Source"}},"type":"object","required":["checks","day","source"],"title":"UsageDay"},"UsageReport":{"properties":{"environment":{"type":"string","title":"Environment"},"from":{"type":"string","format":"date","title":"From"},"to":{"type":"string","format":"date","title":"To"},"timezone":{"type":"string","const":"UTC","title":"Timezone","default":"UTC"},"total":{"$ref":"#/components/schemas/UsageCounts"},"days":{"items":{"$ref":"#/components/schemas/UsageDay"},"type":"array","title":"Days"}},"type":"object","required":["environment","from","to","total","days"],"title":"UsageReport"},"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"},"ValueEntryIn":{"properties":{"value":{"type":"string","maxLength":320,"minLength":1,"title":"Value"},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Note"}},"type":"object","required":["value"],"title":"ValueEntryIn"},"WebhookCreate":{"properties":{"url":{"type":"string","maxLength":2048,"minLength":8,"title":"Url"},"events":{"anyOf":[{"items":{"type":"string","enum":["score.review","score.decline","screening.match","subject.erased","case.decided"]},"type":"array","minItems":1},{"type":"null"}],"title":"Events","description":"default: all subscribable events"},"description":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Description"}},"type":"object","required":["url"],"title":"WebhookCreate"},"WebhookCreated":{"properties":{"id":{"type":"string","title":"Id"},"url":{"type":"string","title":"Url"},"events":{"items":{"type":"string"},"type":"array","title":"Events"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"environment":{"type":"string","title":"Environment"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"rotated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Rotated At"},"secret":{"type":"string","title":"Secret","description":"Signing secret; shown only here and on rotate-secret"}},"type":"object","required":["id","url","events","description","environment","created_at","rotated_at","secret"],"title":"WebhookCreated"},"WebhookOut":{"properties":{"id":{"type":"string","title":"Id"},"url":{"type":"string","title":"Url"},"events":{"items":{"type":"string"},"type":"array","title":"Events"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"environment":{"type":"string","title":"Environment"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"rotated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Rotated At"}},"type":"object","required":["id","url","events","description","environment","created_at","rotated_at"],"title":"WebhookOut"},"WebhooksOut":{"properties":{"data":{"items":{"$ref":"#/components/schemas/WebhookOut"},"type":"array","title":"Data"}},"type":"object","required":["data"],"title":"WebhooksOut"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}}}