{"openapi":"3.0.3","externalDocs":{"url":"https://docs.castle.io/docs/","description":"Check out the Castle docs for more in-depth guides"},"info":{"version":"1","title":"Castle API","termsOfService":"https://castle.io/terms","x-logo":{"url":"https://reference.castle.io/assets/img/castle-logo-sidebar.png","altText":"Castle Logo"},"description":"## Introduction\n\n**Just getting started? Check out our [quick start guide](https://docs.castle.io/docs/quickstart)**\n\nCastle APIs uses standard HTTP response codes, authentication and verbs. JSON is used as data exchange format, both for parsing incoming request bodies, and in the returned response. This means that the `Content-Type` header should to be set to `application/json` in requests with a body, such as `POST` or `PUT`.\n\nAll API requests must be made over [HTTPS](http://en.wikipedia.org/wiki/HTTP_Secure). Non-HTTPS calls will fail and the **TLS version needs to be 1.1 or higher**.\n\n## Supported types\n\nFor a list of supported types, see our [Types Reference](https://docs.castle.io/docs/events).\n\n## Rate limits\n\nOur APIs implement rate-limiting based on the number of requests made to them. Each request will return the following headers:\n\n- `X-RateLimit-Limit` - The maximum number of requests you're permitted to make in the current time window.\n- `X-RateLimit-Remaining` - The number of requests remaining in the current time window.\n- `X-RateLimit-Reset` - The remaining time in seconds until the current time window resets.\n\nAdditionally, Our Risk, Filter (and the legacy Authenticate) APIs have a per-user-id rate limit of 6 requests per second and 10 requests per 5 seconds.\n"},"tags":[{"name":"risk_assessment","x-displayName":"Risk Assessment","description":"Castle Risk Assessment APIs will calculate a risk score as well as evaluate policies based on the provided payload.\nThe result can then be used to take the appropriate action, such as blocking the request or put the user through additional verification.\n\nAdditionally, the result will be logged together with the provided payload so it can be viewed and searched in the Castle Dashboard.\n"},{"name":"events","x-displayName":"Events","description":"Castle Events APIs allow you to query and aggregate Events that have been sent to the Castle [Risk Assessment APIs](#tag/risk_assessment).\n\n**These APIs are currently available only to select customers**. They are also subject to change.\nIf you are interested in using these APIs, please contact us at [support@castle.io](mailto:support@castle.io).\n\nPlease visit our [documentation page](https://docs.castle.io/docs/enterprise-using-events-api) to get a broader description of this suite of APIs.\n"},{"name":"privacy","x-displayName":"Privacy","description":"APIs intended to help adhere to GDPR Compliance and specifically assist in supporting Article 15: Right of access by the data subject and Article 17: Right to be forgotten.\n"},{"name":"lists","x-displayName":"Lists","description":"Lists represents a generic collection of items, such as Users, IPs, Transactions or any custom property. Lists helps you organize and collaborate cross team members and when used together with policies, they can effectively act as allow- or denylists.\n\nRead more about lists [here](https://docs.castle.io/docs/lists).\n"},{"name":"list_items","x-displayName":"List Items","description":"List Items represents entries in a List. Each value will correspond to the field definition in the associated List.\n"},{"name":"ip_intelligence","x-displayName":"IP Lookups","x-grape-file-path":"ips","description":"Look up Castle's IP intelligence data (address metadata + tunnel\nobservations) for a single IP or a batch.\n"},{"name":"intelligence_downloads","x-displayName":"IP Downloads","x-grape-file-path":"intel/exports/ips/proxies","description":"Download Castle's IP datasets.\n"}],"x-tagGroups":[{"name":"Event","tags":["risk_assessment"]},{"name":"Lists","tags":["lists","list_items"]},{"name":"Resources","tags":["events"]},{"name":"Privacy","tags":["privacy"]},{"name":"Intelligence","tags":["ip_intelligence","intelligence_downloads"]}],"servers":[{"url":"https://api.castle.io/v1","description":"Official Castle API domain"}],"security":[{"Basic":["secret"]}],"paths":{"/risk":{"post":{"summary":"Risk","description":"Used to request a risk evaluation from Castle's API. The most obvious use of this is for login requests, where the API can indicate malicious and questionable circumstances. Read more in the [Prevent Account Takeovers](https://docs.castle.io/docs/automate-account-recovery) section. See the [List of Recognized Events](https://docs.castle.io/docs/events) for supported events.\n","operationId":"risk","tags":["risk_assessment"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Risk"}}}},"responses":{"201":{"description":"Castle Event Context","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FilterAndRiskResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalServerError"}},"x-codeSamples":[{"lang":"Shell + Curl","source":"curl --request POST \\\n  --url https://api.castle.io/v1/risk \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH' \\\n  --header 'content-type: application/json' \\\n  --data '{\"context\":{\"headers\":[[\"User-Agent\",\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.1 Safari/605.1.15\"],[\"Accept-Encoding\",\"gzip, deflate, br\"],[\"Accept-Language\",\"en-us\"],[\"Accept\",\"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\"],[\"Connection\",\"close\"],[\"Host\",\"castle.io\"]],\"ip\":\"211.96.77.55\"},\"properties\":{\"property1\":{},\"property2\":{}},\"product\":{\"id\":\"string\"},\"session\":{\"id\":\"string\",\"created_at\":\"2019-08-24T14:15:22Z\"},\"created_at\":\"2019-08-24T14:15:22Z\",\"request_token\":\"test_lZWva9rsNe3u0_EIc6R8V3t5beV38piPAQbhgREGygYCAo2FRSv1tAQ4-cb6ArKHOWK_zG18hO1uZ8K0LDbNqU9njuhscoLyaj3NyGxyiO0iS4ziIkm-oVom3LEsN9i6InSbuzo-w7ErJqrkYW2CrjA23LEyN92wIkCE82dggvktPtWvMmrl42Bj2uM7Zdn2AQGXC6qGTIECRlwaAgZcgcAGeX4\",\"user\":{\"id\":\"string\",\"email\":\"string\",\"phone\":\"string\",\"registered_at\":\"2019-08-24T14:15:22Z\",\"name\":\"string\",\"traits\":{},\"address\":{\"line1\":\"60 Rausch Street\",\"line2\":\"string\",\"city\":\"San Francisco\",\"country_code\":\"US\",\"region_code\":\"CA\",\"postal_code\":\"94103\",\"fingerprint\":\"8a33j2lir9\"}},\"skip_request_token_validation\":false,\"skip_context_validation\":false,\"expand\":[\"all\"],\"type\":\"$challenge\",\"status\":\"$requested\",\"authentication_method\":{\"type\":\"$social\",\"variant\":\"facebook\"},\"challenge\":{\"trigger_event\":{\"type\":\"$challenge\",\"status\":\"$attempted\"}}}'"}]}},"/filter":{"post":{"summary":"Filter","description":"Used to block bots and bad traffic early in the request chain, typically at registration. Read more in the [Protecting the Login](https://docs.castle.io/docs/login-activity) section. See the [List of Recognized Events](https://docs.castle.io/docs/events) for supported events.\n\n**At minimum the `User-Agent` key is required in the `headers` object.**\n","operationId":"filter","tags":["risk_assessment"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Filter"}}}},"responses":{"201":{"description":"Castle Event Context","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FilterAndRiskResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"500":{"$ref":"#/components/responses/InternalServerError"}},"x-codeSamples":[{"lang":"Shell + Curl","source":"curl --request POST \\\n  --url https://api.castle.io/v1/filter \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH' \\\n  --header 'content-type: application/json' \\\n  --data '{\"context\":{\"headers\":[[\"User-Agent\",\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.1 Safari/605.1.15\"],[\"Accept-Encoding\",\"gzip, deflate, br\"],[\"Accept-Language\",\"en-us\"],[\"Accept\",\"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\"],[\"Connection\",\"close\"],[\"Host\",\"castle.io\"]],\"ip\":\"211.96.77.55\"},\"properties\":{\"property1\":{},\"property2\":{}},\"product\":{\"id\":\"string\"},\"session\":{\"id\":\"string\",\"created_at\":\"2019-08-24T14:15:22Z\"},\"created_at\":\"2019-08-24T14:15:22Z\",\"request_token\":\"test_lZWva9rsNe3u0_EIc6R8V3t5beV38piPAQbhgREGygYCAo2FRSv1tAQ4-cb6ArKHOWK_zG18hO1uZ8K0LDbNqU9njuhscoLyaj3NyGxyiO0iS4ziIkm-oVom3LEsN9i6InSbuzo-w7ErJqrkYW2CrjA23LEyN92wIkCE82dggvktPtWvMmrl42Bj2uM7Zdn2AQGXC6qGTIECRlwaAgZcgcAGeX4\",\"user\":{\"email\":\"Rhea.Franecki@example.org\",\"phone\":\"+16175551212\"},\"params\":{\"email\":\"Rhea.Franecki@example.org\",\"phone\":\"+16175551212\",\"username\":\"superhero123\"},\"matching_user_id\":\"123\",\"skip_request_token_validation\":false,\"skip_context_validation\":false,\"expand\":[\"all\"],\"type\":\"$registration\",\"status\":\"$attempted\",\"authentication_method\":{\"type\":\"$social\",\"variant\":\"facebook\"}}'"}]}},"/lists":{"post":{"summary":"Create a new List","operationId":"createList","x-rate-limit":{"limit":10,"period_in_seconds":1},"tags":["lists"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListRequest"}}}},"responses":{"201":{"description":"Returns the newly created List","content":{"application/json":{"schema":{"$ref":"#/components/schemas/List"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalServerError"}},"x-codeSamples":[{"lang":"Shell + Curl","source":"curl --request POST \\\n  --url https://api.castle.io/v1/lists \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH' \\\n  --header 'content-type: application/json' \\\n  --data '{\"name\":\"Malicious IPs\",\"description\":\"We block these IPs from withdrawing funds. Please be careful.\",\"color\":\"$red\",\"default_item_archivation_time\":2592000,\"primary_field\":\"device.fingerprint\",\"secondary_field\":\"ip.value\"}'"}]},"get":{"summary":"List all Lists","operationId":"getLists","x-rate-limit":{"limit":100,"period_in_seconds":1},"tags":["lists"],"responses":{"200":{"description":"Returns all active Lists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListList"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalServerError"}},"x-codeSamples":[{"lang":"Shell + Curl","source":"curl --request GET \\\n  --url https://api.castle.io/v1/lists \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH'"}]}},"/lists/{id}":{"put":{"summary":"Update a List","operationId":"updateList","x-rate-limit":{"limit":10,"period_in_seconds":1},"parameters":[{"name":"id","in":"path","description":"ID of the List","required":true,"schema":{"type":"string"},"example":"e6baae3a-0636-441a-ba4f-c73f266c7a17"}],"tags":["lists"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateListRequest"}}}},"responses":{"201":{"description":"Returns the updated List","content":{"application/json":{"schema":{"$ref":"#/components/schemas/List"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalServerError"}},"x-codeSamples":[{"lang":"Shell + Curl","source":"curl --request PUT \\\n  --url https://api.castle.io/v1/lists/e6baae3a-0636-441a-ba4f-c73f266c7a17 \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH' \\\n  --header 'content-type: application/json' \\\n  --data '{\"name\":\"Malicious IPs\",\"description\":\"We block these IPs from withdrawing funds. Please be careful.\",\"color\":\"$red\",\"default_item_archivation_time\":2592000}'"}]},"get":{"summary":"Return a List by ID","operationId":"getList","x-rate-limit":{"limit":100,"period_in_seconds":1},"parameters":[{"name":"id","in":"path","description":"ID of the List","required":true,"schema":{"type":"string"},"example":"e6baae3a-0636-441a-ba4f-c73f266c7a17"},{"name":"include_size","in":"query","description":"Whether to include the size in the response","schema":{"type":"boolean","example":true}}],"tags":["lists"],"responses":{"200":{"description":"Returns the List","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/List"},{"type":"object","properties":{"size":{"type":"integer","description":"List size capped at 100,000.","example":1024,"nullable":true}}}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalServerError"}},"x-codeSamples":[{"lang":"Shell + Curl","source":"curl --request GET \\\n  --url 'https://api.castle.io/v1/lists/e6baae3a-0636-441a-ba4f-c73f266c7a17?include_size=true' \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH'"}]},"delete":{"summary":"Delete List","operationId":"deleteList","x-rate-limit":{"limit":10,"period_in_seconds":1},"parameters":[{"name":"id","in":"path","description":"ID of the List","required":true,"schema":{"type":"string"},"example":"e6baae3a-0636-441a-ba4f-c73f266c7a17"}],"tags":["lists"],"responses":{"204":{"description":"Provides no response body"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalServerError"}},"x-codeSamples":[{"lang":"Shell + Curl","source":"curl --request DELETE \\\n  --url https://api.castle.io/v1/lists/e6baae3a-0636-441a-ba4f-c73f266c7a17 \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH'"}]}},"/lists/query":{"post":{"summary":"Search Lists","operationId":"queryLists","x-rate-limit":{"limit":30,"period_in_seconds":1},"tags":["lists"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListQuery"}}}},"responses":{"200":{"description":"Returns a list of all the Lists matching the query","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListQueryResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalServerError"}},"x-codeSamples":[{"lang":"Shell + Curl","source":"curl --request POST \\\n  --url https://api.castle.io/v1/lists/query \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH' \\\n  --header 'content-type: application/json' \\\n  --data '{\"filters\":[{\"field\":\"primary_field\",\"op\":\"$eq\",\"value\":\"device.fingerprint\"},{\"field\":\"archived\",\"op\":\"$eq\",\"value\":false},{\"op\":\"$or\",\"value\":[{\"field\":\"secondary_field\",\"op\":\"$eq\",\"value\":\"user.id\"}]},{\"op\":\"$or\",\"value\":[{\"field\":\"secondary_field\",\"op\":\"$eq\",\"value\":\"user.email\"}]}],\"page\":2,\"results_size\":50,\"include_size_label\":true,\"sort\":{\"field\":\"created_at\",\"order\":\"asc\"}}'"}]}},"/lists/{list_id}/items":{"post":{"summary":"Create a new List Item","parameters":[{"name":"list_id","in":"path","description":"ID of the List","required":true,"schema":{"type":"string"},"example":"e6baae3a-0636-441a-ba4f-c73f266c7a17"}],"operationId":"createListItem","x-rate-limit":{"limit":60,"period_in_seconds":1},"tags":["list_items"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListItemRequest"}}}},"responses":{"201":{"description":"Returns the newly created List Item","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListItem"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalServerError"}},"x-codeSamples":[{"lang":"Shell + Curl","source":"curl --request POST \\\n  --url https://api.castle.io/v1/lists/e6baae3a-0636-441a-ba4f-c73f266c7a17/items \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH' \\\n  --header 'content-type: application/json' \\\n  --data '{\"primary_value\":\"A04t7AcfSA69cBTTusx0RQ\",\"secondary_value\":\"2ee938c8-24c2-4c26-9d25-19511dd75029\",\"comment\":\"Fradulent user found through manual inspection\",\"author\":{\"type\":\"$analyst_email\",\"identifier\":\"string\"},\"auto_archives_at\":\"2021-09-27T16:46:38.313Z\",\"mode\":\"$error\"}'"}]}},"/lists/{list_id}/items/batch":{"post":{"summary":"Create or update multiple List Items","parameters":[{"name":"list_id","in":"path","description":"ID of the List","required":true,"schema":{"type":"string"},"example":"e6baae3a-0636-441a-ba4f-c73f266c7a17"}],"operationId":"createOrUpdateBatchListItems","x-rate-limit":{"limit":60,"period_in_seconds":1},"tags":["list_items"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListItemsBatchRequest","required":["items"],"example":{"items":[{"primary_value":"primary_value1","secondary_value":"secondary_value1","author":{"type":"$analyst_email","identifier":"analyst@example.com"}},{"primary_value":"primary_value2","secondary_value":"secondary_value2","author":{"type":"$analyst_email","identifier":"analyst@example.com"}}]}}}}},"responses":{"201":{"description":"Summary of processing results","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListItemsBatchResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalServerError"}},"x-codeSamples":[{"lang":"Shell + Curl","source":"curl --request POST \\\n  --url https://api.castle.io/v1/lists/e6baae3a-0636-441a-ba4f-c73f266c7a17/items/batch \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH' \\\n  --header 'content-type: application/json' \\\n  --data '{\"items\":[{\"primary_value\":\"A04t7AcfSA69cBTTusx0RQ\",\"secondary_value\":\"2ee938c8-24c2-4c26-9d25-19511dd75029\",\"comment\":\"Fradulent user found through manual inspection\",\"author\":{\"type\":\"$analyst_email\",\"identifier\":\"string\"},\"auto_archives_at\":\"2021-09-27T16:46:38.313Z\",\"mode\":\"$error\"}]}'"}]}},"/lists/{list_id}/items/query":{"post":{"summary":"Search List Items","parameters":[{"name":"list_id","in":"path","description":"ID of the List","required":true,"schema":{"type":"string"},"example":"e6baae3a-0636-441a-ba4f-c73f266c7a17"}],"operationId":"queryListItems","x-rate-limit":{"limit":30,"period_in_seconds":1},"tags":["list_items"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListItemQuery"}}}},"responses":{"200":{"description":"Returns a list of all the List Items matching the query","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListItemList"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalServerError"}},"x-codeSamples":[{"lang":"Shell + Curl","source":"curl --request POST \\\n  --url https://api.castle.io/v1/lists/e6baae3a-0636-441a-ba4f-c73f266c7a17/items/query \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH' \\\n  --header 'content-type: application/json' \\\n  --data '{\"page\":1,\"results_size\":50,\"sort\":{\"field\":\"created_at\",\"order\":\"asc\"},\"filters\":[{\"field\":\"archived\",\"op\":\"$eq\",\"value\":true}]}'"}]}},"/lists/{list_id}/items/count":{"post":{"summary":"Count List Items","parameters":[{"name":"list_id","in":"path","description":"ID of the List","required":true,"schema":{"type":"string"},"example":"e6baae3a-0636-441a-ba4f-c73f266c7a17"}],"operationId":"countListItems","x-rate-limit":{"limit":30,"period_in_seconds":1},"tags":["list_items"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListItemCount"}}}},"responses":{"200":{"description":"Returns a number of list items matching the query","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListItemListCount"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalServerError"}},"x-codeSamples":[{"lang":"Shell + Curl","source":"curl --request POST \\\n  --url https://api.castle.io/v1/lists/e6baae3a-0636-441a-ba4f-c73f266c7a17/items/count \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH' \\\n  --header 'content-type: application/json' \\\n  --data '{\"filters\":[{\"field\":\"primary_value\",\"op\":\"$eq\",\"value\":\"Uc80JFKRRvm\"},{\"field\":\"archived\",\"op\":\"$eq\",\"value\":false},{\"op\":\"$or\",\"value\":[{\"field\":\"secondary_value\",\"op\":\"$eq\",\"value\":\"1\"}]},{\"op\":\"$or\",\"value\":[{\"field\":\"secondary_value\",\"op\":\"$eq\",\"value\":\"2\"}]}]}'"}]}},"/lists/{list_id}/items/{id}":{"put":{"summary":"Update a List Item","operationId":"updateListItem","x-rate-limit":{"limit":60,"period_in_seconds":1},"parameters":[{"name":"list_id","in":"path","description":"ID of the List","required":true,"schema":{"type":"string"},"example":"e6baae3a-0636-441a-ba4f-c73f266c7a17"},{"name":"id","in":"path","description":"ID of the List Item","required":true,"schema":{"type":"string"},"example":"e6baae3a-0636-441a-ba4f-c73f266c7a17"}],"tags":["list_items"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateListItemRequest"}}}},"responses":{"201":{"description":"Returns the updated List Item","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListItem"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalServerError"}},"x-codeSamples":[{"lang":"Shell + Curl","source":"curl --request PUT \\\n  --url https://api.castle.io/v1/lists/e6baae3a-0636-441a-ba4f-c73f266c7a17/items/e6baae3a-0636-441a-ba4f-c73f266c7a17 \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH' \\\n  --header 'content-type: application/json' \\\n  --data '{\"comment\":\"Listed due to manual investigation\"}'"}]},"get":{"summary":"Fetch a List Item by ID","parameters":[{"name":"list_id","in":"path","description":"ID of the List","required":true,"schema":{"type":"string"},"example":"e6baae3a-0636-441a-ba4f-c73f266c7a17"},{"name":"id","in":"path","description":"ID of the List Item","required":true,"schema":{"type":"string"},"example":"e6baae3a-0636-441a-ba4f-c73f266c7a17"}],"operationId":"getListItem","x-rate-limit":{"limit":100,"period_in_seconds":1},"tags":["list_items"],"responses":{"200":{"description":"Returns the matching List Item","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListItem"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalServerError"}},"x-codeSamples":[{"lang":"Shell + Curl","source":"curl --request GET \\\n  --url https://api.castle.io/v1/lists/e6baae3a-0636-441a-ba4f-c73f266c7a17/items/e6baae3a-0636-441a-ba4f-c73f266c7a17 \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH'"}]}},"/lists/{list_id}/items/{id}/archive":{"delete":{"summary":"Archive a List Item","description":"Archives a List Item","parameters":[{"name":"list_id","in":"path","description":"ID of the List","required":true,"schema":{"type":"string"},"example":"e6baae3a-0636-441a-ba4f-c73f266c7a17"},{"name":"id","in":"path","description":"ID of the List Item","required":true,"schema":{"type":"string"},"example":"e6baae3a-0636-441a-ba4f-c73f266c7a17"}],"operationId":"archiveListItem","x-rate-limit":{"limit":30,"period_in_seconds":1},"tags":["list_items"],"responses":{"204":{"description":"Provides no response body"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalServerError"}},"x-codeSamples":[{"lang":"Shell + Curl","source":"curl --request DELETE \\\n  --url https://api.castle.io/v1/lists/e6baae3a-0636-441a-ba4f-c73f266c7a17/items/e6baae3a-0636-441a-ba4f-c73f266c7a17/archive \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH'"}]}},"/lists/{list_id}/items/{id}/unarchive":{"put":{"summary":"Unarchive a List Item","description":"Unarchives a List Item","parameters":[{"name":"list_id","in":"path","description":"ID of the List","required":true,"schema":{"type":"string"},"example":"e6baae3a-0636-441a-ba4f-c73f266c7a17"},{"name":"id","in":"path","description":"ID of the List Item","required":true,"schema":{"type":"string"},"example":"e6baae3a-0636-441a-ba4f-c73f266c7a17"}],"operationId":"unarchiveListItem","x-rate-limit":{"limit":30,"period_in_seconds":1},"tags":["list_items"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnarchiveListItemRequest"}}}},"responses":{"204":{"description":"Provides no response body"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalServerError"}},"x-codeSamples":[{"lang":"Shell + Curl","source":"curl --request PUT \\\n  --url https://api.castle.io/v1/lists/e6baae3a-0636-441a-ba4f-c73f266c7a17/items/e6baae3a-0636-441a-ba4f-c73f266c7a17/unarchive \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH' \\\n  --header 'content-type: application/json' \\\n  --data '{\"auto_archives_at\":\"2021-09-27T16:46:38.313Z\"}'"}]}},"/privacy/users/{id}":{"parameters":[{"name":"id","in":"path","description":"ID of the user","required":true,"schema":{"type":"string"},"example":"e6baae3a-0636-441a-ba4f-c73f266c7a17"}],"post":{"summary":"Request User Data","x-rate-limit":{"limit":10,"period_in_seconds":1},"description":"GDPR introduced [Article 15: Right of access by the data subject](https://gdpr-info.eu/art-15-gdpr/). This states that users have the right to request access to the data held on them. If you receive this request from your user, you may also need to forward the request to your vendors, such as Castle, so that the vendor can provide data related to this user as well.\nThis API endpoint is designed to be used for these User Data Access Requests.\n\n### **Important**: before you call this API you first need to [configure your company's privacy email](https://docs.castle.io/docs/gdpr-compliance#user-data-access-requests).\n\nWhen calling this endpoint, Castle will compile records pertaining to the associated user. When the data compilation is completed, an email containing a data download link will be sent to the configured privacy email address.\n","operationId":"getUserPrivacyDeprecated","deprecated":true,"tags":["privacy"],"responses":{"202":{"$ref":"#/components/responses/Accepted"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/InternalServerError"}},"x-codeSamples":[{"lang":"Shell + Curl","source":"curl --request POST \\\n  --url https://api.castle.io/v1/privacy/users/e6baae3a-0636-441a-ba4f-c73f266c7a17 \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH'"}]},"delete":{"summary":"Delete User Data","description":"GDPR introduced [Article 17: Right to be forgotten](https://gdpr-info.eu/art-17-gdpr/). This states that users have the right to request that all the data held on them be permanently purged. If you receive this request from your user, you may also need to forward the request to your vendors, such as Castle, so that the vendor can purge that user’s data too.\nThis API endpoint is designed to be used for these User Data Purge Requests. A call to this endpoint will permanently delete the user and their data from our systems.\n","operationId":"deleteUserPrivacyDeprecated","deprecated":true,"tags":["privacy"],"responses":{"202":{"$ref":"#/components/responses/Accepted"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/InternalServerError"}},"x-codeSamples":[{"lang":"Shell + Curl","source":"curl --request DELETE \\\n  --url https://api.castle.io/v1/privacy/users/e6baae3a-0636-441a-ba4f-c73f266c7a17 \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH'"}]}},"/privacy/users":{"post":{"summary":"Request User Data","x-rate-limit":{"limit":10,"period_in_seconds":1},"description":"GDPR introduced [Article 15: Right of access by the data subject](https://gdpr-info.eu/art-15-gdpr/). This states that users have the right to request access to the data held on them. If you receive this request from your user, you may also need to forward the request to your vendors, such as Castle, so that the vendor can provide data related to this user as well.\nThis API endpoint is designed to be used for these User Data Access Requests.\n\n### **Important**: before you call this API you first need to [configure your company's privacy email](https://docs.castle.io/docs/gdpr-compliance#user-data-access-requests).\n\nWhen calling this endpoint, Castle will compile records pertaining to the associated user. When the data compilation is completed, an email containing a data download link will be sent to the configured privacy email address.\n","operationId":"getUserPrivacy","tags":["privacy"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrivacyRequest"}}}},"responses":{"202":{"$ref":"#/components/responses/Accepted"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/InternalServerError"}},"x-codeSamples":[{"lang":"Shell + Curl","source":"curl --request POST \\\n  --url https://api.castle.io/v1/privacy/users \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH' \\\n  --header 'content-type: application/json' \\\n  --data '{\"identifier\":\"Rhea.Franecki@example.org\",\"identifier_type\":\"$email\"}'"}]},"delete":{"summary":"Delete User Data","description":"GDPR introduced [Article 17: Right to be forgotten](https://gdpr-info.eu/art-17-gdpr/). This states that users have the right to request that all the data held on them be permanently purged. If you receive this request from your user, you may also need to forward the request to your vendors, such as Castle, so that the vendor can purge that user’s data too.\nThis API endpoint is designed to be used for these User Data Purge Requests. A call to this endpoint will permanently delete the user and their data from our systems.\n","operationId":"deleteUserPrivacy","tags":["privacy"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrivacyRequest"}}}},"responses":{"202":{"$ref":"#/components/responses/Accepted"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/InternalServerError"}},"x-codeSamples":[{"lang":"Shell + Curl","source":"curl --request DELETE \\\n  --url https://api.castle.io/v1/privacy/users \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH' \\\n  --header 'content-type: application/json' \\\n  --data '{\"identifier\":\"Rhea.Franecki@example.org\",\"identifier_type\":\"$email\"}'"}]}},"/events/query":{"post":{"summary":"Search Events","description":"Search for events\n","operationId":"queryEvents","x-semaphore":{"limit":5,"id":"events-api","allow":"internal"},"tags":["events"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Query"}},"text/csv":{"schema":{"$ref":"#/components/schemas/Query"}}}},"responses":{"200":{"description":"Returns the events that match the search criteria","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Events"}},"text/csv":{"schema":{"$ref":"#/components/schemas/Events"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"500":{"$ref":"#/components/responses/InternalServerError"}},"x-codeSamples":[{"lang":"Shell + Curl","source":"curl --request POST \\\n  --url https://api.castle.io/v1/events/query \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH' \\\n  --header 'content-type: text/csv' \\\n  --data '{\"filters\":[{\"field\":\"string\",\"op\":\"$eq\",\"value\":\"Rhea\"}],\"query_type\":\"$count\",\"page\":1,\"aggregations\":[{\"name\":\"Critical Events per IP in 1h\",\"description\":\"Maximum Account TakeOver score seen per IP in the last day.\",\"interval\":86400,\"group_by\":{\"fields\":[{\"field\":\"ip.address\"}]},\"filters\":[{\"field\":\"string\",\"op\":\"$eq\",\"value\":\"Rhea\"}],\"value\":{\"field\":\"scores.account_takeover.score\"},\"aggregation_type\":\"$avg\",\"metadata\":{\"whodunnit\":\"string\",\"whodunnit_type\":\"$analyst_email\",\"property1\":\"string\",\"property2\":\"string\"}}],\"formulas\":[{\"name\":\"string\",\"value\":\"string\"}],\"columns\":[\"string\"],\"results_size\":1}'"}]}},"/events/schema":{"get":{"summary":"Get Events Schema","description":"Get schema for the Event object. Returns all fields with their respective descriptions, types and allowed funcs and operations.\n","operationId":"getEventSchema","tags":["events"],"responses":{"200":{"description":"Returns the list of fields and buckets data to be used when requesting v1/events/query or v1/events/count","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchSchema"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/InternalServerError"}},"x-codeSamples":[{"lang":"Shell + Curl","source":"curl --request GET \\\n  --url https://api.castle.io/v1/events/schema \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH'"}]}},"/events/group":{"post":{"summary":"Group Events","description":"Aggregate on events\n","operationId":"groupEvents","x-semaphore":{"limit":5,"id":"events-api","allow":"internal"},"tags":["events"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupQuery"}}}},"responses":{"200":{"description":"Returns the aggregation filtered by the filtered query","content":{"application/json":{"schema":{"type":"object","description":"Results set of what the request query is. Includes group columns and all columns from the request","required":["total_count","data"],"properties":{"data":{"type":"array","items":{"type":"object"},"example":[{"user.id":"castle_user","Max Risk":0.111,"email":"test@test.com"},{"user.id":"castle_user1","Max Risk":0.411,"email":"test1@test.com"},{"user.id":"castle_user2","Max Risk":0.611,"email":"test2@test.com"},{"user.id":"castle_user3","Max Risk":0.931,"email":"test3@test.com"},{"user.id":"castle_user4","Max Risk":0.913,"email":"test4@test.com"}]},"total_count":{"type":"integer","minimum":0,"example":1}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"500":{"$ref":"#/components/responses/InternalServerError"}},"x-codeSamples":[{"lang":"Shell + Curl","source":"curl --request POST \\\n  --url https://api.castle.io/v1/events/group \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH' \\\n  --header 'content-type: application/json' \\\n  --data '{\"filters\":[{\"field\":\"string\",\"op\":\"$eq\",\"value\":\"Rhea\"}],\"query_type\":\"$count\",\"page\":1,\"aggregations\":[{\"name\":\"Critical Events per IP in 1h\",\"description\":\"Maximum Account TakeOver score seen per IP in the last day.\",\"interval\":86400,\"group_by\":{\"fields\":[{\"field\":\"ip.address\"}]},\"filters\":[{\"field\":\"string\",\"op\":\"$eq\",\"value\":\"Rhea\"}],\"value\":{\"field\":\"scores.account_takeover.score\"},\"aggregation_type\":\"$avg\",\"metadata\":{\"whodunnit\":\"string\",\"whodunnit_type\":\"$analyst_email\",\"property1\":\"string\",\"property2\":\"string\"}}],\"formulas\":[{\"name\":\"string\",\"value\":\"string\"}],\"group_by\":{\"fields\":[{\"field\":\"string\",\"transform\":{\"transform\":\"$to_start_of_interval\",\"options\":{}}}],\"filters\":[{\"field\":\"string\",\"op\":\"$eq\",\"value\":\"Rhea\"}]},\"columns\":[{\"field\":\"string\",\"transform\":{\"transform\":\"$to_start_of_interval\",\"options\":{}},\"name\":\"Sum of Risk\",\"func\":\"$sum\",\"options\":{}}],\"having\":[{\"field\":\"string\",\"op\":\"$eq\",\"value\":\"Rhea\",\"transform\":{\"transform\":\"$to_start_of_interval\",\"options\":{}},\"func\":\"$sum\",\"options\":{}}],\"sort\":{\"field\":\"string\",\"transform\":{\"transform\":\"$to_start_of_interval\",\"options\":{}},\"func\":\"$sum\",\"options\":{},\"order\":\"asc\"},\"results_size\":1}'"}]}},"/ips/{value}":{"get":{"summary":"Look up a single IP","description":"Returns Castle's IP intelligence record for a single IP address: address\nmetadata (family, ASN, coarse geolocation) plus the list of tunnel\nobservations Castle has recorded for it.\n","operationId":"ipsLookupSingle","tags":["ip_intelligence"],"x-credit-cost":{"amount":1},"parameters":[{"name":"value","in":"path","description":"IP address to look up. IPv4 or IPv6. IPv6 addresses must be URL-encoded\nby the client when required by the HTTP library.\n","required":true,"schema":{"type":"string"},"example":"203.0.113.42"}],"responses":{"200":{"description":"IP intelligence record.","content":{"application/json":{"schema":{"type":"object","description":"IP intelligence record: address metadata plus the list of tunnel\nobservations Castle has recorded for it.\n","example":{"address":"203.0.113.42","type":"ipv4","asn":64500,"location":{"continent_code":"EU","country_code":"DE"},"tunnels":[{"type":"vpn","operator":"NordVPN","tier":"commercial","last_seen_at":"2026-07-01T14:23:00Z","proxy_type":null}]},"properties":{"address":{"type":"string","description":"The queried IP address (IPv4 or IPv6).","example":"203.0.113.42"},"type":{"type":"string","enum":["ipv4","ipv6"],"description":"Address family of the queried IP.","example":"ipv4"},"asn":{"type":"integer","nullable":true,"description":"Autonomous system number this IP is announced from. `null` when the\nannouncement is not resolvable.\n","example":64500},"location":{"type":"object","description":"Coarse geolocation of the IP.","properties":{"continent_code":{"type":"string","nullable":true,"description":"Two-letter continent code.","example":"EU"},"country_code":{"type":"string","nullable":true,"description":"ISO 3166-1 alpha-2 country code.","example":"DE"}}},"tunnels":{"type":"array","description":"Tunnel observations for this IP, filtered to entries with a known\noperator. Empty when Castle has no tunnel data for the IP.\n","items":{"type":"object","description":"A tunnel observation attached to an IP: which operator's network the IP\nis part of, at what tier, and when it was last seen.\n","example":{"type":"vpn","operator":"NordVPN","tier":"commercial","last_seen_at":"2026-07-01T14:23:00Z","proxy_type":null},"properties":{"type":{"type":"string","enum":["vpn","proxy","relay","tor"],"description":"Tunnel classification.","example":"vpn"},"operator":{"type":"string","description":"Operator name (e.g. `NordVPN`, `Zscaler`).","example":"NordVPN"},"tier":{"type":"string","nullable":true,"enum":["free","commercial","enterprise"],"description":"Operator tier.","example":"commercial"},"last_seen_at":{"type":"string","format":"date-time","description":"Most recent observation of this IP under this tunnel, in ISO 8601.","example":"2026-07-01T14:23:00Z"},"proxy_type":{"type":"string","nullable":true,"enum":["residential","datacenter","isp"],"description":"Proxy network type. Present when `type` is `proxy`; otherwise `null`.","example":null}},"required":["type","operator","last_seen_at"]}}},"required":["address","type","asn","location","tunnels"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalServerError"}},"x-codeSamples":[{"lang":"Shell + Curl","source":"curl --request GET \\\n  --url https://api.castle.io/v1/ips/203.0.113.42 \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH'"}]}},"/ips/query":{"post":{"summary":"Look up IPs in a batch","description":"Batch equivalent of `GET /v1/ips/{value}`. Accepts 1-1000 IP addresses,\nsilently deduplicates and drops unparseable inputs, and returns one\nintelligence record per valid, unique input. `meta.total` and `meta.valid`\nlet callers detect input hygiene issues.\n","operationId":"ipsLookupBatch","tags":["ip_intelligence"],"x-credit-cost":{"amount":1},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ips":{"type":"array","description":"1-1000 IP addresses to look up. Duplicates and unparseable entries are silently dropped before processing.","items":{"type":"string"},"minItems":1,"maxItems":1000,"example":["203.0.113.42","198.51.100.7"]}},"required":["ips"]}}}},"responses":{"200":{"description":"Batch results plus dedup/validity counters.","content":{"application/json":{"schema":{"type":"object","description":"Batch response from `POST /v1/ips/query`. `results` matches only the valid,\ndeduplicated inputs; `meta.total` reports the submitted count so callers\ncan detect input hygiene issues.\n","example":{"results":[{"address":"203.0.113.42","type":"ipv4","asn":64500,"location":{"continent_code":"EU","country_code":"DE"},"tunnels":[{"type":"vpn","operator":"NordVPN","tier":"commercial","last_seen_at":"2026-07-01T14:23:00Z","proxy_type":null}]}],"meta":{"total":2,"valid":1}},"properties":{"results":{"type":"array","description":"One entry per valid, unique input IP.","items":{"$ref":"#/paths/~1ips~1{value}/get/responses/200/content/application~1json/schema"}},"meta":{"type":"object","description":"Counters describing how a batch was processed. `total` is the raw count\nthe caller submitted; `valid` is the count after dedup and IP-address\nvalidation. `results.length == meta.valid`. When `valid < total`, some\ninputs were duplicates or not parseable.\n","required":["total","valid"],"properties":{"total":{"type":"integer","description":"Number of IPs submitted before de-duplication and validation.","example":100},"valid":{"type":"integer","description":"Number of unique, valid IPs processed.","example":97}}}},"required":["results","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalServerError"}},"x-codeSamples":[{"lang":"Shell + Curl","source":"curl --request POST \\\n  --url https://api.castle.io/v1/ips/query \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH' \\\n  --header 'content-type: application/json' \\\n  --data '{\"ips\":[\"203.0.113.42\",\"198.51.100.7\"]}'"}]}},"/ips/downloads/{dataset}/{window}.{format}.gz":{"parameters":[{"name":"dataset","in":"path","description":"Dataset name.","required":true,"schema":{"type":"string","enum":["proxies"]},"example":"proxies"},{"name":"window","in":"path","description":"Observation window included in the download.","required":true,"schema":{"type":"string","enum":["1d","7d","30d","60d"]},"example":"60d"},{"name":"format","in":"path","description":"Download file format.","required":true,"schema":{"type":"string","enum":["jsonl","csv"]},"example":"jsonl"}],"head":{"summary":"IP Dataset Download metadata","description":"Returns metadata for the latest file as response headers, including generation time.","operationId":"getLatestIpDatasetExportMetadata","x-grape-operation-name":"latest_ip_proxies_metadata","tags":["intelligence_downloads"],"responses":{"200":{"description":"Returns download metadata headers.","headers":{"Last-Modified":{"description":"Download generation timestamp in RFC 7232 HTTP date format.","schema":{"type":"string"}},"X-Snapshot-Generated-At":{"description":"Download generation timestamp (ISO 8601).","schema":{"type":"string","format":"date-time"}},"X-Snapshot-Expires-At":{"description":"Timestamp after which the download is no longer available (ISO 8601).","schema":{"type":"string","format":"date-time"}},"X-Snapshot-Row-Count":{"description":"Number of records in the download.","schema":{"type":"integer"}},"X-Snapshot-Byte-Size":{"description":"Download artifact size in bytes.","schema":{"type":"integer"}},"X-Snapshot-Checksum":{"description":"SHA-256 checksum of the download artifact.","schema":{"type":"string"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalServerError"}},"x-codeSamples":[{"lang":"Shell + Curl","source":"curl --request HEAD \\\n  --url https://api.castle.io/v1/ips/downloads/proxies/60d.jsonl.gz \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH'"}]},"get":{"summary":"IP Dataset Download","description":"Returns a `302` redirect to a presigned URL for the gzip-compressed IP dataset download.\n\nThe presigned URL includes a `Content-Disposition` header so the downloaded file has a\nmeaningful name (e.g. `proxies-7d.jsonl.gz`).\n","operationId":"downloadIpDatasetExport","x-grape-operation-name":"latest_ip_proxies","tags":["intelligence_downloads"],"responses":{"302":{"description":"Redirects to the presigned download URL.","headers":{"Location":{"description":"Presigned URL for the gzip-compressed download artifact.","schema":{"type":"string","format":"uri"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalServerError"}},"x-codeSamples":[{"lang":"Shell + Curl","source":"curl --request GET \\\n  --url https://api.castle.io/v1/ips/downloads/proxies/60d.jsonl.gz \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH'"}]}}},"components":{"schemas":{"Address":{"type":"object","required":["country_code"],"properties":{"line1":{"type":"string","nullable":true,"maxLength":255,"example":"60 Rausch Street"},"line2":{"type":"string","maxLength":255,"nullable":true},"city":{"type":"string","description":"Name of the city associated to this address.","maxLength":255,"nullable":true,"example":"San Francisco"},"country_code":{"type":"string","maxLength":3,"description":"ISO-3166 country code","nullable":true,"example":"US"},"region_code":{"type":"string","maxLength":255,"description":"ISO region code","nullable":true,"example":"CA"},"postal_code":{"type":"string","maxLength":255,"nullable":true,"example":"94103"},"fingerprint":{"type":"string","maxLength":255,"nullable":true,"example":"8a33j2lir9"}}},"Agent":{"type":"object","readOnly":true,"description":"AI agent identified for this event/context. Omitted when no agent is identified","required":["name","operator","category","identified_by"],"properties":{"name":{"type":"string","description":"Agent display name.","example":"ChatGPT agent"},"operator":{"type":"string","description":"Operator identifier (e.g. `openai`).","example":"openai"},"category":{"type":"string","description":"Agent category.","enum":["ai_agent","browser_automation","ai_browser"],"example":"ai_agent"},"identified_by":{"type":"array","description":"Methods that identified the agent, in order of precedence.","minItems":1,"uniqueItems":true,"items":{"type":"string","enum":["web_bot_auth","fingerprint","user_agent"]},"example":["web_bot_auth"]}}},"AuthenticationMethod":{"type":"object","required":["type"],"example":{"type":"$social","variant":"facebook"},"properties":{"type":{"$ref":"#/components/schemas/AuthenticationMethodType"},"variant":{"type":"string","maxLength":128},"email":{"type":"string","format":"idn-email","description":"Used when `type` is `$email`"},"phone":{"type":"string","format":"E.164","description":"Used when `type` is `$phone`"}}},"AuthenticationMethodType":{"type":"string","enum":["$authenticator","$biometrics","$document","$electronic_id","$email","$kba","$passkey","$password","$payment","$phone","$physical_id","$pop","$push","$security_key","$social","$sso","$video","$other"],"x-enumDescriptions":{"$authenticator":"One time password, e.g. Google Authenticator.","$biometrics":"Apple FaceID/TouchID, Microsoft Hello, etc.","$document":"E.g. utility bill, bank statement, or proof of address.","$electronic_id":"Some countries have general eID in place while others integrate eVoting, eTax, eHealth and even public transport ticketing functionality. e.g. Swedish BankID, Danish NemID etc.","$email":"The individual is asked to provide an email address. You send a confirmation link or PIN code.","$kba":"A shared secret, for instance the user's mother's maiden name or favorite color.","$passkey":"Passwordless authentication with Passkey.","$password":"Password based authentication.","$payment":"Payment method verification, e.g. Stripe, Plaid, ACH.","$phone":"The individual is asked to provide a phone number. You send a confirmation PIN code over SMS or phone call.","$physical_id":"The individual is asked to submit a government ID such as a driver license, national ID, or passport.","$pop":"Proof-of-Personhood verification methods, e.g. WorldID, BrightID, Gitcoin Passport, Sismo, Civic, Idena.","$push":"E.g. mobile push notification","$security_key":"E.g. Yubikey, Google Titan","$social":"Authenticate in with Google, Facebook, Apple, etc.","$sso":"Authenticate via SAML, OpenID, e.g. Okta or Rippling","$video":"E.g. video call with support person","$other":"Any other authentication method not defined as a default type."}},"AuthorType":{"type":"string","enum":["$analyst_email","$castle_agent","$castle_dashboard_user","$castle_policy","$user","$user_email","$other"]},"Changeset":{"type":"object","description":"An object containing information about attributes that changed due to the event. You can send either anonymous attributes (eg. to track password changes) or full attributes (eg. email changes). To simplify your implementation, Castle *automatically* tracks changes to name, email, and phone, however, if you have the `from` and `to` values at hand, you can also send the changeset yourself, which also allows you to specify changes a user’s password as well as any other custom attributes. Changes to custom attributes won’t be searchable in the dashboard, but they will appear in the event stream.","maxProperties":10,"properties":{"password":{"description":"Information that the password changed. Send this as `{ \"password\": { \"changed\": true } }`","$ref":"#/components/schemas/ChangedChangesetEntry"},"email":{"description":"Email address change. You can also inform Castle that the email changed without sending the values explicitly: `{ \"email\": { \"changed\": true } }`","x-model-names":["ChangesetEntry","ChangedChangesetEntry"],"oneOf":[{"$ref":"#/components/schemas/ChangedChangesetEntry"},{"type":"object","required":["from","to"],"properties":{"from":{"type":"string","description":"Attribute value before the event."},"to":{"type":"string","nullable":true,"description":"Attribute value after the event."}}}]},"phone":{"description":"Phone number change. You can also inform Castle that the phone changed without sending the values explicitly: `{ \"phone\": { \"changed\": true } }`","x-model-names":["ChangesetEntry","ChangedChangesetEntry"],"oneOf":[{"$ref":"#/components/schemas/ChangedChangesetEntry"},{"type":"object","required":["from","to"],"properties":{"from":{"type":"string","nullable":true,"description":"Attribute value before the event."},"to":{"type":"string","nullable":true,"description":"Attribute value after the event."}}}]},"authentication_method.type":{"x-model-names":["ChangesetEntry","ChangedChangesetEntry"],"oneOf":[{"$ref":"#/components/schemas/ChangedChangesetEntry"},{"type":"object","description":"Change to MFA method. Both from and to can be null.","properties":{"from":{"$ref":"#/components/schemas/AuthenticationMethodType"},"to":{"$ref":"#/components/schemas/AuthenticationMethodType"}}}]},"name":{"x-model-names":["ChangesetEntry","ChangedChangesetEntry"],"oneOf":[{"$ref":"#/components/schemas/ChangedChangesetEntry"},{"$ref":"#/components/schemas/ChangesetEntry"}]}},"additionalProperties":{"x-model-names":["ChangesetEntry","ChangedChangesetEntry"],"oneOf":[{"$ref":"#/components/schemas/ChangesetEntry"},{"$ref":"#/components/schemas/ChangedChangesetEntry"}]},"example":[{"password":{"changed":true},"email":{"from":"before@exmaple.com","to":"after@example.com"},"authentication_method.type":{"from":"$authenticator","to":"$email"},"name":{"from":null,"to":"John Snow"}}]},"ChangesetEntry":{"description":"Information that the attribute changed along with the changed values. Examples: `{ \"email\": { \"from\": \"a@example.com\", \"to\": \"b@example.com\" }`, `{ \"authentication_method.type\": { \"from\": null, \"to\": \"$push\" }`","type":"object","required":["from","to"],"properties":{"from":{"type":"string","nullable":true,"description":"Attribute value before the event","maxLength":255},"to":{"type":"string","nullable":true,"description":"Attribute value after the event","maxLength":255}}},"ChangedChangesetEntry":{"description":"Information that the attribute changed along with the changed values. Examples: `{ \"password\": { \"changed\": true } }`","type":"object","required":["changed"],"properties":{"changed":{"type":"boolean","enum":[true]}}},"Challenge":{"type":"object","description":"Challenge object containing information about the event that triggered this challenge","required":["trigger_event"],"properties":{"trigger_event":{"$ref":"#/components/schemas/ChallengeTriggerEvent"}}},"ChallengeTriggerEvent":{"type":"object","description":"The event that triggered this challenge","oneOf":[{"$ref":"#/components/schemas/ChallengeTriggerEventStandard"},{"$ref":"#/components/schemas/ChallengeTriggerEventCustom"}],"discriminator":{"propertyName":"type","mapping":{"$challenge":"#/components/schemas/ChallengeTriggerEventStandard","$login":"#/components/schemas/ChallengeTriggerEventStandard","$logout":"#/components/schemas/ChallengeTriggerEventStandard","$password_reset_request":"#/components/schemas/ChallengeTriggerEventStandard","$profile_reset":"#/components/schemas/ChallengeTriggerEventStandard","$profile_update":"#/components/schemas/ChallengeTriggerEventStandard","$registration":"#/components/schemas/ChallengeTriggerEventStandard","$transaction":"#/components/schemas/ChallengeTriggerEventStandard","$custom":"#/components/schemas/ChallengeTriggerEventCustom"}}},"ChallengeTriggerEventCustom":{"type":"object","description":"Custom event that triggered a challenge","required":["type","status","name"],"properties":{"type":{"type":"string","description":"Type of event that triggered the challenge","enum":["$custom"]},"status":{"type":"string","description":"Status of the triggering event","enum":["$attempted","$succeeded","$failed"]},"name":{"type":"string","description":"Name of the custom event","maxLength":255}}},"ChallengeTriggerEventStandard":{"type":"object","description":"Standard event type that triggered a challenge","required":["type","status"],"properties":{"type":{"type":"string","description":"Type of event that triggered the challenge","enum":["$challenge","$login","$logout","$password_reset_request","$profile_reset","$profile_update","$registration","$transaction"]},"status":{"type":"string","description":"Status of the triggering event","enum":["$attempted","$succeeded","$failed"]}}},"Coordinates":{"type":"object","required":["lat","lon"],"properties":{"lat":{"type":"number","description":"Latitude coordinate","minimum":-90,"maximum":90},"lon":{"type":"number","description":"Longitude coordinate","minimum":-180,"maximum":180}}},"OrQueryFilter":{"type":"object","required":["value","op"],"properties":{"op":{"type":"string","enum":["$or"],"example":"$or"},"value":{"type":"array","x-discriminator-field":"op","minItems":1,"items":{"type":"object","x-model-names":["QueryFilter","RangeQueryFilter","RelativeRangeQueryFilter","ExistsQueryFilter","ArrayMatchQueryFilter"],"oneOf":[{"$ref":"#/components/schemas/QueryFilter"},{"$ref":"#/components/schemas/RangeQueryFilter"},{"$ref":"#/components/schemas/RelativeRangeQueryFilter"},{"$ref":"#/components/schemas/ExistsQueryFilter"},{"$ref":"#/components/schemas/ArrayMatchQueryFilter"}]}}}},"ArrayMatchQueryFilter":{"type":"object","required":["field","op","value"],"description":"Matches against elements of an array field whose items are tuples with named\nsubfields (e.g. `ip.tunnels` with subfields like `operator`, `last_seen_at`).\n\n- `$array_match_any` — at least one element satisfies all sub-clauses.\n- `$array_match_all` — every element satisfies all sub-clauses.\n- `$narray_match_any` — no element satisfies all sub-clauses (negation of `$array_match_any`).\n- `$narray_match_all` — at least one element fails to satisfy all sub-clauses (negation of `$array_match_all`).\n\nEach sub-clause targets a tuple subfield and is validated as if it were a\ntop-level filter against that subfield — the subfield's declared\n`operations` whitelist, value type, and enum membership all apply.\n","properties":{"field":{"type":"string","description":"Name of the array field to match against.","example":"ip.tunnels"},"op":{"type":"string","enum":["$array_match_any","$array_match_all","$narray_match_any","$narray_match_all"],"example":"$array_match_any"},"value":{"type":"array","minItems":1,"maxItems":100,"x-discriminator-field":"op","items":{"type":"object","x-model-names":["QueryFilter","RangeQueryFilter","RelativeRangeQueryFilter","ExistsQueryFilter"],"oneOf":[{"$ref":"#/components/schemas/QueryFilter"},{"$ref":"#/components/schemas/RangeQueryFilter"},{"$ref":"#/components/schemas/RelativeRangeQueryFilter"},{"$ref":"#/components/schemas/ExistsQueryFilter"}]},"description":"Sub-clauses evaluated against each array element.","example":[{"field":"operator","op":"$eq","value":"NordVPN"},{"field":"last_seen_at","op":"$range","value":{"gt":"2026-03-15 00:00:00"}}]}}},"RangeQueryFilter":{"type":"object","required":["field","op","value"],"properties":{"field":{"type":"string","description":"Field name. Consult the [Events Schema API](/#operation/getEventSchema) for the list of available fields.","example":"name"},"op":{"type":"string","enum":["$range"],"example":"$range"},"value":{"type":"object","properties":{"gteq":{"oneOf":[{"type":"string"},{"type":"number"}],"x-types":{"isMultipleTypes":true,"values":["str?","int?","float?"]}},"gt":{"oneOf":[{"type":"string"},{"type":"number"}],"x-types":{"isMultipleTypes":true,"values":["str?","int?","float?"]}},"lteq":{"oneOf":[{"type":"string"},{"type":"number"}],"x-types":{"isMultipleTypes":true,"values":["str?","int?","float?"]}},"lt":{"oneOf":[{"type":"string"},{"type":"number"}],"x-types":{"isMultipleTypes":true,"values":["str?","int?","float?"]}}},"example":{"gt":2,"lt":10}}}},"RelativeRangeQueryFilter":{"type":"object","description":"It allows querying data for relative time, eq. events within the last 1 hour.","example":{"field":"created_at","value":{"gt":3600},"op":"$relative_range"},"required":["field","op","value"],"properties":{"field":{"type":"string","description":"Field name. Consult the [Events Schema API](/#operation/getEventSchema) for the list of available fields.","example":"name"},"op":{"type":"string","enum":["$relative_range"],"example":"$relative_range"},"value":{"type":"object","properties":{"gteq":{"type":"integer"},"gt":{"type":"integer"},"lteq":{"type":"integer"},"lt":{"type":"integer"}},"example":{"gt":3600}}}},"ExistsQueryFilter":{"type":"object","required":["field","op"],"properties":{"field":{"type":"string","example":"name","description":"Field name. Consult the [Events Schema API](/#operation/getEventSchema) for the list of available fields."},"op":{"type":"string","enum":["$exists","$nexists"],"example":"$exists"}}},"GeoQueryFilter":{"type":"object","required":["field","op","value"],"properties":{"field":{"type":"string","description":"field name to filter on","example":"name"},"op":{"type":"string","enum":["$geo"],"example":"$geo"},"value":{"x-model-names":["BoundingBoxFilter","GeoDistanceFilter"],"oneOf":[{"$ref":"#/components/schemas/BoundingBoxFilter"},{"$ref":"#/components/schemas/GeoDistanceFilter"}]}}},"BoundingBoxFilter":{"type":"object","required":["top_left","bottom_right"],"properties":{"top_left":{"$ref":"#/components/schemas/Coordinates"},"bottom_right":{"$ref":"#/components/schemas/Coordinates"}}},"GeoDistanceFilter":{"type":"object","required":["distance","units","coordinates"],"properties":{"distance":{"type":"number","minimum":0,"description":"Distance in radius from center point"},"units":{"type":"string","description":"Units to filter geolocation by","enum":["mi","yd","km","m"]},"coordinates":{"$ref":"#/components/schemas/Coordinates"}}},"HavingQueryFilter":{"allOf":[{"$ref":"#/components/schemas/QueryFilter"},{"$ref":"#/components/schemas/UnnamedColumn"}]},"OrHavingQueryFilter":{"type":"object","required":["value","op"],"properties":{"op":{"type":"string","enum":["$or"],"example":"$or"},"value":{"type":"array","x-discriminator-field":"op","minItems":1,"items":{"type":"object","x-model-names":["HavingQueryFilter","RangeHavingQueryFilter","ExistsHavingQueryFilter"],"oneOf":[{"$ref":"#/components/schemas/HavingQueryFilter"},{"$ref":"#/components/schemas/RangeHavingQueryFilter"},{"$ref":"#/components/schemas/ExistsHavingQueryFilter"}]}}}},"RangeHavingQueryFilter":{"allOf":[{"$ref":"#/components/schemas/RangeQueryFilter"},{"$ref":"#/components/schemas/UnnamedColumn"}]},"RelativeRangeHavingQueryFilter":{"allOf":[{"$ref":"#/components/schemas/RelativeRangeQueryFilter"},{"$ref":"#/components/schemas/UnnamedColumn"}]},"ExistsHavingQueryFilter":{"allOf":[{"$ref":"#/components/schemas/ExistsQueryFilter"},{"$ref":"#/components/schemas/UnnamedColumn"}]},"GeoHavingQueryFilter":{"allOf":[{"$ref":"#/components/schemas/GeoQueryFilter"},{"$ref":"#/components/schemas/UnnamedColumn"}]},"BaseQuery":{"type":"object","required":["filters"],"properties":{"filters":{"type":"array","x-discriminator-field":"op","items":{"type":"object","x-model-names":["QueryFilter","RangeQueryFilter","RelativeRangeQueryFilter","ExistsQueryFilter","GeoQueryFilter","OrQueryFilter","ArrayMatchQueryFilter"],"oneOf":[{"$ref":"#/components/schemas/QueryFilter"},{"$ref":"#/components/schemas/RelativeRangeQueryFilter"},{"$ref":"#/components/schemas/RangeQueryFilter"},{"$ref":"#/components/schemas/ExistsQueryFilter"},{"$ref":"#/components/schemas/OrQueryFilter"},{"$ref":"#/components/schemas/ArrayMatchQueryFilter"}]}},"query_type":{"type":"string","enum":["$count","$records","$records_with_count"],"default":"$records_with_count","description":"The type of query to perform.\n\n- `$count` returns the number of records matching the query (`total_count` will be present and `data` will be empty)\n- `$records` returns the records matching the query (`total_count` will be 0)\n- `$records_with_count` returns the number of records matching the query and the records matching the query\n"},"page":{"type":"integer","minimum":1}}},"QueryFilter":{"type":"object","required":["field","op","value"],"properties":{"field":{"type":"string","description":"Field name. Consult the [Events Schema API](/#operation/getEventSchema) for the list of available fields."},"op":{"type":"string","enum":["$in","$nin","$eq","$neq","$like","$nlike","$contains","$ncontains","$starts_with","$nstarts_with","$ends_with","$nends_with","$matches","$nmatches","$ip_range","$nip_range"],"example":"$eq"},"value":{"x-types":{"isMultipleTypes":true,"values":["str?","int?","float?","bool?","(array? & max_size?(1000))","hash?"]},"oneOf":[{"type":"string","example":"Rhea"},{"type":"number","example":2},{"type":"boolean","example":true},{"type":"array","maxItems":1000,"items":{"oneOf":[{"type":"string"},{"type":"number"}]},"example":["Rhea"]},{"type":"object","example":{"reference":"user_email"},"required":["reference"],"properties":{"reference":{"type":"string","description":"A field to compare a value against. Consult the [Events Schema API](/#operation/getEventSchema) for the list of referenceable fields."}}}],"description":"Can be string, bool, numeric, object, or an array of string/numeric values"}}},"QueryParams":{"allOf":[{"$ref":"#/components/schemas/BaseQuery"},{"type":"object","properties":{"aggregations":{"type":"array","description":"EXPERIMENTAL! Array of aggregations to include in the response.\nFor each aggregation, you can reference its name in the `columns`, `sort`, and `having` fields.\n","maxItems":4,"x-discriminator-field":"aggregation_type","items":{"$ref":"#/components/schemas/AggregationRequest"}},"formulas":{"type":"array","description":"EXPERIMENTAL! Array of formulas to include in the response.\nFor each formula, you can reference its name in the `columns`, `sort`, and `having` fields.\n","maxItems":4,"items":{"$ref":"#/components/schemas/FormulaRequest"}},"columns":{"type":"array","description":"Field names to return. Consult the [Events Schema API](/#operation/getEventSchema) for the list of available fields.","items":{"type":"string"}}}}]},"Query":{"allOf":[{"$ref":"#/components/schemas/QueryParams"},{"type":"object","properties":{"results_size":{"type":"integer","minimum":1,"maximum":10000}}}]},"Transform":{"type":"object","description":"Describes how to transform the column value. The transformation is applied before the `func` aggregation function.","required":["transform"],"properties":{"transform":{"$ref":"#/components/schemas/Transforms"},"options":{"type":"object","description":"Options specific for each transformation function"}}},"Transforms":{"type":"string","description":"All possible transformations","enum":["$to_start_of_interval"]},"GroupingField":{"type":"object","required":["field"],"properties":{"field":{"type":"string","description":"Field name. Consult the [Events Schema API](/#operation/getEventSchema) for the list of available fields.","maxLength":255,"minLength":1},"transform":{"$ref":"#/components/schemas/Transform"}}},"Column":{"type":"object","allOf":[{"$ref":"#/components/schemas/GroupingField"},{"type":"object","required":["name"],"properties":{"name":{"type":"string","description":"Display name of the column","maxLength":255,"example":"Sum of Risk"},"func":{"$ref":"#/components/schemas/Func"},"options":{"type":"object","description":"Options specific for each aggregation function"}}}]},"UnnamedColumn":{"type":"object","allOf":[{"$ref":"#/components/schemas/GroupingField"},{"type":"object","required":["func"],"properties":{"func":{"$ref":"#/components/schemas/Func"},"options":{"type":"object","description":"Options specific for each aggregation function"}}}]},"UnnamedColumnWithOrder":{"type":"object","allOf":[{"$ref":"#/components/schemas/UnnamedColumn"},{"type":"object","properties":{"order":{"type":"string","enum":["asc","desc"]}}}]},"ExportQuery":{"allOf":[{"$ref":"#/components/schemas/QueryParams"},{"type":"object","required":["email_to"],"properties":{"email_to":{"type":"string","format":"idn-email"},"results_size":{"type":"integer","minimum":1,"maximum":1000000}}}]},"GroupQuery":{"allOf":[{"$ref":"#/components/schemas/GroupQueryParams"},{"type":"object","properties":{"results_size":{"type":"integer","minimum":1,"maximum":10000}}}]},"GroupQueryParams":{"allOf":[{"$ref":"#/components/schemas/BaseQuery"},{"type":"object","required":["group_by","columns"],"properties":{"aggregations":{"type":"array","description":"EXPERIMENTAL! Array of aggregations to include in the response.\nFor each aggregation, you can reference its name in the `columns`, `sort`, and `having` fields.\n","maxItems":4,"x-discriminator-field":"aggregation_type","items":{"$ref":"#/components/schemas/AggregationRequest"}},"formulas":{"type":"array","description":"EXPERIMENTAL! Array of formulas to include in the response.\nFor each formula, you can reference its name in the `columns`, `sort`, and `having` fields.\n","maxItems":4,"items":{"$ref":"#/components/schemas/FormulaRequest"}},"group_by":{"$ref":"#/components/schemas/GroupBy"},"columns":{"type":"array","description":"Array of columns to return. Each column references a field and an aggregation function. Consult the [Events Schema API](/#operation/getEventSchema) for the list of available fields.","maxItems":50,"minItems":1,"items":{"$ref":"#/components/schemas/Column"}},"having":{"description":"field should contain the \"name\" value from your columns","type":"array","x-discriminator-field":"op","items":{"type":"object","x-model-names":["HavingQueryFilter","RangeHavingQueryFilter","GeoHavingQueryFilter","ExistsHavingQueryFilter","OrHavingQueryFilter"],"oneOf":[{"$ref":"#/components/schemas/HavingQueryFilter"},{"$ref":"#/components/schemas/RangeHavingQueryFilter"},{"$ref":"#/components/schemas/ExistsHavingQueryFilter"},{"$ref":"#/components/schemas/GeoHavingQueryFilter"},{"$ref":"#/components/schemas/OrHavingQueryFilter"}]}},"sort":{"$ref":"#/components/schemas/UnnamedColumnWithOrder"}}}]},"ExportGroupQuery":{"allOf":[{"$ref":"#/components/schemas/GroupQueryParams"},{"type":"object","required":["email_to"],"properties":{"email_to":{"type":"string","format":"idn-email"},"results_size":{"type":"integer","minimum":1,"maximum":1000000}}}]},"GroupBy":{"type":"object","required":["fields"],"properties":{"fields":{"type":"array","description":"the field names to group by. Consult the [Events Schema API](/#operation/getEventSchema) for the list of available fields.","maxItems":5,"minItems":1,"items":{"$ref":"#/components/schemas/GroupingField"}},"filters":{"description":"The filters to apply to the grouping level. This let's you have separate filters on the grouping level compared to the top-level query. For example, you can query events in the last 24 hours with risk score > 90, group by user id and then compute aggregate columns with a 30-day time-range.","type":"array","x-discriminator-field":"op","items":{"type":"object","x-model-names":["QueryFilter","RangeQueryFilter","RelativeRangeQueryFilter","ExistsQueryFilter","GeoQueryFilter","OrQueryFilter","ArrayMatchQueryFilter"],"oneOf":[{"$ref":"#/components/schemas/QueryFilter"},{"$ref":"#/components/schemas/RelativeRangeQueryFilter"},{"$ref":"#/components/schemas/RangeQueryFilter"},{"$ref":"#/components/schemas/ExistsQueryFilter"},{"$ref":"#/components/schemas/OrQueryFilter"},{"$ref":"#/components/schemas/ArrayMatchQueryFilter"}]}}}},"Buckets":{"type":"object","required":["total_count","data"],"properties":{"data":{"type":"array","example":[{"value":"*-0.6","count":719,"buckets":{}},{"value":"0.6-0.9","count":80,"buckets":{}},{"value":"0.9-*","count":8,"buckets":{}}],"items":{"type":"object","required":["value","count","buckets"],"properties":{"value":{"description":"Value of the data that was aggregated on","x-types":{"isMultipleTypes":true,"values":["str?","int?","float?","bool?"],"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}},"count":{"type":"integer","description":"Total count of the aggregated value"},"buckets":{"type":"object","description":"Buckets for query. Key is the bucket name and the value is an array of objects\nwith value and count keys\n"}}}},"total_count":{"type":"integer","minimum":0,"example":1}}},"CountQuery":{"allOf":[{"$ref":"#/components/schemas/BaseQuery"},{"type":"object","properties":{"count":{"type":"string","description":"bucket value from fields endpoint","example":"risk_count"},"options":{"type":"object","description":"options to pass to query. see fields response","example":{"range":[0.3,0.6,0.9,1]}},"buckets":{"type":"array","description":"additional buckets to aggregate on","items":{"type":"object","required":["name"],"properties":{"name":{"type":"string","example":"sub_bucket_count"},"options":{"type":"object","description":"options to pass to query. see fields response"}}}},"group_by":{"$ref":"#/components/schemas/GroupBy"}}}]},"Device":{"type":"object","required":["fingerprint"],"properties":{"user_agent":{"type":"string","example":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36"},"fingerprint":{"type":"string","nullable":true,"example":"ohvjn8adSnetYTzZ8B7bOP"},"hardware":{"type":"object","required":["type","name","brand","model","display"],"properties":{"type":{"type":"string","example":"computer"},"name":{"type":"string","nullable":true,"example":null},"brand":{"type":"string","nullable":true,"example":null},"display":{"type":"object","required":["width","height"],"properties":{"width":{"type":"integer","nullable":true,"example":1512},"height":{"type":"integer","nullable":true,"example":982}}},"model":{"type":"object","required":["name","code"],"properties":{"name":{"type":"string","nullable":true,"example":null},"code":{"type":"string","nullable":true,"example":null}}}}},"os":{"type":"object","required":["name","version"],"properties":{"name":{"type":"string","example":"Windows 10"},"version":{"type":"object","required":["major","full"],"properties":{"major":{"type":"string","nullable":true,"example":"10"},"full":{"type":"string","example":null,"nullable":true}}}}},"software":{"type":"object","required":["type","name","version","languages","fingerprint"],"properties":{"type":{"type":"string","example":"browser"},"name":{"type":"string","example":"Chrome"},"languages":{"type":"array","items":{"type":"string"},"example":["en-us","en"]},"version":{"type":"object","required":["major","full"],"properties":{"major":{"type":"string","nullable":true,"example":"91"},"full":{"type":"string","nullable":true,"example":"91.0.4472"}}},"fingerprint":{"type":"string","nullable":true,"example":"vOch_0a_fpkl1Tf-pVPuDA"}}},"timezone":{"type":"object","properties":{"offset":{"type":"integer","nullable":true,"example":-300,"description":"Time offset from UTC measured in minutes"},"name":{"type":"string","nullable":true,"example":"America/New_York"}}},"screen":{"type":"object","properties":{"screen":{"type":"integer","nullable":true,"example":2},"orientation":{"type":"string","nullable":true,"example":"landscape"}}}}},"IP":{"type":"object","required":["location","address","asn","isp","type"],"properties":{"asn":{"type":"integer","example":14618},"location":{"type":"object","required":["city","continent_code","country_code","postal_code","region_code","latitude","longitude"],"properties":{"city":{"type":"string","nullable":true,"example":"Ashburn"},"continent_code":{"type":"string","nullable":true,"example":"NA"},"country_code":{"type":"string","nullable":true,"example":"US"},"postal_code":{"type":"string","nullable":true,"example":"20149"},"region_code":{"type":"string","nullable":true,"example":"VA"},"latitude":{"type":"number","nullable":true,"example":52.3583},"longitude":{"type":"number","nullable":true,"example":4.8488}}},"address":{"type":"string","example":"34.200.81.5"},"isp":{"type":"object","properties":{"name":{"type":"string","nullable":true,"example":"verizon fios"},"organization":{"type":"string","nullable":true,"example":"verizon fios"}}},"type":{"type":"string","example":"ipv4"},"privacy":{"type":"object","properties":{"anonymous":{"type":"boolean","example":false},"datacenter":{"type":"boolean","example":false},"proxy":{"type":"boolean","example":false},"tor":{"type":"boolean","example":false}}}}},"Events":{"type":"object","required":["total_count","data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Event"}},"total_count":{"type":"integer","minimum":0,"example":1}}},"Event":{"type":"object","required":["id","endpoint","type","status","risk","signals","properties","product","device","ip","policy","user","created_at","authenticated"],"properties":{"id":{"type":"string","example":"ASZoelALT5-PaVw2pAVMXg"},"type":{"type":"string","example":"$login"},"status":{"type":"string","example":"$succeeded"},"risk":{"type":"number","nullable":true,"example":0.396},"signals":{"type":"array","example":["bot_behavior","multiple_accounts_per_device"],"items":{"type":"string","enum":["abuse_ip","fraudulent_email_domain","bot_behavior","credential_stuffing","disposable_email_domain","generated_email","headless_browser","high_activity_device_signature","http_client_library","impossible_travel","invalid_email","invalid_device_data","missing_device_data","missing_headers","multiple_accounts_per_device","multiple_aliases_per_email","new_country","new_device","new_device_type","new_isp","new_language","new_os","no_interactions","high_activity_device","high_activity_ip","high_activity_account","spoofed_device","web_crawler"]}},"properties":{"$ref":"#/components/schemas/Properties"},"product":{"$ref":"#/components/schemas/Product"},"device":{"$ref":"#/components/schemas/Device"},"ip":{"$ref":"#/components/schemas/IP"},"policy":{"$ref":"#/components/schemas/Policy"},"user":{"type":"object","required":["id","registered_at","email","phone","traits","last_seen_at","risk","devices_count","name"],"properties":{"id":{"type":"string","nullable":true,"example":"220f785c-77a4-4532-ba23-f7e68388eebe"},"registered_at":{"type":"string","format":"date-time","nullable":true,"example":"2010-12-02T00:30:08.276Z"},"last_seen_at":{"type":"string","format":"date-time","example":"2021-12-02T03:40:03.226Z","nullable":true},"risk":{"type":"number","example":0.396},"devices_count":{"type":"integer","example":2},"name":{"type":"string","nullable":true,"example":"Rhea Franecki"},"email":{"type":"string","format":"idn-email","nullable":true,"example":"Rhea.Franecki+subaddress@example.org"},"phone":{"type":"string","nullable":true,"example":"+16175551212"},"traits":{"description":"Known traits of the identified user","type":"object","nullable":true,"example":{"organization_name":"Example Org","account_verified_at":"2024-07-25T13:22:50.834Z"}},"address":{"$ref":"#/components/schemas/Address"}}},"params":{"$ref":"#/components/schemas/EventParams"},"transaction":{"$ref":"#/components/schemas/Transaction"},"authentication_method":{"$ref":"#/components/schemas/AuthenticationMethod"},"challenge":{"$ref":"#/components/schemas/Challenge"},"page":{"type":"object","required":["name","url"],"properties":{"name":{"description":"Name of the page - for example the HTML page title or just a client-supplied value","type":"string","maxLength":200},"url":{"description":"URL of the current page","type":"string","maxLength":2048},"referrer":{"description":"The value of the HTTP referrer header","type":"string","maxLength":2048}}},"screen":{"type":"object","required":["name"],"properties":{"name":{"description":"The name of the current screen","type":"string","maxLength":200}}},"scores":{"type":"object","properties":{"account_sharing":{"$ref":"#/components/schemas/Score"},"account_takeover":{"$ref":"#/components/schemas/Score"},"bot":{"$ref":"#/components/schemas/Score"},"multi_accounting":{"$ref":"#/components/schemas/Score"},"spoofed_device":{"$ref":"#/components/schemas/Score"},"spoofed_location":{"$ref":"#/components/schemas/Score"},"unified":{"$ref":"#/components/schemas/Score"}}},"changeset":{"type":"object","additionalProperties":{"x-name":"changeset","x-model-names":["ChangesetEntry","ChangedChangesetEntry"],"oneOf":[{"$ref":"#/components/schemas/ChangedChangesetEntry"},{"$ref":"#/components/schemas/ChangesetEntry"}]}},"created_at":{"type":"string","format":"date-time","example":"2021-09-27T16:46:38.313Z"}}},"Func":{"type":"string","enum":["$sum","$last","$avg","$min","$max","$count","$top_k","$date_histogram","$count_unique"],"description":"Aggregation function to be applied on the field","example":"$sum"},"Op":{"type":"string","enum":["$eq","$neq","$in","$nin","$range","$exists","$nexists","$geo","$like","$nlike","$contains","$ncontains","$starts_with","$nstarts_with","$ends_with","$nends_with","$ip_range","$nip_range","$array_match_any","$array_match_all","$narray_match_any","$narray_match_all"],"example":"$eq"},"DataType":{"type":"string","enum":["array","boolean","datetime","decimal","integer","ip","map","number","string","uuid"],"example":"string"},"EventParams":{"type":"object","description":"The params object","properties":{"email":{"type":"string","description":"The email address sent by the user","example":"Rhea.Franecki@example.org"},"phone":{"description":"The phone number sent by the user","type":"string","example":"+16175551212"},"username":{"description":"The username sent by the user","type":"string","example":"superhero123"}}},"Properties":{"type":"object","description":"User defined properties","maxProperties":20,"additionalProperties":{"oneOf":[{"type":"string","description":"A regular string field or timestamp given in the ISO8601 format","maxLength":255,"example":{"favorite_color":"Blue","account_verified_at":"2024-07-25T13:22:50.834Z"}},{"type":"number"},{"type":"boolean"},{"type":"object","additionalProperties":{"oneOf":[{"type":"string","maxLength":255},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"oneOf":[{"type":"string","maxLength":255},{"type":"number"},{"type":"boolean"}]}}]}},{"type":"array","items":{"oneOf":[{"type":"string","maxLength":255},{"type":"number"},{"type":"boolean"}]}}]},"default":{}},"Policy":{"type":"object","description":"The matching policy","required":["name","id","revision_id","action"],"properties":{"name":{"description":"Name of the matching policy","type":"string","nullable":true,"example":"Challenge risk >= 60"},"id":{"type":"string","nullable":true,"example":"2ee938c8-24c2-4c26-9d25-19511dd75029"},"revision_id":{"deprecated":true,"type":"string","nullable":true,"example":"900b183a-9f6d-4579-8c47-9ddcccf637b4"},"action":{"type":"string","nullable":true,"enum":["allow","challenge","deny"],"example":"challenge"},"response":{"type":"object","nullable":true,"description":"The response to send when the policy action is deny","required":["status_code","body","headers"],"properties":{"status_code":{"type":"number","description":"The status code to send in the response","example":403},"body":{"type":"string","description":"The body to send in the response","example":"Access denied"},"headers":{"type":"array","description":"Additional headers to send in the response","items":{"type":"object","properties":{"name":{"type":"string","description":"The name of the header","example":"X-Custom-Header"},"value":{"type":"string","description":"The value of the header","example":"1234567890"}}}}}}}},"Risk":{"type":"object","oneOf":[{"$ref":"#/components/schemas/ChallengeRiskRequest"},{"$ref":"#/components/schemas/RegistrationRiskRequest"},{"$ref":"#/components/schemas/LoginRiskRequest"},{"$ref":"#/components/schemas/ProfileUpdateRiskRequest"},{"$ref":"#/components/schemas/ProfileResetRiskRequest"},{"$ref":"#/components/schemas/TransactionRiskRequest"},{"$ref":"#/components/schemas/LogoutRiskRequest"},{"$ref":"#/components/schemas/CustomRiskRequest"}],"discriminator":{"propertyName":"type","mapping":{"$login":"#/components/schemas/LoginRiskRequest","$challenge":"#/components/schemas/ChallengeRiskRequest","$custom":"#/components/schemas/CustomRiskRequest","$logout":"#/components/schemas/LogoutRiskRequest","$profile_reset":"#/components/schemas/ProfileResetRiskRequest","$profile_update":"#/components/schemas/ProfileUpdateRiskRequest","$registration":"#/components/schemas/RegistrationRiskRequest","$transaction":"#/components/schemas/TransactionRiskRequest"}}},"Filter":{"type":"object","oneOf":[{"$ref":"#/components/schemas/RegistrationFilterRequest"},{"$ref":"#/components/schemas/LoginFilterRequest"},{"$ref":"#/components/schemas/PasswordResetFilterRequest"},{"$ref":"#/components/schemas/CustomFilterRequest"},{"$ref":"#/components/schemas/ChallengeFilterRequest"},{"$ref":"#/components/schemas/TransactionFilterRequest"}],"discriminator":{"propertyName":"type","mapping":{"$login":"#/components/schemas/LoginFilterRequest","$challenge":"#/components/schemas/ChallengeFilterRequest","$custom":"#/components/schemas/CustomFilterRequest","$password_reset_request":"#/components/schemas/PasswordResetFilterRequest","$registration":"#/components/schemas/RegistrationFilterRequest","$transaction":"#/components/schemas/TransactionFilterRequest"}}},"Transaction":{"type":"object","required":["id","type"],"properties":{"type":{"type":"string","enum":["$purchase","$withdrawal","$deposit","$transfer","$reward","$sale"],"x-enumDescriptions":{"$purchase":"The user purchased physical or digital goods from you or from another user on your platform.","$withdrawal":"The user withdrew balance into a bank account or debit card.","$deposit":"The user deposited balance into their account on your platform.","$transfer":"The user transferred balance between accounts on your platform.","$sale":"The user sold physical or digital goods to you or to another user on your platform."}},"id":{"type":"string","maxLength":255,"example":"900b183a-9f6d-4579-8c47-9ddcccf637b4","description":"Unique identifier for this transaction. Use this to link the flow of your\ntransactions with different events and types\n"},"base_amount":{"type":"string","pattern":"^\\d{1,9}(\\.\\d+)?$","example":"499.99","description":"Monetary amount of the transaction in your system's home currency, with two decimals"},"amount":{"x-model-names":["FiatAmount","CryptoAmount"],"oneOf":[{"$ref":"#/components/schemas/FiatAmount"},{"$ref":"#/components/schemas/CryptoAmount"}]},"payment_method":{"$ref":"#/components/schemas/PaymentMethod"},"shipping_address":{"$ref":"#/components/schemas/Address"},"merchant":{"$ref":"#/components/schemas/Merchant"}}},"PaymentMethod":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["$aba","$ach","$amazon_pay","$android_pay","$apple_pay","$blinc","$boleto","$card","$crypto_wallet","$fps","$google_pay","$other","$paypal","$samsung_pay","$sen","$sepa","$signet","$wire"]},"fingerprint":{"type":"string","maxLength":255},"holder_name":{"type":"string","maxLength":255},"bank_name":{"type":"string","maxLength":255},"country_code":{"type":"string","minLength":2,"maxLength":3},"billing_address":{"$ref":"#/components/schemas/Address"},"card":{"type":"object","properties":{"bin":{"type":"string","pattern":"(^\\d{6}$)|(^\\d{8}$)"},"last4":{"type":"string","pattern":"^\\d{4}$"},"exp_month":{"type":"integer","minimum":1,"maximum":12},"exp_year":{"type":"integer","minimum":2000,"maximum":2100},"network":{"type":"string","enum":["$amex","$cartes_bancaires","$diners","$discover","$interac","$jcb","$mastercard","$other","$unionpay","$visa"]},"funding":{"type":"string","enum":["$credit","$debit","$other","$prepaid"]}}}}},"Merchant":{"type":"object","properties":{"id":{"type":"string","maxLength":255,"example":"a2c8e7ef-40da-42f2-9b7d-cd928e5f8279","description":"Merchant Identifier"},"name":{"type":"string","maxLength":255,"example":"United Airlines","description":"Merchant Name"},"category":{"type":"object","properties":{"code":{"type":"string","pattern":"^\\d{4}$","example":"3000","description":"Merchant Category Code (MCC) in ISO 18245 four-digit format"},"description":{"type":"string","maxLength":255,"example":"Airlines","description":"Merchant Category Description"}}},"address":{"$ref":"#/components/schemas/Address"}}},"Product":{"type":"object","required":["id"],"properties":{"id":{"type":"string","maxLength":255,"description":"If you have multiple products that your users can log into using the same credentials, populate this field so that you can segment the data in the dashboard by product."}}},"Session":{"type":"object","description":"Additional session information from your system","required":["id"],"properties":{"id":{"type":"string","maxLength":255,"description":"A unique session identifier from your system. You should hash the value before sending it to Castle"},"created_at":{"type":"string","format":"date-time","description":"Timestamp when the session was created"}}},"FiatAmount":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["$fiat"]},"value":{"type":"string","pattern":"^\\d{1,9}(\\.\\d+)?$","example":"499.99","description":"Monetary amount of transaction with decimals"},"currency":{"type":"string","description":"ISO Currency denomination, required when value is provided\n\n| Code | Description |\n| - | - |\n| AED | UAE Dirham |\n| ALL | Albanian Lek |\n| AMD | Armenian Dram |\n| ANG | Antillian Guilder |\n| AOA | Angolan Kwanza |\n| ARS | Nuevo Argentine Peso |\n| AUD | Australian Dollar |\n| AWG | Aruban Guilder |\n| AZN | Azerbaijani manat |\n| BAM | Bosnia and Herzegovina Convertible Marks |\n| BBD | Barbados Dollar |\n| BDT | Banggladesh Taka |\n| BGN | New Bulgarian Lev |\n| BHD | Bahraini Dinar |\n| BMD | Bermudian Dollar |\n| BND | Brunei Dollar |\n| BOB | Bolivia Boliviano |\n| BRL | Brazilian Real |\n| BSD | Bahamian Dollar |\n| BWP | Botswana Pula |\n| BYN | New Belarusian Ruble |\n| BZD | Belize Dollar |\n| CAD | Canadian Dollar |\n| CHF | Swiss Franc |\n| CLP | Chilean Peso |\n| CNY | Yuan Renminbi |\n| COP | Colombian Peso |\n| CRC | Costa Rican Colon |\n| CUP | Cuban Peso |\n| CVE | Cape Verdi Escudo |\n| CZK | Czech Koruna |\n| DJF | Djibouti Franc |\n| DKK | Danish Krone |\n| DOP | Dominican Republic Peso |\n| DZD | Algerian Dinar |\n| EGP | Egyptian Pound |\n| ETB | Ethiopian Birr |\n| EUR | Euro |\n| FJD | Fiji Dollar |\n| FKP | Falkland Islands Pound |\n| GBP | Pound Sterling |\n| GEL | Georgian Lari |\n| GHS | Ghanaian Cedi |\n| GIP | Gibraltar Pound |\n| GMD | Gambia Delasi |\n| GNF | Guinea Franc |\n| GTQ | Guatemala Quetzal |\n| GYD | Guyanese Dollar |\n| HKD | Hong Kong Dollar |\n| HNL | Honduras Lempira |\n| HRK | Croatia Kuna |\n| HTG | Haitian Gourde |\n| HUF | Hungarian Forint |\n| IDR | Indonesian Rupiah |\n| ILS | New Israeli Scheqel |\n| INR | Indian Rupee |\n| IQD | Iraqi Dinar |\n| ISK | Iceland Krona |\n| JMD | Jamaican Dollar |\n| JOD | Jordanian Dinar |\n| JPY | Japanese Yen |\n| KES | Kenyan Shilling |\n| KGS | Kyrgyzstan Som |\n| KHR | Cambodia Riel |\n| KMF | Comoro Franc |\n| KRW | South-Korean Won |\n| KWD | Kuwaiti Dinar |\n| KYD | Cayman Islands Dollar |\n| KZT | Kazakhstani Tenge |\n| LAK | Laos Kip |\n| LBP | Lebanese Pound |\n| LKR | Sri Lanka Rupee |\n| LYD | Libyan Dinar |\n| MAD | Moroccan Dirham |\n| MDL | Moldovia Leu |\n| MKD | Macedonian Denar |\n| MMK | Myanmar Kyat |\n| MNT | Mongolia Tugrik |\n| MOP | Macau Pataca |\n| MRU | Mauritania Ouguiya |\n| MUR | Mauritius Rupee |\n| MVR | Maldives Rufiyaa |\n| MWK | Malawi Kwacha |\n| MXN | Mexican Peso |\n| MYR | Malaysian Ringgit |\n| MZN | Mozambican Metical |\n| NAD | Namibian Dollar |\n| NGN | Nigerian Naira |\n| NIO | Nicaragua Cordoba Oro |\n| NOK | Norwegian Krone |\n| NPR | Nepalese Rupee |\n| NZD | New Zealand Dollar |\n| OMR | Rial Omani |\n| PAB | Panamanian Balboa |\n| PEN | Peruvian Nuevo Sol |\n| PGK | New Guinea Kina |\n| PHP | Philippine Peso |\n| PKR | Pakistan Rupee |\n| PLN | New Polish Zloty |\n| PYG | Paraguay Guarani |\n| QAR | Qatari Rial |\n| RON | New Romanian Lei |\n| RSD | Serbian Dinar |\n| RUB | Russian Ruble |\n| RWF | Rwanda Franc |\n| SAR | Saudi Riyal |\n| SBD | Solomon Island Dollar |\n| SCR | Seychelles Rupee |\n| SEK | Swedish Krone |\n| SGD | Singapore Dollar |\n| SHP | St. Helena Pound |\n| SLL | Sierra Leone Leone |\n| SOS | Somalia Shilling |\n| SRD | Surinamese Dollar |\n| STN | Sao Tome & Principe Dobra |\n| SVC | El Salvador Colón |\n| SZL | Swaziland Lilangeni |\n| THB | Thai Baht |\n| TND | Tunisian Dinar |\n| TOP | Tonga Pa'anga |\n| TRY | New Turkish Lira |\n| TTD | Trinidad & Tobago Dollar |\n| TWD | New Taiwan Dollar |\n| TZS | Tanzanian Shilling |\n| UAH | Ukraine Hryvnia |\n| UGX | Uganda Shilling |\n| USD | US Dollar |\n| UYU | Peso Uruguayo |\n| UZS | Uzbekistani Som |\n| VEF | Venezuelan Bolívar |\n| VND | Vietnamese New Dong |\n| VUV | Vanuatu Vatu |\n| WST | Samoan Tala |\n| XAF | CFA Franc BEAC |\n| XCD | East Caribbean Dollar |\n| XOF | CFA Franc BCEAO |\n| XPF | CFP Franc |\n| YER | Yemeni Rial |\n| ZAR | South African Rand |\n| ZMW | Zambian Kwacha |\n","example":"USD","enum":["AED","ALL","AMD","ANG","AOA","ARS","AUD","AWG","AZN","BAM","BBD","BDT","BGN","BHD","BMD","BND","BOB","BRL","BSD","BWP","BYN","BZD","CAD","CHF","CLP","CNY","COP","CRC","CUP","CVE","CZK","DJF","DKK","DOP","DZD","EGP","ETB","EUR","FJD","FKP","GBP","GEL","GHS","GIP","GMD","GNF","GTQ","GYD","HKD","HNL","HRK","HTG","HUF","IDR","ILS","INR","IQD","ISK","JMD","JOD","JPY","KES","KGS","KHR","KMF","KRW","KWD","KYD","KZT","LAK","LBP","LKR","LYD","MAD","MDL","MKD","MMK","MNT","MOP","MRU","MUR","MVR","MWK","MXN","MYR","MZN","NAD","NGN","NIO","NOK","NPR","NZD","OMR","PAB","PEN","PGK","PHP","PKR","PLN","PYG","QAR","RON","RSD","RUB","RWF","SAR","SBD","SCR","SEK","SGD","SHP","SLL","SOS","SRD","STN","SVC","SZL","THB","TND","TOP","TRY","TTD","TWD","TZS","UAH","UGX","USD","UYU","UZS","VEF","VND","VUV","WST","XAF","XCD","XOF","XPF","YER","ZAR","ZMW"]}}},"CryptoAmount":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["$crypto"]},"value":{"type":"string","pattern":"^\\d{1,9}(\\.\\d+)?$","example":"1.512342352","description":"Monetary amount of transaction with decimals"},"currency":{"type":"string","description":"Digital currency code, required when value is provided","example":"BTC"}}},"FilterAndRiskResponse":{"x-model-names":["ChallengeResponse","CustomResponse","LoginResponse","LogoutResponse","ProfileResetResponse","ProfileUpdateResponse","RegistrationResponse","TransactionResponse"],"x-discriminator-field":"type","type":"object","oneOf":[{"$ref":"#/components/schemas/ChallengeResponse"},{"$ref":"#/components/schemas/CustomResponse"},{"$ref":"#/components/schemas/LoginResponse"},{"$ref":"#/components/schemas/LogoutResponse"},{"$ref":"#/components/schemas/ProfileResetResponse"},{"$ref":"#/components/schemas/ProfileUpdateResponse"},{"$ref":"#/components/schemas/RegistrationResponse"},{"$ref":"#/components/schemas/TransactionResponse"}],"discriminator":{"propertyName":"type","mapping":{"$challenge":"#/components/schemas/ChallengeResponse","$custom":"#/components/schemas/CustomResponse","$login":"#/components/schemas/LoginResponse","$logout":"#/components/schemas/LogoutResponse","$profile_reset":"#/components/schemas/ProfileResetResponse","$profile_update":"#/components/schemas/ProfileUpdateResponse","$registration":"#/components/schemas/RegistrationResponse","$transaction":"#/components/schemas/TransactionResponse"}}},"BaseRequest":{"type":"object","properties":{"context":{"$ref":"#/components/schemas/Context"},"properties":{"description":"User defined properties associated with this device","type":"object","maxProperties":20,"additionalProperties":{"$ref":"#/components/schemas/Properties"}},"product":{"$ref":"#/components/schemas/Product"},"session":{"$ref":"#/components/schemas/Session"},"created_at":{"description":"The default value is the time of which the event was received by Castle. If you’re passing events in a delayed fashion, such as via an event queue, you should make sure to set this field to the time of which the event was tracked and put into the queue.","type":"string","format":"date-time"}}},"ChallengeRiskRequest":{"type":"object","allOf":[{"$ref":"#/components/schemas/RiskRequest"},{"type":"object","required":["type"],"properties":{"type":{"type":"string","description":"Castle supported events available for this endpoint","default":"$challenge","enum":["$challenge"]},"status":{"type":"string","enum":["$requested","$succeeded","$failed"]},"authentication_method":{"$ref":"#/components/schemas/AuthenticationMethod"},"challenge":{"$ref":"#/components/schemas/Challenge"}}}]},"ChallengeFilterRequest":{"type":"object","allOf":[{"$ref":"#/components/schemas/FilterRequest"},{"type":"object","required":["type"],"properties":{"type":{"type":"string","description":"Castle supported events available for this endpoint","default":"$challenge","enum":["$challenge"]},"status":{"type":"string","enum":["$requested","$succeeded","$failed"]},"authentication_method":{"$ref":"#/components/schemas/AuthenticationMethod"},"challenge":{"$ref":"#/components/schemas/Challenge"}}}]},"PrivacyRequest":{"type":"object","required":["identifier","identifier_type"],"properties":{"identifier":{"type":"string","maxLength":255,"description":"ID or e-mail address of a user.","example":"Rhea.Franecki@example.org"},"identifier_type":{"type":"string","maxLength":255,"description":"Type of a provided identifier.","enum":["$id","$email"],"example":"$email"}}},"BaseItem":{"type":"object","description":"List Item","properties":{"primary_value":{"type":"string","maxLength":255,"description":"Value of the `primary_field` as described by the List definition. For example, if `primary_field` is configured to be the Event `user.id`, the `primary_value` on the List Item referes to the actual User ID value.","example":"A04t7AcfSA69cBTTusx0RQ"},"secondary_value":{"type":"string","nullable":true,"maxLength":255,"description":"Optional secondary value. If this value is set, it means that for a List Item to match an Event, both the `primary_value` and `secondary_value` must match.","example":"2ee938c8-24c2-4c26-9d25-19511dd75029"},"comment":{"type":"string","maxLength":2048,"description":"An arbitrary string that can be used to eg. explain why this List Item was created. Often useful to display to other users.","example":"Fradulent user found through manual inspection"},"author":{"$ref":"#/components/schemas/ListItemAuthor"},"auto_archives_at":{"type":"string","nullable":true,"format":"date-time","description":"Time after which a the List Item will be automatically archived and no longer matched against each event. A value of `null` means auto archivation is disabled and the record will stay active in the list forever.","example":"2021-09-27T16:46:38.313Z"}}},"ListItemAuthor":{"type":"object","description":"Indicates who or how the list item was created. Typically, this refers to the user that created the item from within the Castle Dashboard, or the policy ID if it was automatically created via automation.","required":["type","identifier"],"properties":{"type":{"$ref":"#/components/schemas/AuthorType"},"identifier":{"type":"string","maxLength":255}}},"ListItem":{"allOf":[{"$ref":"#/components/schemas/BaseItem"},{"type":"object","description":"List Item","required":["id","list_id","primary_value"],"properties":{"id":{"type":"string","example":"2ee938c8-24c2-4c26-9d25-19511dd75029"},"list_id":{"type":"string","description":"ID of the List to which this List Item belongs to","example":"2ee938c8-24c2-4c26-9d25-19511dd75029"},"archived":{"type":"boolean"},"auto_archives_at":{"type":"string","nullable":true,"format":"date-time","description":"Time after which a the List Item will be automatically archived and no longer matched against each event. A value of `null` means auto archivation is disabled and the record will stay active in the list forever.","example":"2021-09-27T16:46:38.313Z"},"created_at":{"type":"string","format":"date-time","example":"2021-09-27T16:46:38.313Z"}}}]},"ListItemRequest":{"allOf":[{"$ref":"#/components/schemas/BaseItem"},{"type":"object","required":["primary_value","author"]},{"type":"object","properties":{"mode":{"type":"string","default":"error","description":"Describes a strategy to use when a List Item with the same `(primary, secondary)` values is already in the List. Available strategies:\n  - `$error` - return a 422 HTTP error\n  - `$replace` - archive the existing List Item and create a new one\n  - `$update` - if the author matches the existing List Item, update it. Otherwise, throw an HTTP 422 error.\n  - `$update_or_replace` - if the author matches the existing List Item, update it. Otherwise, archive the existing List Item and create a new one.\n","enum":["$error","$replace","$update","$update_or_replace"]}}}]},"ListItemsBatchRequest":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ListItemRequest"}}}},"ListItemsBatchResponse":{"type":"object","required":["total_received","total_processed"],"properties":{"total_received":{"type":"integer","description":"Total number of items received"},"total_processed":{"type":"integer","description":"Total number of items processed without any errors"},"created":{"type":"integer","description":"Number of items created"},"updated":{"type":"integer","description":"Number of items updated"},"replaced":{"type":"integer","description":"Total number of items replaced"},"errored":{"type":"integer","description":"Total number of items that errored"}},"example":{"total_received":135,"total_processed":130,"errored":5,"replaced":10,"updated":20,"created":100}},"ListItemList":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ListItem"}}}},"ListItemCount":{"type":"object","description":"List Item Count","properties":{"filters":{"type":"array","maxItems":100,"x-discriminator-field":"op","items":{"type":"object","x-model-names":["ListItemQueryFilter","ListItemOrQueryFilter"],"oneOf":[{"$ref":"#/components/schemas/ListItemQueryFilter"},{"$ref":"#/components/schemas/ListItemOrQueryFilter"}],"discriminator":{"propertyName":"op","mapping":{"$eq":"#/components/schemas/ListItemQueryFilter","$or":"#/components/schemas/ListItemOrQueryFilter"}}},"description":"Additional filters to query list items by fields and archival status","example":[{"field":"primary_value","op":"$eq","value":"Uc80JFKRRvm"},{"field":"archived","op":"$eq","value":false},{"op":"$or","value":[{"field":"secondary_value","op":"$eq","value":"1"}]},{"op":"$or","value":[{"field":"secondary_value","op":"$eq","value":"2"}]}]}}},"ListItemListCount":{"type":"object","required":["total_count"],"properties":{"total_count":{"description":"A number of list items matching the query capped at 100,000.","type":"integer","minimum":0,"example":1}}},"ListItemQuery":{"allOf":[{"type":"object","additionalProperties":false,"properties":{"page":{"type":"integer","description":"Page number","minimum":1,"maximum":1000,"default":1,"example":1},"results_size":{"type":"integer","description":"How many records to show per page","minimum":1,"maximum":100,"default":20,"example":50}}},{"oneOf":[{"$ref":"#/components/schemas/ListItemQueryWithSort"},{"$ref":"#/components/schemas/ListItemQueryWithoutSort"}]}]},"ListItemQueryWithoutSort":{"properties":{"filters":{"type":"array","maxItems":100,"x-discriminator-field":"op","items":{"type":"object","x-model-names":["ListItemQueryFilter","ListItemOrQueryFilter"],"oneOf":[{"$ref":"#/components/schemas/ListItemQueryFilter"},{"$ref":"#/components/schemas/ListItemOrQueryFilter"}],"discriminator":{"propertyName":"op","mapping":{"$eq":"#/components/schemas/ListItemQueryFilter","$or":"#/components/schemas/ListItemOrQueryFilter"}}},"description":"Additional filters to query list items by fields and archival status","example":[{"field":"primary_value","op":"$eq","value":"Uc80JFKRRvm"},{"field":"archived","op":"$eq","value":false},{"op":"$or","value":[{"field":"secondary_value","op":"$eq","value":"1"}]},{"op":"$or","value":[{"field":"secondary_value","op":"$eq","value":"2"}]}]}}},"ListItemQueryWithSort":{"properties":{"sort":{"type":"object","description":"List Item sort order, based on creation timestamp","required":["field","order"],"properties":{"field":{"type":"string","enum":["created_at"],"example":"created_at","description":"created_at is the only allowed field for sorting List Items"},"order":{"type":"string","enum":["asc","desc"],"example":"asc"}}},"filters":{"type":"array","maxItems":1,"items":{"type":"object","required":["field","op","value"],"properties":{"field":{"type":"string","enum":["archived"],"example":"archived"},"op":{"type":"string","enum":["$eq"],"example":"$eq"},"value":{"type":"boolean","example":true}}}}}},"ListItemQueryFilter":{"type":"object","required":["field","op","value"],"properties":{"field":{"type":"string","enum":["primary_value","secondary_value","archived"],"description":"List Item field name","example":"primary_value"},"op":{"type":"string","enum":["$eq"],"example":"$eq"},"value":{"x-types":{"isMultipleTypes":true,"values":["str?","bool?"]},"oneOf":[{"type":"string"},{"type":"boolean"}],"description":"Can be string or bool","example":"effb8e3c-084c-4d3e-b7ee-f8741b79c8d2"}}},"ListItemOrQueryFilter":{"type":"object","required":["value","op"],"properties":{"op":{"type":"string","enum":["$or"],"example":"$or"},"value":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/ListItemQueryFilter"}}}},"UpdateListItemRequest":{"allOf":[{"type":"object","required":["comment"],"properties":{"comment":{"type":"string","maxLength":2048,"description":"An arbitrary string that can be used to eg. explain why this List Item was created. Often useful to display to other users.","example":"Listed due to manual investigation"}}}]},"UnarchiveListItemRequest":{"allOf":[{"type":"object","properties":{"auto_archives_at":{"type":"string","nullable":true,"format":"date-time","description":"Time after which a the List Item will be automatically archived and no longer matched against each event. A value of `null` means auto archivation is disabled and the record will stay active in the list forever.","example":"2021-09-27T16:46:38.313Z"}}}]},"BaseList":{"type":"object","description":"List","properties":{"name":{"type":"string","maxLength":255,"description":"Name of the List","example":"Malicious IPs"},"description":{"type":"string","maxLength":255,"nullable":true,"description":"Description of the List","example":"We block these IPs from withdrawing funds. Please be careful."},"color":{"$ref":"#/components/schemas/ListColor"},"default_item_archivation_time":{"type":"integer","nullable":true,"minimum":1,"maximum":63113904,"description":"Default time, in seconds, after which Items in this List automatically gets archived after they are created. It is possible to override this value when creating the individual List Items","example":2592000}}},"List":{"allOf":[{"$ref":"#/components/schemas/BaseList"},{"type":"object","description":"List","required":["id","name","color","primary_field"],"properties":{"id":{"type":"string","example":"2ee938c8-24c2-4c26-9d25-19511dd75029"},"managed":{"type":"boolean","description":"Indicates whether this List is managed by Castle. Managed lists are read-only and maintained by Castle.","example":false},"primary_field":{"$ref":"#/components/schemas/ListPrimaryField"},"secondary_field":{"$ref":"#/components/schemas/ListSecondaryField"},"archived_at":{"nullable":true,"type":"string","description":"Timestamp of when the List was archived. If this value is `null`, it means the list is active.","format":"date-time","example":"2021-09-27T16:46:38.313Z"},"created_at":{"type":"string","format":"date-time","example":"2021-09-27T16:46:38.313Z"}}}]},"ListColor":{"type":"string","description":"Color assigned to the List. These colors can be used to represent different sentiments, such as red for blocked records or green for trusted.","enum":["$red","$orange","$yellow","$green","$blue","$purple","$gray","$black"],"example":"$red"},"ListPrimaryField":{"type":"string","description":"Event field for which the List Item value will be matched against, such as `user.id` or `device.fingerprint`.","maxLength":255,"example":"device.fingerprint"},"ListSecondaryField":{"type":"string","nullable":true,"maxLength":255,"description":"A secondary event field for which the List Item value will be matched against. Warning: make sure you input a correct field name","example":"ip.value"},"UpdateListRequest":{"allOf":[{"$ref":"#/components/schemas/BaseList"},{"type":"object"}]},"ListRequest":{"allOf":[{"$ref":"#/components/schemas/BaseList"},{"type":"object","required":["name","color","primary_field"],"properties":{"primary_field":{"$ref":"#/components/schemas/ListPrimaryField"},"secondary_field":{"$ref":"#/components/schemas/ListSecondaryField"}}}]},"ListList":{"type":"array","description":"List of Lists","items":{"type":"object","$ref":"#/components/schemas/List"}},"ListQuery":{"type":"object","description":"List Query","properties":{"filters":{"type":"array","maxItems":100,"x-discriminator-field":"op","items":{"type":"object","x-model-names":["ListQueryFilter","ListOrQueryFilter"],"oneOf":[{"$ref":"#/components/schemas/ListQueryFilter"},{"$ref":"#/components/schemas/ListOrQueryFilter"}],"discriminator":{"propertyName":"op","mapping":{"$eq":"#/components/schemas/ListQueryFilter","$or":"#/components/schemas/ListOrQueryFilter"}}},"description":"Additional filters to query lists by fields and archival status","example":[{"field":"primary_field","op":"$eq","value":"device.fingerprint"},{"field":"archived","op":"$eq","value":false},{"op":"$or","value":[{"field":"secondary_field","op":"$eq","value":"user.id"}]},{"op":"$or","value":[{"field":"secondary_field","op":"$eq","value":"user.email"}]}]},"page":{"description":"Page number","minimum":1,"maximum":1000,"type":"integer","example":2},"results_size":{"description":"How many records to show per page","type":"integer","minimum":1,"maximum":100,"example":50},"include_size_label":{"description":"Whether to include the size label in the response","type":"boolean","example":true},"sort":{"type":"object","description":"List sort order, based on creation timestamp","required":["field","order"],"properties":{"field":{"type":"string","enum":["created_at"],"example":"created_at","description":"\"created_at\" is the only allowed field for sorting Lists"},"order":{"type":"string","enum":["asc","desc"],"example":"asc"}}}}},"ListQueryResponse":{"type":"array","description":"List Query Response","items":{"allOf":[{"$ref":"#/components/schemas/List"},{"type":"object","properties":{"size_label":{"type":"string","description":"The size label of the list. This is only returned if `include_size_label` is set to `true` in the request.","example":"9852"}}}]}},"ListQueryFilter":{"type":"object","required":["field","op","value"],"properties":{"field":{"type":"string","enum":["primary_field","secondary_field","archived"],"description":"List field name","example":"primary_field"},"op":{"type":"string","enum":["$eq"],"example":"$eq"},"value":{"x-types":{"isMultipleTypes":true,"values":["str?","bool?"]},"oneOf":[{"type":"string"},{"type":"boolean"}],"description":"Can be string or bool","example":"effb8e3c-084c-4d3e-b7ee-f8741b79c8d2"}}},"ListOrQueryFilter":{"type":"object","required":["value","op"],"properties":{"op":{"type":"string","enum":["$or"],"example":"$or"},"value":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/ListQueryFilter"}}}},"AggregationBase":{"type":"object","description":"Aggregation","properties":{"name":{"type":"string","maxLength":255,"description":"Human-readable name of the aggregation","example":"Critical Events per IP in 1h"},"description":{"type":"string","maxLength":255,"nullable":true,"description":"Description of the aggregation","example":"Maximum Account TakeOver score seen per IP in the last day."},"interval":{"type":"integer","description":"Time interval in seconds over which aggregation should be observed. Maximum is 180 days.","example":86400,"minimum":0,"maximum":15552000},"group_by":{"type":"object","nullable":true,"properties":{"fields":{"type":"array","description":"The fields names to group by","maxItems":5,"minItems":1,"items":{"type":"object","required":["field"],"properties":{"field":{"type":"string","maxLength":255,"minLength":1,"example":"ip.address"}}}}}},"filters":{"type":"array","maxItems":100,"x-discriminator-field":"op","items":{"type":"object","x-model-names":["QueryFilter","ExistsQueryFilter","RangeQueryFilter","RelativeRangeQueryFilter","OrQueryFilter","ArrayMatchQueryFilter"],"oneOf":[{"$ref":"#/components/schemas/QueryFilter"},{"$ref":"#/components/schemas/ExistsQueryFilter"},{"$ref":"#/components/schemas/RangeQueryFilter"},{"$ref":"#/components/schemas/RelativeRangeQueryFilter"},{"$ref":"#/components/schemas/OrQueryFilter"},{"$ref":"#/components/schemas/ArrayMatchQueryFilter"}]},"description":"Event filters to define when aggregation should be triggered."},"value":{"type":"object","description":"Field name where to get the value from for the aggregation","required":["field"],"properties":{"field":{"type":"string","description":"Field name","example":"scores.account_takeover.score"}}}}},"AggregationRequest":{"x-model-names":["AggregationRequestWithValue","AggregationRequestWithoutValue"],"x-discriminator-field":"aggregation_type","type":"object","oneOf":[{"$ref":"#/components/schemas/AggregationRequestWithValue"},{"$ref":"#/components/schemas/AggregationRequestWithoutValue"}],"discriminator":{"propertyName":"aggregation_type","mapping":{"$avg":"#/components/schemas/AggregationRequestWithValue","$count":"#/components/schemas/AggregationRequestWithoutValue","$count_uniq":"#/components/schemas/AggregationRequestWithValue","$first":"#/components/schemas/AggregationRequestWithValue","$last":"#/components/schemas/AggregationRequestWithValue","$max":"#/components/schemas/AggregationRequestWithValue","$min":"#/components/schemas/AggregationRequestWithValue","$sum":"#/components/schemas/AggregationRequestWithValue"}}},"AggregationRequestWithValue":{"type":"object","allOf":[{"$ref":"#/components/schemas/AggregationBase"},{"type":"object","required":["name","aggregation_type","interval","value"],"properties":{"aggregation_type":{"type":"string","enum":["$avg","$count_uniq","$first","$last","$max","$min","$sum"]},"metadata":{"$ref":"#/components/schemas/Metadata"}}}]},"AggregationRequestWithoutValue":{"type":"object","allOf":[{"$ref":"#/components/schemas/AggregationBase"},{"type":"object","required":["name","aggregation_type","interval"],"properties":{"aggregation_type":{"type":"string","enum":["$count"]},"metadata":{"$ref":"#/components/schemas/Metadata"}}}]},"FormulaRequest":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Formula name"},"value":{"type":"string","description":"Formula to calculate value"}}},"Metadata":{"type":"object","description":"Metadata is useful for providing additional, structured information on an object.","allOf":[{"properties":{"whodunnit":{"type":"string","maxLength":255},"whodunnit_type":{"$ref":"#/components/schemas/AuthorType"}}},{"additionalProperties":{"oneOf":[{"type":"string","maxLength":255},{"type":"number"},{"type":"boolean"}]},"maxProperties":20}]},"FilterRequest":{"allOf":[{"$ref":"#/components/schemas/BaseRequest"},{"type":"object","required":["context","request_token"],"properties":{"request_token":{"description":"Token generated from a client. Check out our [quick start guide](https://docs.castle.io/docs/quickstart)\nto generate a `request_token`.\n\n**Note:** This field can be skipped by setting `skip_request_token_validation` to `true`.\n","type":"string","format":"request_token","example":"test_lZWva9rsNe3u0_EIc6R8V3t5beV38piPAQbhgREGygYCAo2FRSv1tAQ4-cb6ArKHOWK_zG18hO1uZ8K0LDbNqU9njuhscoLyaj3NyGxyiO0iS4ziIkm-oVom3LEsN9i6InSbuzo-w7ErJqrkYW2CrjA23LEyN92wIkCE82dggvktPtWvMmrl42Bj2uM7Zdn2AQGXC6qGTIECRlwaAgZcgcAGeX4"},"user":{"type":"object","properties":{"email":{"type":"string","description":"The identified user's email address","example":"Rhea.Franecki@example.org","deprecated":true},"phone":{"description":"The identified user's phone number","type":"string","example":"+16175551212","deprecated":true}}},"params":{"type":"object","properties":{"email":{"type":"string","description":"The email address sent by the user","example":"Rhea.Franecki@example.org"},"phone":{"description":"The phone number sent by the user","type":"string","example":"+16175551212"},"username":{"description":"The username sent by the user","type":"string","example":"superhero123"}}},"matching_user_id":{"description":"User id related connected with the request","type":"string","example":"123"}}},{"$ref":"#/components/schemas/RequestWithOptionalValidation"},{"$ref":"#/components/schemas/RequestWithExpand"}]},"RegistrationFilterRequest":{"allOf":[{"$ref":"#/components/schemas/FilterRequest"},{"type":"object","required":["type"],"properties":{"type":{"type":"string","description":"Castle supported events available for this endpoint","default":"$registration","enum":["$registration"]},"status":{"type":"string","default":"$attempted","enum":["$attempted","$failed"]},"authentication_method":{"$ref":"#/components/schemas/AuthenticationMethod"}}}]},"LoginFilterRequest":{"allOf":[{"$ref":"#/components/schemas/FilterRequest"},{"type":"object","required":["type"],"properties":{"type":{"type":"string","description":"Castle supported events available for this endpoint","default":"$login","enum":["$login"]},"status":{"type":"string","default":"$attempted","enum":["$attempted","$failed"]},"authentication_method":{"$ref":"#/components/schemas/AuthenticationMethod"}}}]},"PasswordResetFilterRequest":{"allOf":[{"$ref":"#/components/schemas/FilterRequest"},{"type":"object","required":["type"],"properties":{"type":{"type":"string","description":"Castle supported events available for this endpoint","default":"$password_reset_request","enum":["$password_reset_request"]},"status":{"type":"string","default":"$attempted","enum":["$attempted","$succeeded","$failed"]}}}]},"TransactionFilterRequest":{"allOf":[{"$ref":"#/components/schemas/FilterRequest"},{"type":"object","required":["type"],"properties":{"type":{"type":"string","description":"Castle supported events available for this endpoint","default":"$transaction","enum":["$transaction"]},"status":{"type":"string","default":"$attempted","enum":["$attempted","$succeeded","$failed"]},"transaction":{"$ref":"#/components/schemas/Transaction"}}}]},"CustomFilterRequest":{"allOf":[{"$ref":"#/components/schemas/FilterRequest"},{"type":"object","required":["type"],"properties":{"type":{"type":"string","description":"Castle supported events available for this endpoint","default":"$custom","enum":["$custom"]},"name":{"type":"string","description":"Your custom name of the event.","maxLength":255},"status":{"type":"string","nullable":true,"enum":["$attempted","$succeeded","$failed",null]}}}]},"RiskRequest":{"allOf":[{"$ref":"#/components/schemas/BaseRequest"},{"type":"object","required":["context","type","request_token","status","user"],"properties":{"request_token":{"description":"Token generated from a client. Check out our [quick start guide](/v1/getting-started)\nto generate a `request_token`.\n\n**Note:** This field can be skipped by setting `skip_request_token_validation` to `true`.\n","type":"string","example":"test_lZWva9rsNe3u0_EIc6R8V3t5beV38piPAQbhgREGygYCAo2FRSv1tAQ4-cb6ArKHOWK_zG18hO1uZ8K0LDbNqU9njuhscoLyaj3NyGxyiO0iS4ziIkm-oVom3LEsN9i6InSbuzo-w7ErJqrkYW2CrjA23LEyN92wIkCE82dggvktPtWvMmrl42Bj2uM7Zdn2AQGXC6qGTIECRlwaAgZcgcAGeX4"},"user":{"$ref":"#/components/schemas/UserForMonitorAndRisk"}}},{"$ref":"#/components/schemas/RequestWithOptionalValidation"},{"$ref":"#/components/schemas/RequestWithExpand"}]},"RegistrationRiskRequest":{"allOf":[{"$ref":"#/components/schemas/RiskRequest"},{"type":"object","required":["type"],"properties":{"type":{"type":"string","description":"Castle supported events available for this endpoint","default":"$registration","enum":["$registration"]},"status":{"type":"string","default":"$succeeded","enum":["$succeeded"]},"authentication_method":{"$ref":"#/components/schemas/AuthenticationMethod"}}}]},"LoginRiskRequest":{"allOf":[{"$ref":"#/components/schemas/RiskRequest"},{"type":"object","required":["type"],"properties":{"type":{"type":"string","description":"Castle supported events available for this endpoint","default":"$login","enum":["$login"]},"status":{"type":"string","default":"$succeeded","enum":["$succeeded"]},"authentication_method":{"$ref":"#/components/schemas/AuthenticationMethod"}}}]},"LogoutRiskRequest":{"allOf":[{"$ref":"#/components/schemas/RiskRequest"},{"type":"object","required":["type"],"properties":{"type":{"type":"string","description":"Castle supported events available for this endpoint","default":"$logout","enum":["$logout"]},"status":{"type":"string","default":"$succeeded","enum":["$succeeded"]}}}]},"TransactionRiskRequest":{"allOf":[{"$ref":"#/components/schemas/RiskRequest"},{"type":"object","required":["type","status"],"properties":{"type":{"type":"string","description":"Castle supported events available for this endpoint","default":"$transaction","enum":["$transaction"]},"status":{"type":"string","default":"$succeeded","enum":["$attempted","$succeeded","$failed"]},"transaction":{"$ref":"#/components/schemas/Transaction"}}}]},"TransactionResponse":{"allOf":[{"$ref":"#/components/schemas/LoginResponse/allOf/0"},{"type":"object","required":["type"],"properties":{"type":{"type":"string","description":"Castle supported events available for this endpoint","default":"$transaction","enum":["$transaction"]},"status":{"type":"string","default":"$attempted","enum":["$attempted","$succeeded","$failed"]},"transaction":{"$ref":"#/components/schemas/Transaction"}}}]},"LoginResponse":{"allOf":[{"type":"object","required":["policy","signals","device"],"properties":{"risk":{"description":"Deprecated Risk Score - use `scores` instead. Calculated only when `request_token` and `context` are provided.","deprecated":true,"minimum":0,"maximum":1,"type":"number","readOnly":true,"example":0.65},"scores":{"readOnly":true,"description":"Castle Scores breakdown. Calculated only when `request_token` and `context` are provided.","type":"object","required":["account_abuse","account_takeover","bot"],"properties":{"account_abuse":{"type":"object","required":["score"],"properties":{"score":{"description":"Calculated Account Abuse Risk Score.","minimum":0,"maximum":1,"type":"number","readOnly":true,"example":0.65}}},"account_takeover":{"type":"object","required":["score"],"properties":{"score":{"description":"Calculated Account Takeover Risk Score.","minimum":0,"maximum":1,"type":"number","readOnly":true,"example":0.77}}},"bot":{"type":"object","required":["score"],"properties":{"score":{"description":"Calculated Bot Risk Score.","minimum":0,"maximum":1,"type":"number","readOnly":true,"example":0.34}}}}},"policy":{"readOnly":true,"$ref":"#/components/schemas/Policy"},"signals":{"description":"Signals triggered for this event/context","readOnly":true,"type":"object","additionalProperties":{"type":"object"},"example":{"bot_behavior":{},"proxy_ip":{},"disposable_email":{},"spoofed_device":{},"multiple_accounts_per_device":{}}},"agent":{"$ref":"#/components/schemas/Agent"},"metrics":{"description":"Metrics triggered for this event/context","readOnly":true,"type":"object","additionalProperties":{"type":"object"},"example":{"1":{},"2":{},"3":{},"4":{},"5":{}}},"device":{"allOf":[{"$ref":"#/components/schemas/Device"},{"type":"object","readOnly":true,"properties":{"token":{"description":"Device token generated or found","type":"string","readOnly":true,"deprecated":true,"example":"eyJhbGciOiJIUzI1NiJ9.eyJ0b2tlbiI6IjEzc2x6RzNHQ0RzeFJCejdJWF9SUDJkV1Y0RFgiLCJxdWFsaWZpZXIiOiJBUUlEQ2pFME5EZzFPREF3T1RZIiwiYW5vbnltb3VzIjpmYWxzZSwidmVyc2lvbiI6MC4zfQ.y3vOt-W1IpOi7Oyn1jll1uDw1YL-JPZtNMTU-PyaYhQ"}}}]},"id":{"type":"string","description":"Castle Event ID","readOnly":true,"example":"ASZoelALT5-PaVw2pAVMXg"},"name":{"type":"string","description":"Event Full Name","example":"Login Succeeded"},"type":{"type":"string","description":"Event type","readOnly":true,"example":"$login"},"status":{"type":"string","description":"Event status","readOnly":true,"example":"$succeeded"},"created_at":{"type":"string","format":"date-time","readOnly":true,"description":"Event timestamp","example":"2021-09-27T16:46:38.313Z"},"authenticated":{"type":"boolean","readOnly":true,"description":"Authenticated or Anonymous visitor","example":true},"authentication_method":{"$ref":"#/components/schemas/AuthenticationMethod","description":"Indicates Authentication Method included in the request"},"email":{"type":"object","readOnly":true,"description":"User Email Object","properties":{"normalized":{"type":"string","example":"user.email@example.com"},"domain":{"type":"string","example":"gmail.com"},"disposable":{"type":"boolean","example":false},"unreachable":{"type":"boolean","example":false},"domain_details":{"type":"object","properties":{"created_at":{"type":"string","format":"date-time","example":"2021-09-27T16:46:38.313Z"},"updated_at":{"type":"string","format":"date-time","example":"2021-09-27T16:46:38.313Z"},"expires_at":{"type":"string","format":"date-time","example":"2021-09-27T16:46:38.313Z"},"registrar":{"type":"string"},"nameservers":{"type":"array","items":{"type":"string"},"example":["ns1.hosting.com","ns2.hosting.com","ns3.hosting.com"]},"spf_record":{"type":"object","properties":{"exists":{"type":"boolean","nullable":true,"example":false}}},"dmarc_record":{"type":"object","properties":{"exists":{"type":"boolean","nullable":true,"example":false}}},"mx_records":{"type":"object","properties":{"null_mx":{"type":"boolean","nullable":true,"example":false}}}}}}},"endpoint":{"type":"string","readOnly":true,"description":"Castle Request Endpoint","example":"/v1/risk"},"ip":{"$ref":"#/components/schemas/IP"},"params":{"$ref":"#/components/schemas/EventParams"},"product":{"$ref":"#/components/schemas/Product"},"sdks":{"type":"object","readOnly":true,"description":"Castle SDKs details","properties":{"client":{"type":"object","properties":{"name":{"type":"string","example":"castle-web"},"version":{"type":"string","example":"2.0.0"}}},"server":{"type":"object","properties":{"name":{"type":"string","example":"castle-postman"},"version":{"type":"string","example":"0.1.0"}}}}},"session":{"$ref":"#/components/schemas/Session"},"user":{"$ref":"#/components/schemas/UserForMonitorAndRisk"},"behavior":{"type":"object","properties":{"fingerprint":{"type":"string","nullable":true,"example":"vOch_0a_fpkl1Tf-pVPuDA"}}},"properties":{"$ref":"#/components/schemas/Properties"}}},{"type":"object","required":["type"],"properties":{"type":{"type":"string","description":"Castle supported events available for this endpoint","default":"$login","enum":["$login"]},"status":{"type":"string","default":"$attempted","enum":["$succeeded","$failed","$attempted"]},"authentication_method":{"$ref":"#/components/schemas/AuthenticationMethod"}}}]},"RegistrationResponse":{"allOf":[{"$ref":"#/components/schemas/LoginResponse/allOf/0"},{"type":"object","required":["type"],"properties":{"type":{"type":"string","description":"Castle supported events available for this endpoint","default":"$registration","enum":["$registration"]},"status":{"type":"string","default":"$attempted","enum":["$succeeded","$failed","$attempted"]},"authentication_method":{"$ref":"#/components/schemas/AuthenticationMethod"}}}]},"ProfileUpdateResponse":{"allOf":[{"$ref":"#/components/schemas/LoginResponse/allOf/0"},{"type":"object","required":["type"],"properties":{"type":{"type":"string","description":"Castle supported events available for this endpoint","default":"$profile_update","enum":["$profile_update"]},"status":{"type":"string","default":"$succeeded","enum":["$attempted","$succeeded","$failed"]},"changeset":{"$ref":"#/components/schemas/Changeset"}}}]},"ProfileResetResponse":{"allOf":[{"$ref":"#/components/schemas/LoginResponse/allOf/0"},{"type":"object","required":["type"],"properties":{"type":{"type":"string","description":"Castle supported events available for this endpoint","default":"$profile_reset","enum":["$profile_reset"]},"status":{"type":"string","default":"$succeeded","enum":["$attempted","$succeeded","$failed"]},"changeset":{"$ref":"#/components/schemas/Changeset"}}}]},"LogoutResponse":{"allOf":[{"$ref":"#/components/schemas/LoginResponse/allOf/0"},{"type":"object","required":["type"],"properties":{"type":{"type":"string","description":"Castle supported events available for this endpoint","default":"$logout","enum":["$logout"]},"status":{"type":"string","default":"$succeeded","enum":["$succeeded","$failed","$attempted"]}}}]},"CustomResponse":{"allOf":[{"$ref":"#/components/schemas/LoginResponse/allOf/0"},{"type":"object","required":["type"],"properties":{"type":{"type":"string","description":"Castle supported events available for this endpoint","default":"$custom","enum":["$custom"]},"status":{"type":"string","default":"$succeeded","enum":["$succeeded","$failed","$attempted"]}}}]},"ChallengeResponse":{"allOf":[{"$ref":"#/components/schemas/LoginResponse/allOf/0"},{"type":"object","required":["type"],"properties":{"type":{"type":"string","description":"Castle supported events available for this endpoint","default":"$challenge","enum":["$challenge"]},"status":{"type":"string","default":"$succeeded","enum":["$succeeded","$failed","$attempted"]}}}]},"ProfileUpdateRiskRequest":{"allOf":[{"$ref":"#/components/schemas/RiskRequest"},{"type":"object","required":["type"],"properties":{"type":{"type":"string","description":"Castle supported events available for this endpoint","default":"$profile_update","enum":["$profile_update"]},"status":{"type":"string","default":"$succeeded","enum":["$attempted","$succeeded","$failed"]},"changeset":{"$ref":"#/components/schemas/Changeset"}}}]},"ProfileResetRiskRequest":{"allOf":[{"$ref":"#/components/schemas/RiskRequest"},{"type":"object","required":["type"],"properties":{"type":{"type":"string","description":"Castle supported events available for this endpoint","default":"$profile_reset","enum":["$profile_reset"]},"status":{"type":"string","default":"$succeeded","enum":["$attempted","$succeeded","$failed"]},"changeset":{"$ref":"#/components/schemas/Changeset"}}}]},"CustomRiskRequest":{"allOf":[{"$ref":"#/components/schemas/RiskRequest"},{"type":"object","required":["type"],"properties":{"type":{"type":"string","description":"Castle supported events available for this endpoint","default":"$custom","enum":["$custom"]},"name":{"type":"string","description":"Your custom name of the event.","maxLength":255},"status":{"type":"string","nullable":true,"enum":["$attempted","$succeeded","$failed",null]}}}]},"Context":{"type":"object","required":["ip","headers"],"description":"The context object contains information about the originating request, including IP address and HTTP headers.\n\n**Note:** This field can be skipped by setting `skip_context_validation` to `true`.\n","properties":{"headers":{"description":"The Headers object of the originating request. \nFor best results, it's recommended to forward all headers from the originating request. At minimum, the following headers should be forwarded: `Host`, `User-Agent`, `Accept`, `Accept-Encoding`, `Accept-Language`.\n\nFor [AI agent identification](https://docs.castle.io/docs/ai-agent-identification), also forward `Signature-Input`, `Signature` and `Signature-Agent`, and the originally requested `Host`.\n","type":"array","items":{"description":"An array of header values with key as the first element and the value as the second.\nPass the string value as-is for the best calculation.\n","type":"array","maxItems":2,"minItems":2,"items":{"oneOf":[{"type":"string"},{"type":"boolean"},{"type":"integer"}]}},"example":[["User-Agent","Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.1 Safari/605.1.15"],["Accept-Encoding","gzip, deflate, br"],["Accept-Language","en-us"],["Accept","text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"],["Connection","close"],["Host","castle.io"]]},"ip":{"type":"string","description":"The IPv4 or IPv6 address of the originating request. Must be a valid, public IP. Supports ipv4\nand ipv6\n","example":"211.96.77.55"}}},"Error":{"type":"object","readOnly":true,"required":["type","message"],"properties":{"type":{"type":"string","readOnly":true,"enum":["record_invalid","bad_request","unauthorized","record_not_found","forbidden","missing_headers","invalid_header_value","invalid_request_token","service_unavailable","server_error","route_not_found","inexecutable_formula","unparsable_formula"]},"message":{"readOnly":true,"description":"reason for error message","type":"string"}}},"RecordInvalidError":{"type":"object","readOnly":true,"required":["type","message"],"properties":{"type":{"type":"string","readOnly":true,"enum":["record_invalid"]},"message":{"readOnly":true,"description":"reason for error message","type":"string"}}},"Score":{"type":"object","required":["score"],"properties":{"score":{"type":"number","nullable":true,"example":0.396}}},"SearchSchema":{"type":"object","required":["fields","buckets"],"properties":{"fields":{"type":"array","items":{"$ref":"#/components/schemas/SearchField"}},"buckets":{"type":"array","x-discriminator-field":"type","items":{"x-model-names":["DateHistogramBucket","RangeBucket","CountBucket","GeoHashBucket"],"anyOf":[{"$ref":"#/components/schemas/CountBucket"},{"$ref":"#/components/schemas/DateHistogramBucket"},{"$ref":"#/components/schemas/RangeBucket"}]}}}},"SearchField":{"type":"object","required":["field","op","func","type","nice_name","description"],"properties":{"field":{"type":"string","description":"Name of the field","example":"user.id"},"op":{"type":"array","description":"List of operations that can be performed on this field","items":{"$ref":"#/components/schemas/Op"},"example":["$eq","$neq"]},"func":{"type":"array","description":"List of functions that can be applied on this field","items":{"$ref":"#/components/schemas/Func"},"example":["$top_k"]},"transform":{"type":"array","description":"List of transformations that can be applied on this field","items":{"$ref":"#/components/schemas/Transforms"}},"type":{"$ref":"#/components/schemas/DataType"},"nice_name":{"type":"string","description":"Human-readable name of the field","example":"User ID"},"description":{"type":"string","description":"Human-readable description of the field","example":"User ID sent by the client to Castle"},"min":{"description":"Minimal value for the field","x-types":{"isMultipleTypes":true,"values":["str?","int?","float?"]},"oneOf":[{"type":"string"},{"type":"number"}]},"max":{"description":"Maximal value for the field","x-types":{"isMultipleTypes":true,"values":["str?","int?","float?"]},"oneOf":[{"type":"string"},{"type":"number"}]},"enum":{"type":"array","description":"List of possible values for this field","items":{"type":"string"}},"source":{"type":"array","description":"Indicates which SDKs can send this field","items":{"type":"string","enum":["ios","android","web"]}},"example":{"type":"string","description":"Example value of this field","example":"9610c462-fe50-4e6e-a714-9c4377be209d"},"unit":{"type":"string","description":"Unit of the field. This can be '%' for battery_level, 'ms' for time, etc."}}},"BaseBucket":{"type":"object","required":["name","field"],"properties":{"name":{"type":"string","description":"Name of the aggregation","example":"user_id_count"},"field":{"type":"string","description":"Name of the field the bucket is based on","example":"user.id"}}},"CountBucket":{"allOf":[{"$ref":"#/components/schemas/BaseBucket"},{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["$count"],"example":"$count"},"options":{"type":"object","properties":{"size":{"type":"object","required":["data_type"],"properties":{"data_type":{"type":"string","default":"integer","enum":["integer"]}}}}}}}]},"GeoHashBucket":{"allOf":[{"$ref":"#/components/schemas/BaseBucket"},{"type":"object","required":["type","options"],"properties":{"type":{"type":"string","enum":["$geo_hash"],"example":"$geo_hash"},"options":{"type":"object","required":["precision"],"properties":{"precision":{"type":"object","required":["data_type"],"properties":{"data_type":{"type":"string","default":"integer","enum":["integer"]}}}}}}}]},"DateHistogramBucket":{"allOf":[{"$ref":"#/components/schemas/BaseBucket"},{"type":"object","required":["type","options"],"properties":{"name":{"type":"string","example":"created_at_histogram"},"type":{"type":"string","enum":["$date_histogram"]},"options":{"type":"object","required":["interval"],"properties":{"interval":{"type":"object","required":["required","data_type","enum"],"properties":{"required":{"type":"boolean"},"data_type":{"type":"string","default":"string","enum":["string"]},"enum":{"type":"array","items":{"type":"string","enum":["1m","2m","3m","4m","5m","6m","10m","15m","20m","30m","1h","2h","3h","4h","6h","8h","12h","1d","36h","2d","60h","3d","84h","4d","108h","5d","132h","6d","7d","10d","14d"]},"example":["1m","2m","5m"]}}},"min":{"type":"object","required":["data_type"],"properties":{"data_type":{"type":"string","default":"string","enum":["string"]},"format":{"type":"array","items":{"type":"string","enum":["date-time"]}}}},"max":{"type":"object","required":["data_type"],"properties":{"data_type":{"type":"string","default":"string","enum":["string"]},"format":{"type":"array","items":{"type":"string","enum":["date-time"]}}}},"size":{"type":"object","required":["data_type"],"properties":{"data_type":{"type":"string","default":"integer","enum":["integer"]}}}}}}}]},"RangeBucket":{"allOf":[{"$ref":"#/components/schemas/BaseBucket"},{"type":"object","required":["type","options"],"properties":{"name":{"type":"string","example":"risk_count"},"type":{"type":"string","enum":["$range"]},"options":{"type":"object","required":["ranges"],"properties":{"ranges":{"type":"object","required":["required","data_type"],"properties":{"required":{"type":"boolean"},"data_type":{"type":"string","enum":["string","number"],"example":"string"}}}}}}}]},"UserForMonitorAndRisk":{"type":"object","required":["id"],"properties":{"id":{"description":"A unique user identifier","type":"string","minLength":1,"maxLength":255},"email":{"description":"The identified user's email address","type":"string"},"phone":{"description":"The identified user's phone number E.164 formatted","type":"string","format":"E.164"},"registered_at":{"description":"The ISO8601 timestamp of the user's account creation","type":"string","format":"date-time"},"name":{"description":"The full name of the user","type":"string"},"traits":{"description":"Known traits of the identified user","nullable":true,"type":"object"},"address":{"$ref":"#/components/schemas/Address"}}},"RequestWithOptionalValidation":{"type":"object","properties":{"skip_request_token_validation":{"description":"Skip `request_token` validation. Enable when it's impossible to obtain Castle request_token (e.g., third-party API calls).\nWhen enabled, Castle risk scores are not calculated.\n\nSet to `true` to make the `request_token` field optional.\n","type":"boolean","default":false},"skip_context_validation":{"description":"Skip `context` validation. Enable when HTTP request context is not providing useful insight\n(e.g., third-party API calls from Data Center IP).\n\nSet to `true` to make the `context` field optional.\n","type":"boolean","default":false}}},"RequestWithExpand":{"type":"object","properties":{"expand":{"description":"Include additional properties into API response.\n*This option is currently in beta and available only to select customers.*\n","type":"array","items":{"type":"string"},"example":["all"]}}}},"responses":{"NotFound":{"description":"Not found"},"Conflict":{"description":"Entity is being modified by a concurrent request."},"Accepted":{"description":"Accepted"},"Unauthorized":{"description":"You are missing the Authorization header, or the API secret is missing or incorrect."},"Forbidden":{"description":"The request is rejected because the service is not enabled for this account."},"UnprocessableEntity":{"description":"The request body is unprocessable by the API. Make sure it conforms to the specified format for the endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordInvalidError"}}}},"TooManyRequests":{"description":"You performed too many requests. You should back off and retry using the exponential backoff algorithm."},"InternalServerError":{"description":"There’s an issue on our end."}},"securitySchemes":{"Basic":{"type":"http","scheme":"basic","description":"API keys are used to authenticate all Castle APIs. In the [Castle Dashboard](https://dashboard.castle.io) you can view and manage your API keys.\n\n**Castle API keys are secret. Make sure to not share them in publicly accessible areas such as GitHub or client-side code.**\n\nAll endpoints are authenticated via [HTTP Basic Auth](http://en.wikipedia.org/wiki/Basic_access_authentication), using password and **no username**. This means setting the value of the  `Authorization` header to a Base64 encoded string using your API_SECRET with a leading \":\", eg. `\"Basic\" + base64(:API_SECRET)`. If the authorization header is missing or incorrect, the API will respond with `401`.\n"}}}}
