{"openapi":"3.1.0","paths":{"/api/v1/contexts/{type}/{id}/api-keys":{"post":{"summary":"Create a new API key","tags":["apiKeys"],"parameters":[{"name":"type","in":"path","required":true,"schema":{"type":"string","enum":["organization","partner","customer"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"organizationId","in":"path","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"scopes":{"type":"array","items":{"type":"string"}}},"required":["name"]}}}},"responses":{"201":{"description":"201","content":{"application/json":{"schema":{"type":"object","properties":{"apiKey":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"context":{"type":"object","properties":{"type":{"type":"string","enum":["organization","partner","customer"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"organizationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["type","id"],"additionalProperties":false},"name":{"type":"string"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"lastUsedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"createdBy":{"type":["string","null"]},"scopes":{"type":"array","items":{"type":"string"}},"webhookSecret":{"type":["string","null"]}},"required":["id","context","name","createdAt","expiresAt","lastUsedAt","createdBy","webhookSecret"],"additionalProperties":false},"key":{"type":"string"}},"required":["apiKey","key"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}},"get":{"summary":"List all API keys for a context","tags":["apiKeys"],"parameters":[{"name":"type","in":"path","required":true,"schema":{"type":"string","enum":["organization","partner","customer"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"organizationId","in":"path","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"context":{"type":"object","properties":{"type":{"type":"string","enum":["organization","partner","customer"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"organizationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["type","id"],"additionalProperties":false},"name":{"type":"string"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"lastUsedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"createdBy":{"type":["string","null"]},"scopes":{"type":"array","items":{"type":"string"}},"webhookSecret":{"type":["string","null"]}},"required":["id","context","name","createdAt","expiresAt","lastUsedAt","createdBy","webhookSecret"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/contexts/{type}/{id}/api-keys/{apiKeyId}":{"delete":{"summary":"Revoke an API key","tags":["apiKeys"],"parameters":[{"name":"type","in":"path","required":true,"schema":{"type":"string","enum":["organization","partner","customer"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"apiKeyId","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"organizationId","in":"path","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"204":{"description":"204","content":{"application/json":{"schema":{}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/organizations/{organizationId}/customers/{customerId}/applications":{"get":{"summary":"Get all applications for a customer","tags":["applications"],"parameters":[{"name":"organizationId","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"customerId","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"organizationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"customerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1},"slugId":{"type":"string","minLength":3,"maxLength":256,"pattern":"^[a-z0-9-]+$"},"environment":{"default":"production","type":"string","enum":["production","sandbox"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","organizationId","customerId","name","slugId","environment","createdAt","updatedAt"],"additionalProperties":false}},"meta":{"type":"object","properties":{"page":{"type":"number"},"pageSize":{"type":"number"},"hasMore":{"type":"boolean"},"total":{"type":"number"}},"required":["page","pageSize","hasMore"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}},"post":{"summary":"Create a new application","tags":["applications"],"parameters":[{"name":"organizationId","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"customerId","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"customerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1},"slugId":{"type":"string","minLength":1},"environment":{"default":"production","type":"string","enum":["production","sandbox"]}},"required":["customerId","name","slugId"]}}}},"responses":{"201":{"description":"201","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"organizationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"customerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1},"slugId":{"type":"string","minLength":3,"maxLength":256,"pattern":"^[a-z0-9-]+$"},"environment":{"default":"production","type":"string","enum":["production","sandbox"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","organizationId","customerId","name","slugId","environment","createdAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/organizations/{organizationId}/customers/{customerId}/applications/{id}":{"get":{"summary":"Get an application by ID","tags":["applications"],"parameters":[{"name":"organizationId","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"customerId","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"organizationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"customerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1},"slugId":{"type":"string","minLength":3,"maxLength":256,"pattern":"^[a-z0-9-]+$"},"environment":{"default":"production","type":"string","enum":["production","sandbox"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","organizationId","customerId","name","slugId","environment","createdAt","updatedAt"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}},"patch":{"summary":"Update an application","tags":["applications"],"parameters":[{"name":"organizationId","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"customerId","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"slugId":{"type":"string","minLength":1},"environment":{"type":"string","enum":["production","sandbox"]}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"organizationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"customerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1},"slugId":{"type":"string","minLength":3,"maxLength":256,"pattern":"^[a-z0-9-]+$"},"environment":{"default":"production","type":"string","enum":["production","sandbox"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","organizationId","customerId","name","slugId","environment","createdAt","updatedAt"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}},"delete":{"summary":"Delete an application","tags":["applications"],"parameters":[{"name":"organizationId","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"customerId","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"organizationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"customerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1},"slugId":{"type":"string","minLength":3,"maxLength":256,"pattern":"^[a-z0-9-]+$"},"environment":{"default":"production","type":"string","enum":["production","sandbox"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","organizationId","customerId","name","slugId","environment","createdAt","updatedAt"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/dashboards":{"get":{"description":"Returns a paginated list of dashboards the user can access based on their current context and permissions","summary":"List dashboards accessible in current context","tags":["dashboards"],"parameters":[{"name":"q","in":"query","schema":{"type":"string"}},{"name":"customerId","in":"query","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"sort","in":"query","schema":{"type":"string","enum":["asc","desc"]}},{"name":"page","in":"query","schema":{"default":1,"type":"number","minimum":1}},{"name":"limit","in":"query","schema":{"default":100,"type":"number","minimum":1}},{"name":"dateRange","in":"query","style":"deepObject","schema":{"type":"object","properties":{"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}}}},{"name":"refresh","in":"query","schema":{"type":"boolean"}},{"name":"sortBy","in":"query","schema":{"type":"string","enum":["customernumber","name"]}},{"name":"visibility","in":"query","schema":{"type":"string","enum":["private","internal","public"]}},{"name":"count","in":"query","schema":{"type":"boolean"}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"contextType":{"default":"organization","type":"string","enum":["organization","partner","customer","user"]},"contextId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"visibility":{"default":"internal","type":"string","enum":["private","internal","public"]},"name":{"type":"string","minLength":1},"description":{"type":"string"},"layoutType":{"default":"grid","type":"string","enum":["grid","flex","fixed"]},"isHomePage":{"default":false,"type":"boolean"},"globalFilters":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"date_range"},"label":{"type":"string"},"enabled":{"default":true,"type":"boolean"},"default":{"type":"object","properties":{"preset":{"type":"string"},"custom":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"}},"additionalProperties":false},"timezone":{"type":"string"}},"additionalProperties":false}},"required":["id","type","label","enabled"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"text"},"label":{"type":"string"},"enabled":{"default":true,"type":"boolean"},"placeholder":{"type":"string"},"default":{"type":"string"}},"required":["id","type","label","enabled"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"select"},"label":{"type":"string"},"enabled":{"default":true,"type":"boolean"},"options":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"label":{"type":"string"}},"required":["value","label"],"additionalProperties":false}},"default":{"type":"string"}},"required":["id","type","label","enabled","options"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"multi_select"},"label":{"type":"string"},"enabled":{"default":true,"type":"boolean"},"options":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"label":{"type":"string"}},"required":["value","label"],"additionalProperties":false}},"default":{"type":"array","items":{"type":"string"}}},"required":["id","type","label","enabled","options"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"number_range"},"label":{"type":"string"},"enabled":{"default":true,"type":"boolean"},"min":{"type":"number"},"max":{"type":"number"},"default":{"type":"object","properties":{"from":{"type":"number"},"to":{"type":"number"}},"additionalProperties":false}},"required":["id","type","label","enabled"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"search_filter"},"label":{"type":"string"},"enabled":{"default":true,"type":"boolean"},"placeholder":{"type":"string"},"default":{"type":"string"},"negate":{"type":"boolean"}},"required":["id","type","label","enabled"],"additionalProperties":false}]}},"widgets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"dashboardId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"widgetType":{"type":"string","enum":["counter","piechart","table","timeseries","note"]},"title":{"type":"string"},"description":{"type":"string"},"query":{"type":"string"},"dataset":{"type":"string"},"positionX":{"type":"integer","minimum":0,"maximum":9007199254740991},"positionY":{"type":"integer","minimum":0,"maximum":9007199254740991},"width":{"type":"integer","minimum":1,"maximum":9007199254740991},"height":{"type":"integer","minimum":1,"maximum":9007199254740991},"config":{"anyOf":[{"type":"object","properties":{"legend":{"type":"boolean"},"tooltip":{"type":"boolean"},"colors":{"type":"array","items":{"type":"string"}},"borderStyle":{"type":"string","enum":["none","solid","dashed","dotted"]},"customCss":{"type":"string"},"aiConversationId":{"type":"string"},"chartType":{"type":"string","enum":["line","area","bar"]},"xAxis":{"type":"object","properties":{"dataKey":{"type":"string"},"label":{"type":"string"}},"required":["dataKey"],"additionalProperties":false},"yAxis":{"type":"object","properties":{"label":{"type":"string"},"min":{"type":"number"},"max":{"type":"number"}},"additionalProperties":false}},"required":["chartType","xAxis","yAxis"],"additionalProperties":false},{"type":"object","properties":{"legend":{"type":"boolean"},"tooltip":{"type":"boolean"},"colors":{"type":"array","items":{"type":"string"}},"borderStyle":{"type":"string","enum":["none","solid","dashed","dotted"]},"customCss":{"type":"string"},"aiConversationId":{"type":"string"},"format":{"type":"string","enum":["number","currency","percentage"]},"prefix":{"type":"string"},"suffix":{"type":"string"},"decimals":{"type":"number"},"size":{"type":"string","enum":["small","medium","large","xlarge"]},"currency":{"type":"string"},"locale":{"type":"string"},"accentColor":{"type":"string"},"icon":{"type":"string"},"comparison":{"type":"object","properties":{"enabled":{"type":"boolean"},"type":{"type":"string","enum":["percentage","absolute"]},"period":{"type":"string","enum":["previous","year_ago"]},"invertColors":{"type":"boolean"}},"required":["enabled","type","period"],"additionalProperties":false}},"required":["format"],"additionalProperties":false},{"type":"object","properties":{"legend":{"type":"boolean"},"tooltip":{"type":"boolean"},"colors":{"type":"array","items":{"type":"string"}},"borderStyle":{"type":"string","enum":["none","solid","dashed","dotted"]},"customCss":{"type":"string"},"aiConversationId":{"type":"string"},"donut":{"type":"boolean"},"labelKey":{"type":"string"},"valueKey":{"type":"string"},"showPercentage":{"type":"boolean"},"legendPosition":{"type":"string","enum":["top","bottom","left","right"]},"legendValues":{"type":"string","enum":["none","value","percentage","both"]},"maxSize":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["labelKey","valueKey"],"additionalProperties":false},{"type":"object","properties":{"legend":{"type":"boolean"},"tooltip":{"type":"boolean"},"colors":{"type":"array","items":{"type":"string"}},"borderStyle":{"type":"string","enum":["none","solid","dashed","dotted"]},"customCss":{"type":"string"},"aiConversationId":{"type":"string"},"content":{"default":"","type":"string"}},"required":["content"],"additionalProperties":false},{"type":"object","properties":{"legend":{"type":"boolean"},"tooltip":{"type":"boolean"},"colors":{"type":"array","items":{"type":"string"}},"borderStyle":{"type":"string","enum":["none","solid","dashed","dotted"]},"customCss":{"type":"string"},"aiConversationId":{"type":"string"},"columns":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"header":{"type":"string"},"width":{"type":"number"},"format":{"type":"string","enum":["text","number","currency","date","boolean"]}},"required":["key","header"],"additionalProperties":false}},"pagination":{"type":"boolean"},"pageSize":{"type":"number"}},"required":["columns"],"additionalProperties":false},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}]},"filterMapping":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"enabled":{"type":"boolean"},"mapTo":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["enabled"],"additionalProperties":false}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["dashboardId","widgetType","title","query","dataset","positionX","positionY","width","height","config"],"additionalProperties":false}},"pages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"dashboardId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1},"description":{"type":"string"},"sequenceNumber":{"type":"integer","minimum":0,"maximum":9007199254740991},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["dashboardId","name","sequenceNumber"],"additionalProperties":false}},"createdBy":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["contextType","contextId","visibility","name","layoutType","isHomePage"],"additionalProperties":false}},"meta":{"type":"object","properties":{"page":{"type":"number"},"pageSize":{"type":"number"},"hasMore":{"type":"boolean"},"total":{"type":"number"}},"required":["page","pageSize","hasMore"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"401":{"description":"401","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"500":{"description":"500","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}},"post":{"description":"Creates a new dashboard in the current context or specified context","summary":"Create a new dashboard","tags":["dashboards"],"parameters":[],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"visibility":{"default":"internal","type":"string","enum":["private","internal","public"]},"name":{"type":"string","minLength":1},"description":{"type":"string"},"layoutType":{"default":"grid","type":"string","enum":["grid","flex","fixed"]},"isHomePage":{"default":false,"type":"boolean"},"globalFilters":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"date_range"},"label":{"type":"string"},"enabled":{"default":true,"type":"boolean"},"default":{"type":"object","properties":{"preset":{"type":"string"},"custom":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"}}},"timezone":{"type":"string"}}}},"required":["id","type","label"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"text"},"label":{"type":"string"},"enabled":{"default":true,"type":"boolean"},"placeholder":{"type":"string"},"default":{"type":"string"}},"required":["id","type","label"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"select"},"label":{"type":"string"},"enabled":{"default":true,"type":"boolean"},"options":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"label":{"type":"string"}},"required":["value","label"]}},"default":{"type":"string"}},"required":["id","type","label","options"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"multi_select"},"label":{"type":"string"},"enabled":{"default":true,"type":"boolean"},"options":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"label":{"type":"string"}},"required":["value","label"]}},"default":{"type":"array","items":{"type":"string"}}},"required":["id","type","label","options"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"number_range"},"label":{"type":"string"},"enabled":{"default":true,"type":"boolean"},"min":{"type":"number"},"max":{"type":"number"},"default":{"type":"object","properties":{"from":{"type":"number"},"to":{"type":"number"}}}},"required":["id","type","label"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"search_filter"},"label":{"type":"string"},"enabled":{"default":true,"type":"boolean"},"placeholder":{"type":"string"},"default":{"type":"string"},"negate":{"type":"boolean"}},"required":["id","type","label"]}]}},"widgets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"dashboardId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"widgetType":{"type":"string","enum":["counter","piechart","table","timeseries","note"]},"title":{"type":"string"},"description":{"type":"string"},"query":{"type":"string"},"dataset":{"type":"string"},"positionX":{"type":"integer","minimum":0,"maximum":9007199254740991},"positionY":{"type":"integer","minimum":0,"maximum":9007199254740991},"width":{"type":"integer","minimum":1,"maximum":9007199254740991},"height":{"type":"integer","minimum":1,"maximum":9007199254740991},"config":{"anyOf":[{"type":"object","properties":{"legend":{"type":"boolean"},"tooltip":{"type":"boolean"},"colors":{"type":"array","items":{"type":"string"}},"borderStyle":{"type":"string","enum":["none","solid","dashed","dotted"]},"customCss":{"type":"string"},"aiConversationId":{"type":"string"},"chartType":{"type":"string","enum":["line","area","bar"]},"xAxis":{"type":"object","properties":{"dataKey":{"type":"string"},"label":{"type":"string"}},"required":["dataKey"]},"yAxis":{"type":"object","properties":{"label":{"type":"string"},"min":{"type":"number"},"max":{"type":"number"}}}},"required":["chartType","xAxis","yAxis"]},{"type":"object","properties":{"legend":{"type":"boolean"},"tooltip":{"type":"boolean"},"colors":{"type":"array","items":{"type":"string"}},"borderStyle":{"type":"string","enum":["none","solid","dashed","dotted"]},"customCss":{"type":"string"},"aiConversationId":{"type":"string"},"format":{"type":"string","enum":["number","currency","percentage"]},"prefix":{"type":"string"},"suffix":{"type":"string"},"decimals":{"type":"number"},"size":{"type":"string","enum":["small","medium","large","xlarge"]},"currency":{"type":"string"},"locale":{"type":"string"},"accentColor":{"type":"string"},"icon":{"type":"string"},"comparison":{"type":"object","properties":{"enabled":{"type":"boolean"},"type":{"type":"string","enum":["percentage","absolute"]},"period":{"type":"string","enum":["previous","year_ago"]},"invertColors":{"type":"boolean"}},"required":["enabled","type","period"]}},"required":["format"]},{"type":"object","properties":{"legend":{"type":"boolean"},"tooltip":{"type":"boolean"},"colors":{"type":"array","items":{"type":"string"}},"borderStyle":{"type":"string","enum":["none","solid","dashed","dotted"]},"customCss":{"type":"string"},"aiConversationId":{"type":"string"},"donut":{"type":"boolean"},"labelKey":{"type":"string"},"valueKey":{"type":"string"},"showPercentage":{"type":"boolean"},"legendPosition":{"type":"string","enum":["top","bottom","left","right"]},"legendValues":{"type":"string","enum":["none","value","percentage","both"]},"maxSize":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["labelKey","valueKey"]},{"type":"object","properties":{"legend":{"type":"boolean"},"tooltip":{"type":"boolean"},"colors":{"type":"array","items":{"type":"string"}},"borderStyle":{"type":"string","enum":["none","solid","dashed","dotted"]},"customCss":{"type":"string"},"aiConversationId":{"type":"string"},"content":{"default":"","type":"string"}}},{"type":"object","properties":{"legend":{"type":"boolean"},"tooltip":{"type":"boolean"},"colors":{"type":"array","items":{"type":"string"}},"borderStyle":{"type":"string","enum":["none","solid","dashed","dotted"]},"customCss":{"type":"string"},"aiConversationId":{"type":"string"},"columns":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"header":{"type":"string"},"width":{"type":"number"},"format":{"type":"string","enum":["text","number","currency","date","boolean"]}},"required":["key","header"]}},"pagination":{"type":"boolean"},"pageSize":{"type":"number"}},"required":["columns"]},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}]},"filterMapping":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"enabled":{"type":"boolean"},"mapTo":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["enabled"]}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["dashboardId","widgetType","title","query","dataset","positionX","positionY","width","height","config"]}},"pages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"dashboardId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1},"description":{"type":"string"},"sequenceNumber":{"type":"integer","minimum":0,"maximum":9007199254740991},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["dashboardId","name","sequenceNumber"]}},"createdBy":{"type":"string"},"contextType":{"type":"string","enum":["organization","partner","customer","user"]},"contextId":{"type":"string"}},"required":["name"]}}}},"responses":{"201":{"description":"201","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"contextType":{"default":"organization","type":"string","enum":["organization","partner","customer","user"]},"contextId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"visibility":{"default":"internal","type":"string","enum":["private","internal","public"]},"name":{"type":"string","minLength":1},"description":{"type":"string"},"layoutType":{"default":"grid","type":"string","enum":["grid","flex","fixed"]},"isHomePage":{"default":false,"type":"boolean"},"globalFilters":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"date_range"},"label":{"type":"string"},"enabled":{"default":true,"type":"boolean"},"default":{"type":"object","properties":{"preset":{"type":"string"},"custom":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"}},"additionalProperties":false},"timezone":{"type":"string"}},"additionalProperties":false}},"required":["id","type","label","enabled"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"text"},"label":{"type":"string"},"enabled":{"default":true,"type":"boolean"},"placeholder":{"type":"string"},"default":{"type":"string"}},"required":["id","type","label","enabled"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"select"},"label":{"type":"string"},"enabled":{"default":true,"type":"boolean"},"options":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"label":{"type":"string"}},"required":["value","label"],"additionalProperties":false}},"default":{"type":"string"}},"required":["id","type","label","enabled","options"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"multi_select"},"label":{"type":"string"},"enabled":{"default":true,"type":"boolean"},"options":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"label":{"type":"string"}},"required":["value","label"],"additionalProperties":false}},"default":{"type":"array","items":{"type":"string"}}},"required":["id","type","label","enabled","options"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"number_range"},"label":{"type":"string"},"enabled":{"default":true,"type":"boolean"},"min":{"type":"number"},"max":{"type":"number"},"default":{"type":"object","properties":{"from":{"type":"number"},"to":{"type":"number"}},"additionalProperties":false}},"required":["id","type","label","enabled"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"search_filter"},"label":{"type":"string"},"enabled":{"default":true,"type":"boolean"},"placeholder":{"type":"string"},"default":{"type":"string"},"negate":{"type":"boolean"}},"required":["id","type","label","enabled"],"additionalProperties":false}]}},"widgets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"dashboardId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"widgetType":{"type":"string","enum":["counter","piechart","table","timeseries","note"]},"title":{"type":"string"},"description":{"type":"string"},"query":{"type":"string"},"dataset":{"type":"string"},"positionX":{"type":"integer","minimum":0,"maximum":9007199254740991},"positionY":{"type":"integer","minimum":0,"maximum":9007199254740991},"width":{"type":"integer","minimum":1,"maximum":9007199254740991},"height":{"type":"integer","minimum":1,"maximum":9007199254740991},"config":{"anyOf":[{"type":"object","properties":{"legend":{"type":"boolean"},"tooltip":{"type":"boolean"},"colors":{"type":"array","items":{"type":"string"}},"borderStyle":{"type":"string","enum":["none","solid","dashed","dotted"]},"customCss":{"type":"string"},"aiConversationId":{"type":"string"},"chartType":{"type":"string","enum":["line","area","bar"]},"xAxis":{"type":"object","properties":{"dataKey":{"type":"string"},"label":{"type":"string"}},"required":["dataKey"],"additionalProperties":false},"yAxis":{"type":"object","properties":{"label":{"type":"string"},"min":{"type":"number"},"max":{"type":"number"}},"additionalProperties":false}},"required":["chartType","xAxis","yAxis"],"additionalProperties":false},{"type":"object","properties":{"legend":{"type":"boolean"},"tooltip":{"type":"boolean"},"colors":{"type":"array","items":{"type":"string"}},"borderStyle":{"type":"string","enum":["none","solid","dashed","dotted"]},"customCss":{"type":"string"},"aiConversationId":{"type":"string"},"format":{"type":"string","enum":["number","currency","percentage"]},"prefix":{"type":"string"},"suffix":{"type":"string"},"decimals":{"type":"number"},"size":{"type":"string","enum":["small","medium","large","xlarge"]},"currency":{"type":"string"},"locale":{"type":"string"},"accentColor":{"type":"string"},"icon":{"type":"string"},"comparison":{"type":"object","properties":{"enabled":{"type":"boolean"},"type":{"type":"string","enum":["percentage","absolute"]},"period":{"type":"string","enum":["previous","year_ago"]},"invertColors":{"type":"boolean"}},"required":["enabled","type","period"],"additionalProperties":false}},"required":["format"],"additionalProperties":false},{"type":"object","properties":{"legend":{"type":"boolean"},"tooltip":{"type":"boolean"},"colors":{"type":"array","items":{"type":"string"}},"borderStyle":{"type":"string","enum":["none","solid","dashed","dotted"]},"customCss":{"type":"string"},"aiConversationId":{"type":"string"},"donut":{"type":"boolean"},"labelKey":{"type":"string"},"valueKey":{"type":"string"},"showPercentage":{"type":"boolean"},"legendPosition":{"type":"string","enum":["top","bottom","left","right"]},"legendValues":{"type":"string","enum":["none","value","percentage","both"]},"maxSize":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["labelKey","valueKey"],"additionalProperties":false},{"type":"object","properties":{"legend":{"type":"boolean"},"tooltip":{"type":"boolean"},"colors":{"type":"array","items":{"type":"string"}},"borderStyle":{"type":"string","enum":["none","solid","dashed","dotted"]},"customCss":{"type":"string"},"aiConversationId":{"type":"string"},"content":{"default":"","type":"string"}},"required":["content"],"additionalProperties":false},{"type":"object","properties":{"legend":{"type":"boolean"},"tooltip":{"type":"boolean"},"colors":{"type":"array","items":{"type":"string"}},"borderStyle":{"type":"string","enum":["none","solid","dashed","dotted"]},"customCss":{"type":"string"},"aiConversationId":{"type":"string"},"columns":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"header":{"type":"string"},"width":{"type":"number"},"format":{"type":"string","enum":["text","number","currency","date","boolean"]}},"required":["key","header"],"additionalProperties":false}},"pagination":{"type":"boolean"},"pageSize":{"type":"number"}},"required":["columns"],"additionalProperties":false},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}]},"filterMapping":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"enabled":{"type":"boolean"},"mapTo":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["enabled"],"additionalProperties":false}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["dashboardId","widgetType","title","query","dataset","positionX","positionY","width","height","config"],"additionalProperties":false}},"pages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"dashboardId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1},"description":{"type":"string"},"sequenceNumber":{"type":"integer","minimum":0,"maximum":9007199254740991},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["dashboardId","name","sequenceNumber"],"additionalProperties":false}},"createdBy":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["contextType","contextId","visibility","name","layoutType","isHomePage"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"401":{"description":"401","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"500":{"description":"500","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/dashboards/home":{"get":{"description":"Returns the home page dashboard for the current user's context. Priority: private > internal > public.","summary":"Get the home page dashboard","tags":["dashboards"],"parameters":[],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"contextType":{"default":"organization","type":"string","enum":["organization","partner","customer","user"]},"contextId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"visibility":{"default":"internal","type":"string","enum":["private","internal","public"]},"name":{"type":"string","minLength":1},"description":{"type":"string"},"layoutType":{"default":"grid","type":"string","enum":["grid","flex","fixed"]},"isHomePage":{"default":false,"type":"boolean"},"globalFilters":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"date_range"},"label":{"type":"string"},"enabled":{"default":true,"type":"boolean"},"default":{"type":"object","properties":{"preset":{"type":"string"},"custom":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"}},"additionalProperties":false},"timezone":{"type":"string"}},"additionalProperties":false}},"required":["id","type","label","enabled"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"text"},"label":{"type":"string"},"enabled":{"default":true,"type":"boolean"},"placeholder":{"type":"string"},"default":{"type":"string"}},"required":["id","type","label","enabled"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"select"},"label":{"type":"string"},"enabled":{"default":true,"type":"boolean"},"options":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"label":{"type":"string"}},"required":["value","label"],"additionalProperties":false}},"default":{"type":"string"}},"required":["id","type","label","enabled","options"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"multi_select"},"label":{"type":"string"},"enabled":{"default":true,"type":"boolean"},"options":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"label":{"type":"string"}},"required":["value","label"],"additionalProperties":false}},"default":{"type":"array","items":{"type":"string"}}},"required":["id","type","label","enabled","options"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"number_range"},"label":{"type":"string"},"enabled":{"default":true,"type":"boolean"},"min":{"type":"number"},"max":{"type":"number"},"default":{"type":"object","properties":{"from":{"type":"number"},"to":{"type":"number"}},"additionalProperties":false}},"required":["id","type","label","enabled"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"search_filter"},"label":{"type":"string"},"enabled":{"default":true,"type":"boolean"},"placeholder":{"type":"string"},"default":{"type":"string"},"negate":{"type":"boolean"}},"required":["id","type","label","enabled"],"additionalProperties":false}]}},"widgets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"dashboardId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"widgetType":{"type":"string","enum":["counter","piechart","table","timeseries","note"]},"title":{"type":"string"},"description":{"type":"string"},"query":{"type":"string"},"dataset":{"type":"string"},"positionX":{"type":"integer","minimum":0,"maximum":9007199254740991},"positionY":{"type":"integer","minimum":0,"maximum":9007199254740991},"width":{"type":"integer","minimum":1,"maximum":9007199254740991},"height":{"type":"integer","minimum":1,"maximum":9007199254740991},"config":{"anyOf":[{"type":"object","properties":{"legend":{"type":"boolean"},"tooltip":{"type":"boolean"},"colors":{"type":"array","items":{"type":"string"}},"borderStyle":{"type":"string","enum":["none","solid","dashed","dotted"]},"customCss":{"type":"string"},"aiConversationId":{"type":"string"},"chartType":{"type":"string","enum":["line","area","bar"]},"xAxis":{"type":"object","properties":{"dataKey":{"type":"string"},"label":{"type":"string"}},"required":["dataKey"],"additionalProperties":false},"yAxis":{"type":"object","properties":{"label":{"type":"string"},"min":{"type":"number"},"max":{"type":"number"}},"additionalProperties":false}},"required":["chartType","xAxis","yAxis"],"additionalProperties":false},{"type":"object","properties":{"legend":{"type":"boolean"},"tooltip":{"type":"boolean"},"colors":{"type":"array","items":{"type":"string"}},"borderStyle":{"type":"string","enum":["none","solid","dashed","dotted"]},"customCss":{"type":"string"},"aiConversationId":{"type":"string"},"format":{"type":"string","enum":["number","currency","percentage"]},"prefix":{"type":"string"},"suffix":{"type":"string"},"decimals":{"type":"number"},"size":{"type":"string","enum":["small","medium","large","xlarge"]},"currency":{"type":"string"},"locale":{"type":"string"},"accentColor":{"type":"string"},"icon":{"type":"string"},"comparison":{"type":"object","properties":{"enabled":{"type":"boolean"},"type":{"type":"string","enum":["percentage","absolute"]},"period":{"type":"string","enum":["previous","year_ago"]},"invertColors":{"type":"boolean"}},"required":["enabled","type","period"],"additionalProperties":false}},"required":["format"],"additionalProperties":false},{"type":"object","properties":{"legend":{"type":"boolean"},"tooltip":{"type":"boolean"},"colors":{"type":"array","items":{"type":"string"}},"borderStyle":{"type":"string","enum":["none","solid","dashed","dotted"]},"customCss":{"type":"string"},"aiConversationId":{"type":"string"},"donut":{"type":"boolean"},"labelKey":{"type":"string"},"valueKey":{"type":"string"},"showPercentage":{"type":"boolean"},"legendPosition":{"type":"string","enum":["top","bottom","left","right"]},"legendValues":{"type":"string","enum":["none","value","percentage","both"]},"maxSize":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["labelKey","valueKey"],"additionalProperties":false},{"type":"object","properties":{"legend":{"type":"boolean"},"tooltip":{"type":"boolean"},"colors":{"type":"array","items":{"type":"string"}},"borderStyle":{"type":"string","enum":["none","solid","dashed","dotted"]},"customCss":{"type":"string"},"aiConversationId":{"type":"string"},"content":{"default":"","type":"string"}},"required":["content"],"additionalProperties":false},{"type":"object","properties":{"legend":{"type":"boolean"},"tooltip":{"type":"boolean"},"colors":{"type":"array","items":{"type":"string"}},"borderStyle":{"type":"string","enum":["none","solid","dashed","dotted"]},"customCss":{"type":"string"},"aiConversationId":{"type":"string"},"columns":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"header":{"type":"string"},"width":{"type":"number"},"format":{"type":"string","enum":["text","number","currency","date","boolean"]}},"required":["key","header"],"additionalProperties":false}},"pagination":{"type":"boolean"},"pageSize":{"type":"number"}},"required":["columns"],"additionalProperties":false},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}]},"filterMapping":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"enabled":{"type":"boolean"},"mapTo":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["enabled"],"additionalProperties":false}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["dashboardId","widgetType","title","query","dataset","positionX","positionY","width","height","config"],"additionalProperties":false}},"pages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"dashboardId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1},"description":{"type":"string"},"sequenceNumber":{"type":"integer","minimum":0,"maximum":9007199254740991},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["dashboardId","name","sequenceNumber"],"additionalProperties":false}},"createdBy":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["contextType","contextId","visibility","name","layoutType","isHomePage"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"401":{"description":"401","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"500":{"description":"500","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/dashboards/{dashboardId}":{"get":{"description":"Returns a single dashboard by its ID if the user has access to it","summary":"Get a dashboard by ID","tags":["dashboards"],"parameters":[{"name":"dashboardId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"contextType":{"default":"organization","type":"string","enum":["organization","partner","customer","user"]},"contextId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"visibility":{"default":"internal","type":"string","enum":["private","internal","public"]},"name":{"type":"string","minLength":1},"description":{"type":"string"},"layoutType":{"default":"grid","type":"string","enum":["grid","flex","fixed"]},"isHomePage":{"default":false,"type":"boolean"},"globalFilters":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"date_range"},"label":{"type":"string"},"enabled":{"default":true,"type":"boolean"},"default":{"type":"object","properties":{"preset":{"type":"string"},"custom":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"}},"additionalProperties":false},"timezone":{"type":"string"}},"additionalProperties":false}},"required":["id","type","label","enabled"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"text"},"label":{"type":"string"},"enabled":{"default":true,"type":"boolean"},"placeholder":{"type":"string"},"default":{"type":"string"}},"required":["id","type","label","enabled"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"select"},"label":{"type":"string"},"enabled":{"default":true,"type":"boolean"},"options":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"label":{"type":"string"}},"required":["value","label"],"additionalProperties":false}},"default":{"type":"string"}},"required":["id","type","label","enabled","options"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"multi_select"},"label":{"type":"string"},"enabled":{"default":true,"type":"boolean"},"options":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"label":{"type":"string"}},"required":["value","label"],"additionalProperties":false}},"default":{"type":"array","items":{"type":"string"}}},"required":["id","type","label","enabled","options"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"number_range"},"label":{"type":"string"},"enabled":{"default":true,"type":"boolean"},"min":{"type":"number"},"max":{"type":"number"},"default":{"type":"object","properties":{"from":{"type":"number"},"to":{"type":"number"}},"additionalProperties":false}},"required":["id","type","label","enabled"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"search_filter"},"label":{"type":"string"},"enabled":{"default":true,"type":"boolean"},"placeholder":{"type":"string"},"default":{"type":"string"},"negate":{"type":"boolean"}},"required":["id","type","label","enabled"],"additionalProperties":false}]}},"widgets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"dashboardId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"widgetType":{"type":"string","enum":["counter","piechart","table","timeseries","note"]},"title":{"type":"string"},"description":{"type":"string"},"query":{"type":"string"},"dataset":{"type":"string"},"positionX":{"type":"integer","minimum":0,"maximum":9007199254740991},"positionY":{"type":"integer","minimum":0,"maximum":9007199254740991},"width":{"type":"integer","minimum":1,"maximum":9007199254740991},"height":{"type":"integer","minimum":1,"maximum":9007199254740991},"config":{"anyOf":[{"type":"object","properties":{"legend":{"type":"boolean"},"tooltip":{"type":"boolean"},"colors":{"type":"array","items":{"type":"string"}},"borderStyle":{"type":"string","enum":["none","solid","dashed","dotted"]},"customCss":{"type":"string"},"aiConversationId":{"type":"string"},"chartType":{"type":"string","enum":["line","area","bar"]},"xAxis":{"type":"object","properties":{"dataKey":{"type":"string"},"label":{"type":"string"}},"required":["dataKey"],"additionalProperties":false},"yAxis":{"type":"object","properties":{"label":{"type":"string"},"min":{"type":"number"},"max":{"type":"number"}},"additionalProperties":false}},"required":["chartType","xAxis","yAxis"],"additionalProperties":false},{"type":"object","properties":{"legend":{"type":"boolean"},"tooltip":{"type":"boolean"},"colors":{"type":"array","items":{"type":"string"}},"borderStyle":{"type":"string","enum":["none","solid","dashed","dotted"]},"customCss":{"type":"string"},"aiConversationId":{"type":"string"},"format":{"type":"string","enum":["number","currency","percentage"]},"prefix":{"type":"string"},"suffix":{"type":"string"},"decimals":{"type":"number"},"size":{"type":"string","enum":["small","medium","large","xlarge"]},"currency":{"type":"string"},"locale":{"type":"string"},"accentColor":{"type":"string"},"icon":{"type":"string"},"comparison":{"type":"object","properties":{"enabled":{"type":"boolean"},"type":{"type":"string","enum":["percentage","absolute"]},"period":{"type":"string","enum":["previous","year_ago"]},"invertColors":{"type":"boolean"}},"required":["enabled","type","period"],"additionalProperties":false}},"required":["format"],"additionalProperties":false},{"type":"object","properties":{"legend":{"type":"boolean"},"tooltip":{"type":"boolean"},"colors":{"type":"array","items":{"type":"string"}},"borderStyle":{"type":"string","enum":["none","solid","dashed","dotted"]},"customCss":{"type":"string"},"aiConversationId":{"type":"string"},"donut":{"type":"boolean"},"labelKey":{"type":"string"},"valueKey":{"type":"string"},"showPercentage":{"type":"boolean"},"legendPosition":{"type":"string","enum":["top","bottom","left","right"]},"legendValues":{"type":"string","enum":["none","value","percentage","both"]},"maxSize":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["labelKey","valueKey"],"additionalProperties":false},{"type":"object","properties":{"legend":{"type":"boolean"},"tooltip":{"type":"boolean"},"colors":{"type":"array","items":{"type":"string"}},"borderStyle":{"type":"string","enum":["none","solid","dashed","dotted"]},"customCss":{"type":"string"},"aiConversationId":{"type":"string"},"content":{"default":"","type":"string"}},"required":["content"],"additionalProperties":false},{"type":"object","properties":{"legend":{"type":"boolean"},"tooltip":{"type":"boolean"},"colors":{"type":"array","items":{"type":"string"}},"borderStyle":{"type":"string","enum":["none","solid","dashed","dotted"]},"customCss":{"type":"string"},"aiConversationId":{"type":"string"},"columns":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"header":{"type":"string"},"width":{"type":"number"},"format":{"type":"string","enum":["text","number","currency","date","boolean"]}},"required":["key","header"],"additionalProperties":false}},"pagination":{"type":"boolean"},"pageSize":{"type":"number"}},"required":["columns"],"additionalProperties":false},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}]},"filterMapping":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"enabled":{"type":"boolean"},"mapTo":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["enabled"],"additionalProperties":false}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["dashboardId","widgetType","title","query","dataset","positionX","positionY","width","height","config"],"additionalProperties":false}},"pages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"dashboardId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1},"description":{"type":"string"},"sequenceNumber":{"type":"integer","minimum":0,"maximum":9007199254740991},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["dashboardId","name","sequenceNumber"],"additionalProperties":false}},"createdBy":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["contextType","contextId","visibility","name","layoutType","isHomePage"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"401":{"description":"401","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"500":{"description":"500","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}},"put":{"description":"Updates an existing dashboard if the user has permission","summary":"Update a dashboard","tags":["dashboards"],"parameters":[{"name":"dashboardId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"visibility":{"default":"internal","type":"string","enum":["private","internal","public"]},"name":{"type":"string","minLength":1},"description":{"type":"string"},"layoutType":{"default":"grid","type":"string","enum":["grid","flex","fixed"]},"isHomePage":{"default":false,"type":"boolean"},"globalFilters":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"date_range"},"label":{"type":"string"},"enabled":{"default":true,"type":"boolean"},"default":{"type":"object","properties":{"preset":{"type":"string"},"custom":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"}}},"timezone":{"type":"string"}}}},"required":["id","type","label"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"text"},"label":{"type":"string"},"enabled":{"default":true,"type":"boolean"},"placeholder":{"type":"string"},"default":{"type":"string"}},"required":["id","type","label"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"select"},"label":{"type":"string"},"enabled":{"default":true,"type":"boolean"},"options":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"label":{"type":"string"}},"required":["value","label"]}},"default":{"type":"string"}},"required":["id","type","label","options"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"multi_select"},"label":{"type":"string"},"enabled":{"default":true,"type":"boolean"},"options":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"label":{"type":"string"}},"required":["value","label"]}},"default":{"type":"array","items":{"type":"string"}}},"required":["id","type","label","options"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"number_range"},"label":{"type":"string"},"enabled":{"default":true,"type":"boolean"},"min":{"type":"number"},"max":{"type":"number"},"default":{"type":"object","properties":{"from":{"type":"number"},"to":{"type":"number"}}}},"required":["id","type","label"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"search_filter"},"label":{"type":"string"},"enabled":{"default":true,"type":"boolean"},"placeholder":{"type":"string"},"default":{"type":"string"},"negate":{"type":"boolean"}},"required":["id","type","label"]}]}},"widgets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"dashboardId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"widgetType":{"type":"string","enum":["counter","piechart","table","timeseries","note"]},"title":{"type":"string"},"description":{"type":"string"},"query":{"type":"string"},"dataset":{"type":"string"},"positionX":{"type":"integer","minimum":0,"maximum":9007199254740991},"positionY":{"type":"integer","minimum":0,"maximum":9007199254740991},"width":{"type":"integer","minimum":1,"maximum":9007199254740991},"height":{"type":"integer","minimum":1,"maximum":9007199254740991},"config":{"anyOf":[{"type":"object","properties":{"legend":{"type":"boolean"},"tooltip":{"type":"boolean"},"colors":{"type":"array","items":{"type":"string"}},"borderStyle":{"type":"string","enum":["none","solid","dashed","dotted"]},"customCss":{"type":"string"},"aiConversationId":{"type":"string"},"chartType":{"type":"string","enum":["line","area","bar"]},"xAxis":{"type":"object","properties":{"dataKey":{"type":"string"},"label":{"type":"string"}},"required":["dataKey"]},"yAxis":{"type":"object","properties":{"label":{"type":"string"},"min":{"type":"number"},"max":{"type":"number"}}}},"required":["chartType","xAxis","yAxis"]},{"type":"object","properties":{"legend":{"type":"boolean"},"tooltip":{"type":"boolean"},"colors":{"type":"array","items":{"type":"string"}},"borderStyle":{"type":"string","enum":["none","solid","dashed","dotted"]},"customCss":{"type":"string"},"aiConversationId":{"type":"string"},"format":{"type":"string","enum":["number","currency","percentage"]},"prefix":{"type":"string"},"suffix":{"type":"string"},"decimals":{"type":"number"},"size":{"type":"string","enum":["small","medium","large","xlarge"]},"currency":{"type":"string"},"locale":{"type":"string"},"accentColor":{"type":"string"},"icon":{"type":"string"},"comparison":{"type":"object","properties":{"enabled":{"type":"boolean"},"type":{"type":"string","enum":["percentage","absolute"]},"period":{"type":"string","enum":["previous","year_ago"]},"invertColors":{"type":"boolean"}},"required":["enabled","type","period"]}},"required":["format"]},{"type":"object","properties":{"legend":{"type":"boolean"},"tooltip":{"type":"boolean"},"colors":{"type":"array","items":{"type":"string"}},"borderStyle":{"type":"string","enum":["none","solid","dashed","dotted"]},"customCss":{"type":"string"},"aiConversationId":{"type":"string"},"donut":{"type":"boolean"},"labelKey":{"type":"string"},"valueKey":{"type":"string"},"showPercentage":{"type":"boolean"},"legendPosition":{"type":"string","enum":["top","bottom","left","right"]},"legendValues":{"type":"string","enum":["none","value","percentage","both"]},"maxSize":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["labelKey","valueKey"]},{"type":"object","properties":{"legend":{"type":"boolean"},"tooltip":{"type":"boolean"},"colors":{"type":"array","items":{"type":"string"}},"borderStyle":{"type":"string","enum":["none","solid","dashed","dotted"]},"customCss":{"type":"string"},"aiConversationId":{"type":"string"},"content":{"default":"","type":"string"}}},{"type":"object","properties":{"legend":{"type":"boolean"},"tooltip":{"type":"boolean"},"colors":{"type":"array","items":{"type":"string"}},"borderStyle":{"type":"string","enum":["none","solid","dashed","dotted"]},"customCss":{"type":"string"},"aiConversationId":{"type":"string"},"columns":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"header":{"type":"string"},"width":{"type":"number"},"format":{"type":"string","enum":["text","number","currency","date","boolean"]}},"required":["key","header"]}},"pagination":{"type":"boolean"},"pageSize":{"type":"number"}},"required":["columns"]},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}]},"filterMapping":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"enabled":{"type":"boolean"},"mapTo":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["enabled"]}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["dashboardId","widgetType","title","query","dataset","positionX","positionY","width","height","config"]}},"pages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"dashboardId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1},"description":{"type":"string"},"sequenceNumber":{"type":"integer","minimum":0,"maximum":9007199254740991},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["dashboardId","name","sequenceNumber"]}}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"contextType":{"default":"organization","type":"string","enum":["organization","partner","customer","user"]},"contextId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"visibility":{"default":"internal","type":"string","enum":["private","internal","public"]},"name":{"type":"string","minLength":1},"description":{"type":"string"},"layoutType":{"default":"grid","type":"string","enum":["grid","flex","fixed"]},"isHomePage":{"default":false,"type":"boolean"},"globalFilters":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"date_range"},"label":{"type":"string"},"enabled":{"default":true,"type":"boolean"},"default":{"type":"object","properties":{"preset":{"type":"string"},"custom":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"}},"additionalProperties":false},"timezone":{"type":"string"}},"additionalProperties":false}},"required":["id","type","label","enabled"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"text"},"label":{"type":"string"},"enabled":{"default":true,"type":"boolean"},"placeholder":{"type":"string"},"default":{"type":"string"}},"required":["id","type","label","enabled"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"select"},"label":{"type":"string"},"enabled":{"default":true,"type":"boolean"},"options":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"label":{"type":"string"}},"required":["value","label"],"additionalProperties":false}},"default":{"type":"string"}},"required":["id","type","label","enabled","options"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"multi_select"},"label":{"type":"string"},"enabled":{"default":true,"type":"boolean"},"options":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"label":{"type":"string"}},"required":["value","label"],"additionalProperties":false}},"default":{"type":"array","items":{"type":"string"}}},"required":["id","type","label","enabled","options"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"number_range"},"label":{"type":"string"},"enabled":{"default":true,"type":"boolean"},"min":{"type":"number"},"max":{"type":"number"},"default":{"type":"object","properties":{"from":{"type":"number"},"to":{"type":"number"}},"additionalProperties":false}},"required":["id","type","label","enabled"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"search_filter"},"label":{"type":"string"},"enabled":{"default":true,"type":"boolean"},"placeholder":{"type":"string"},"default":{"type":"string"},"negate":{"type":"boolean"}},"required":["id","type","label","enabled"],"additionalProperties":false}]}},"widgets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"dashboardId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"widgetType":{"type":"string","enum":["counter","piechart","table","timeseries","note"]},"title":{"type":"string"},"description":{"type":"string"},"query":{"type":"string"},"dataset":{"type":"string"},"positionX":{"type":"integer","minimum":0,"maximum":9007199254740991},"positionY":{"type":"integer","minimum":0,"maximum":9007199254740991},"width":{"type":"integer","minimum":1,"maximum":9007199254740991},"height":{"type":"integer","minimum":1,"maximum":9007199254740991},"config":{"anyOf":[{"type":"object","properties":{"legend":{"type":"boolean"},"tooltip":{"type":"boolean"},"colors":{"type":"array","items":{"type":"string"}},"borderStyle":{"type":"string","enum":["none","solid","dashed","dotted"]},"customCss":{"type":"string"},"aiConversationId":{"type":"string"},"chartType":{"type":"string","enum":["line","area","bar"]},"xAxis":{"type":"object","properties":{"dataKey":{"type":"string"},"label":{"type":"string"}},"required":["dataKey"],"additionalProperties":false},"yAxis":{"type":"object","properties":{"label":{"type":"string"},"min":{"type":"number"},"max":{"type":"number"}},"additionalProperties":false}},"required":["chartType","xAxis","yAxis"],"additionalProperties":false},{"type":"object","properties":{"legend":{"type":"boolean"},"tooltip":{"type":"boolean"},"colors":{"type":"array","items":{"type":"string"}},"borderStyle":{"type":"string","enum":["none","solid","dashed","dotted"]},"customCss":{"type":"string"},"aiConversationId":{"type":"string"},"format":{"type":"string","enum":["number","currency","percentage"]},"prefix":{"type":"string"},"suffix":{"type":"string"},"decimals":{"type":"number"},"size":{"type":"string","enum":["small","medium","large","xlarge"]},"currency":{"type":"string"},"locale":{"type":"string"},"accentColor":{"type":"string"},"icon":{"type":"string"},"comparison":{"type":"object","properties":{"enabled":{"type":"boolean"},"type":{"type":"string","enum":["percentage","absolute"]},"period":{"type":"string","enum":["previous","year_ago"]},"invertColors":{"type":"boolean"}},"required":["enabled","type","period"],"additionalProperties":false}},"required":["format"],"additionalProperties":false},{"type":"object","properties":{"legend":{"type":"boolean"},"tooltip":{"type":"boolean"},"colors":{"type":"array","items":{"type":"string"}},"borderStyle":{"type":"string","enum":["none","solid","dashed","dotted"]},"customCss":{"type":"string"},"aiConversationId":{"type":"string"},"donut":{"type":"boolean"},"labelKey":{"type":"string"},"valueKey":{"type":"string"},"showPercentage":{"type":"boolean"},"legendPosition":{"type":"string","enum":["top","bottom","left","right"]},"legendValues":{"type":"string","enum":["none","value","percentage","both"]},"maxSize":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["labelKey","valueKey"],"additionalProperties":false},{"type":"object","properties":{"legend":{"type":"boolean"},"tooltip":{"type":"boolean"},"colors":{"type":"array","items":{"type":"string"}},"borderStyle":{"type":"string","enum":["none","solid","dashed","dotted"]},"customCss":{"type":"string"},"aiConversationId":{"type":"string"},"content":{"default":"","type":"string"}},"required":["content"],"additionalProperties":false},{"type":"object","properties":{"legend":{"type":"boolean"},"tooltip":{"type":"boolean"},"colors":{"type":"array","items":{"type":"string"}},"borderStyle":{"type":"string","enum":["none","solid","dashed","dotted"]},"customCss":{"type":"string"},"aiConversationId":{"type":"string"},"columns":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"header":{"type":"string"},"width":{"type":"number"},"format":{"type":"string","enum":["text","number","currency","date","boolean"]}},"required":["key","header"],"additionalProperties":false}},"pagination":{"type":"boolean"},"pageSize":{"type":"number"}},"required":["columns"],"additionalProperties":false},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}]},"filterMapping":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"enabled":{"type":"boolean"},"mapTo":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["enabled"],"additionalProperties":false}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["dashboardId","widgetType","title","query","dataset","positionX","positionY","width","height","config"],"additionalProperties":false}},"pages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"dashboardId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1},"description":{"type":"string"},"sequenceNumber":{"type":"integer","minimum":0,"maximum":9007199254740991},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["dashboardId","name","sequenceNumber"],"additionalProperties":false}},"createdBy":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["contextType","contextId","visibility","name","layoutType","isHomePage"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"401":{"description":"401","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"500":{"description":"500","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}},"delete":{"description":"Deletes a dashboard and all associated widgets if the user has permission","summary":"Delete a dashboard","tags":["dashboards"],"parameters":[{"name":"dashboardId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"204","content":{"application/json":{"schema":{}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"401":{"description":"401","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"500":{"description":"500","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/decision-tables":{"post":{"summary":"Create a new decision table","tags":["decisionTables"],"parameters":[{"name":"contextType","in":"query","required":true,"schema":{"type":"string","enum":["organization","partner","customer"]}},{"name":"contextId","in":"query","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"slugId":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"description":{"type":"string"},"kind":{"default":"generic","type":"string","enum":["generic","fraud-block","routing","routing-plan","fees","provider-fees","emi-fees","emi-gas-fees","fx","payment-options","notification-rules","notification-routing"]},"enabled":{"default":true,"type":"boolean"},"priority":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"preConditions":{"default":[],"type":"array","items":{"type":"object","properties":{"field":{"type":"string","minLength":1},"op":{"default":"in","type":"string","enum":["in","not-in"]},"values":{"default":[],"type":"array","items":{"type":"string"}}},"required":["field"]}},"hitPolicy":{"default":"first","type":"string","enum":["first","collect"]},"inputs":{"default":[],"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"field":{"type":"string"},"type":{"type":"string","enum":["string","number","boolean","date","select","multiselect","regex","function","list"]},"enumName":{"type":"string"},"options":{"type":"array","items":{"type":"string"}},"caseSensitive":{"type":"boolean"},"functionName":{"type":"string"},"functionParams":{"type":"array","items":{"type":"string"}},"validation":{"type":"object","properties":{"required":{"type":"boolean"},"min":{"type":"number"},"max":{"type":"number"},"pattern":{"type":"string"}}}},"required":["id","label"]}},"outputs":{"default":[],"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"field":{"type":"string"},"type":{"type":"string","enum":["string","number","boolean","date","select","multiselect","regex","function","list"]},"enumName":{"type":"string"},"options":{"type":"array","items":{"type":"string"}},"caseSensitive":{"type":"boolean"},"functionName":{"type":"string"},"functionParams":{"type":"array","items":{"type":"string"}},"validation":{"type":"object","properties":{"required":{"type":"boolean"},"min":{"type":"number"},"max":{"type":"number"},"pattern":{"type":"string"}}}},"required":["id","label"]}},"rules":{"default":[],"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"enabled":{"type":"boolean"},"inputs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"object","properties":{"value":{"type":"string"},"operator":{"type":"string"}},"required":["value"]}]}},"outputs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["id","inputs","outputs"]}}},"required":["name","slugId"]}}}},"responses":{"201":{"description":"201","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"context":{"type":"object","properties":{"type":{"type":"string","enum":["organization","partner","customer"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"organizationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["type","id"],"additionalProperties":false},"name":{"type":"string"},"slugId":{"type":"string"},"description":{"type":["string","null"]},"kind":{"default":"generic","type":"string","enum":["generic","fraud-block","routing","routing-plan","fees","provider-fees","emi-fees","emi-gas-fees","fx","payment-options","notification-rules","notification-routing"]},"enabled":{"default":true,"type":"boolean"},"priority":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"preConditions":{"default":[],"type":"array","items":{"type":"object","properties":{"field":{"type":"string","minLength":1},"op":{"default":"in","type":"string","enum":["in","not-in"]},"values":{"default":[],"type":"array","items":{"type":"string"}}},"required":["field","op","values"],"additionalProperties":false}},"hitPolicy":{"type":"string","enum":["first","collect"]},"inputs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"field":{"type":"string"},"type":{"type":"string","enum":["string","number","boolean","date","select","multiselect","regex","function","list"]},"enumName":{"type":"string"},"options":{"type":"array","items":{"type":"string"}},"caseSensitive":{"type":"boolean"},"functionName":{"type":"string"},"functionParams":{"type":"array","items":{"type":"string"}},"validation":{"type":"object","properties":{"required":{"type":"boolean"},"min":{"type":"number"},"max":{"type":"number"},"pattern":{"type":"string"}},"additionalProperties":false}},"required":["id","label"],"additionalProperties":false}},"outputs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"field":{"type":"string"},"type":{"type":"string","enum":["string","number","boolean","date","select","multiselect","regex","function","list"]},"enumName":{"type":"string"},"options":{"type":"array","items":{"type":"string"}},"caseSensitive":{"type":"boolean"},"functionName":{"type":"string"},"functionParams":{"type":"array","items":{"type":"string"}},"validation":{"type":"object","properties":{"required":{"type":"boolean"},"min":{"type":"number"},"max":{"type":"number"},"pattern":{"type":"string"}},"additionalProperties":false}},"required":["id","label"],"additionalProperties":false}},"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"enabled":{"type":"boolean"},"inputs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"object","properties":{"value":{"type":"string"},"operator":{"type":"string"}},"required":["value"],"additionalProperties":false}]}},"outputs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["id","inputs","outputs"],"additionalProperties":false}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"createdBy":{"type":["string","null"]}},"required":["id","context","name","slugId","description","kind","enabled","priority","preConditions","hitPolicy","inputs","outputs","rules","createdAt","updatedAt","createdBy"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"409":{"description":"409","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}},"get":{"summary":"List all decision tables","tags":["decisionTables"],"parameters":[{"name":"contextType","in":"query","required":true,"schema":{"type":"string","enum":["organization","partner","customer"]}},{"name":"contextId","in":"query","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"context":{"type":"object","properties":{"type":{"type":"string","enum":["organization","partner","customer"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"organizationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["type","id"],"additionalProperties":false},"name":{"type":"string"},"slugId":{"type":"string"},"description":{"type":["string","null"]},"kind":{"default":"generic","type":"string","enum":["generic","fraud-block","routing","routing-plan","fees","provider-fees","emi-fees","emi-gas-fees","fx","payment-options","notification-rules","notification-routing"]},"enabled":{"default":true,"type":"boolean"},"priority":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"preConditions":{"default":[],"type":"array","items":{"type":"object","properties":{"field":{"type":"string","minLength":1},"op":{"default":"in","type":"string","enum":["in","not-in"]},"values":{"default":[],"type":"array","items":{"type":"string"}}},"required":["field","op","values"],"additionalProperties":false}},"hitPolicy":{"type":"string","enum":["first","collect"]},"inputs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"field":{"type":"string"},"type":{"type":"string","enum":["string","number","boolean","date","select","multiselect","regex","function","list"]},"enumName":{"type":"string"},"options":{"type":"array","items":{"type":"string"}},"caseSensitive":{"type":"boolean"},"functionName":{"type":"string"},"functionParams":{"type":"array","items":{"type":"string"}},"validation":{"type":"object","properties":{"required":{"type":"boolean"},"min":{"type":"number"},"max":{"type":"number"},"pattern":{"type":"string"}},"additionalProperties":false}},"required":["id","label"],"additionalProperties":false}},"outputs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"field":{"type":"string"},"type":{"type":"string","enum":["string","number","boolean","date","select","multiselect","regex","function","list"]},"enumName":{"type":"string"},"options":{"type":"array","items":{"type":"string"}},"caseSensitive":{"type":"boolean"},"functionName":{"type":"string"},"functionParams":{"type":"array","items":{"type":"string"}},"validation":{"type":"object","properties":{"required":{"type":"boolean"},"min":{"type":"number"},"max":{"type":"number"},"pattern":{"type":"string"}},"additionalProperties":false}},"required":["id","label"],"additionalProperties":false}},"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"enabled":{"type":"boolean"},"inputs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"object","properties":{"value":{"type":"string"},"operator":{"type":"string"}},"required":["value"],"additionalProperties":false}]}},"outputs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["id","inputs","outputs"],"additionalProperties":false}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"createdBy":{"type":["string","null"]}},"required":["id","context","name","slugId","description","kind","enabled","priority","preConditions","hitPolicy","inputs","outputs","rules","createdAt","updatedAt","createdBy"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/decision-tables/{decisionTableId}":{"get":{"summary":"Get a specific decision table by ID","tags":["decisionTables"],"parameters":[{"name":"decisionTableId","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"contextType","in":"query","required":true,"schema":{"type":"string","enum":["organization","partner","customer"]}},{"name":"contextId","in":"query","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"context":{"type":"object","properties":{"type":{"type":"string","enum":["organization","partner","customer"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"organizationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["type","id"],"additionalProperties":false},"name":{"type":"string"},"slugId":{"type":"string"},"description":{"type":["string","null"]},"kind":{"default":"generic","type":"string","enum":["generic","fraud-block","routing","routing-plan","fees","provider-fees","emi-fees","emi-gas-fees","fx","payment-options","notification-rules","notification-routing"]},"enabled":{"default":true,"type":"boolean"},"priority":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"preConditions":{"default":[],"type":"array","items":{"type":"object","properties":{"field":{"type":"string","minLength":1},"op":{"default":"in","type":"string","enum":["in","not-in"]},"values":{"default":[],"type":"array","items":{"type":"string"}}},"required":["field","op","values"],"additionalProperties":false}},"hitPolicy":{"type":"string","enum":["first","collect"]},"inputs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"field":{"type":"string"},"type":{"type":"string","enum":["string","number","boolean","date","select","multiselect","regex","function","list"]},"enumName":{"type":"string"},"options":{"type":"array","items":{"type":"string"}},"caseSensitive":{"type":"boolean"},"functionName":{"type":"string"},"functionParams":{"type":"array","items":{"type":"string"}},"validation":{"type":"object","properties":{"required":{"type":"boolean"},"min":{"type":"number"},"max":{"type":"number"},"pattern":{"type":"string"}},"additionalProperties":false}},"required":["id","label"],"additionalProperties":false}},"outputs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"field":{"type":"string"},"type":{"type":"string","enum":["string","number","boolean","date","select","multiselect","regex","function","list"]},"enumName":{"type":"string"},"options":{"type":"array","items":{"type":"string"}},"caseSensitive":{"type":"boolean"},"functionName":{"type":"string"},"functionParams":{"type":"array","items":{"type":"string"}},"validation":{"type":"object","properties":{"required":{"type":"boolean"},"min":{"type":"number"},"max":{"type":"number"},"pattern":{"type":"string"}},"additionalProperties":false}},"required":["id","label"],"additionalProperties":false}},"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"enabled":{"type":"boolean"},"inputs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"object","properties":{"value":{"type":"string"},"operator":{"type":"string"}},"required":["value"],"additionalProperties":false}]}},"outputs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["id","inputs","outputs"],"additionalProperties":false}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"createdBy":{"type":["string","null"]}},"required":["id","context","name","slugId","description","kind","enabled","priority","preConditions","hitPolicy","inputs","outputs","rules","createdAt","updatedAt","createdBy"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}},"delete":{"summary":"Delete a decision table","tags":["decisionTables"],"parameters":[{"name":"decisionTableId","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"contextType","in":"query","required":true,"schema":{"type":"string","enum":["organization","partner","customer"]}},{"name":"contextId","in":"query","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"204":{"description":"204","content":{"application/json":{"schema":{}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/decision-tables/by-slug/{slugId}":{"get":{"summary":"Get a specific decision table by slug ID","tags":["decisionTables"],"parameters":[{"name":"slugId","in":"path","required":true,"schema":{"type":"string"}},{"name":"contextType","in":"query","required":true,"schema":{"type":"string","enum":["organization","partner","customer"]}},{"name":"contextId","in":"query","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"context":{"type":"object","properties":{"type":{"type":"string","enum":["organization","partner","customer"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"organizationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["type","id"],"additionalProperties":false},"name":{"type":"string"},"slugId":{"type":"string"},"description":{"type":["string","null"]},"kind":{"default":"generic","type":"string","enum":["generic","fraud-block","routing","routing-plan","fees","provider-fees","emi-fees","emi-gas-fees","fx","payment-options","notification-rules","notification-routing"]},"enabled":{"default":true,"type":"boolean"},"priority":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"preConditions":{"default":[],"type":"array","items":{"type":"object","properties":{"field":{"type":"string","minLength":1},"op":{"default":"in","type":"string","enum":["in","not-in"]},"values":{"default":[],"type":"array","items":{"type":"string"}}},"required":["field","op","values"],"additionalProperties":false}},"hitPolicy":{"type":"string","enum":["first","collect"]},"inputs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"field":{"type":"string"},"type":{"type":"string","enum":["string","number","boolean","date","select","multiselect","regex","function","list"]},"enumName":{"type":"string"},"options":{"type":"array","items":{"type":"string"}},"caseSensitive":{"type":"boolean"},"functionName":{"type":"string"},"functionParams":{"type":"array","items":{"type":"string"}},"validation":{"type":"object","properties":{"required":{"type":"boolean"},"min":{"type":"number"},"max":{"type":"number"},"pattern":{"type":"string"}},"additionalProperties":false}},"required":["id","label"],"additionalProperties":false}},"outputs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"field":{"type":"string"},"type":{"type":"string","enum":["string","number","boolean","date","select","multiselect","regex","function","list"]},"enumName":{"type":"string"},"options":{"type":"array","items":{"type":"string"}},"caseSensitive":{"type":"boolean"},"functionName":{"type":"string"},"functionParams":{"type":"array","items":{"type":"string"}},"validation":{"type":"object","properties":{"required":{"type":"boolean"},"min":{"type":"number"},"max":{"type":"number"},"pattern":{"type":"string"}},"additionalProperties":false}},"required":["id","label"],"additionalProperties":false}},"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"enabled":{"type":"boolean"},"inputs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"object","properties":{"value":{"type":"string"},"operator":{"type":"string"}},"required":["value"],"additionalProperties":false}]}},"outputs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["id","inputs","outputs"],"additionalProperties":false}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"createdBy":{"type":["string","null"]}},"required":["id","context","name","slugId","description","kind","enabled","priority","preConditions","hitPolicy","inputs","outputs","rules","createdAt","updatedAt","createdBy"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}},"put":{"summary":"Upsert (create or update) a decision table by slug ID","tags":["decisionTables"],"parameters":[{"name":"slugId","in":"path","required":true,"schema":{"type":"string"}},{"name":"contextType","in":"query","required":true,"schema":{"type":"string","enum":["organization","partner","customer"]}},{"name":"contextId","in":"query","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"hitPolicy":{"type":"string","enum":["first","collect"]},"inputs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"field":{"type":"string"},"type":{"type":"string","enum":["string","number","boolean","date","select","multiselect","regex","function","list"]},"enumName":{"type":"string"},"options":{"type":"array","items":{"type":"string"}},"caseSensitive":{"type":"boolean"},"functionName":{"type":"string"},"functionParams":{"type":"array","items":{"type":"string"}},"validation":{"type":"object","properties":{"required":{"type":"boolean"},"min":{"type":"number"},"max":{"type":"number"},"pattern":{"type":"string"}}}},"required":["id","label"]}},"outputs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"field":{"type":"string"},"type":{"type":"string","enum":["string","number","boolean","date","select","multiselect","regex","function","list"]},"enumName":{"type":"string"},"options":{"type":"array","items":{"type":"string"}},"caseSensitive":{"type":"boolean"},"functionName":{"type":"string"},"functionParams":{"type":"array","items":{"type":"string"}},"validation":{"type":"object","properties":{"required":{"type":"boolean"},"min":{"type":"number"},"max":{"type":"number"},"pattern":{"type":"string"}}}},"required":["id","label"]}},"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"enabled":{"type":"boolean"},"inputs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"object","properties":{"value":{"type":"string"},"operator":{"type":"string"}},"required":["value"]}]}},"outputs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["id","inputs","outputs"]}}},"required":["name","hitPolicy","inputs","outputs","rules"]}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"context":{"type":"object","properties":{"type":{"type":"string","enum":["organization","partner","customer"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"organizationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["type","id"],"additionalProperties":false},"name":{"type":"string"},"slugId":{"type":"string"},"description":{"type":["string","null"]},"kind":{"default":"generic","type":"string","enum":["generic","fraud-block","routing","routing-plan","fees","provider-fees","emi-fees","emi-gas-fees","fx","payment-options","notification-rules","notification-routing"]},"enabled":{"default":true,"type":"boolean"},"priority":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"preConditions":{"default":[],"type":"array","items":{"type":"object","properties":{"field":{"type":"string","minLength":1},"op":{"default":"in","type":"string","enum":["in","not-in"]},"values":{"default":[],"type":"array","items":{"type":"string"}}},"required":["field","op","values"],"additionalProperties":false}},"hitPolicy":{"type":"string","enum":["first","collect"]},"inputs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"field":{"type":"string"},"type":{"type":"string","enum":["string","number","boolean","date","select","multiselect","regex","function","list"]},"enumName":{"type":"string"},"options":{"type":"array","items":{"type":"string"}},"caseSensitive":{"type":"boolean"},"functionName":{"type":"string"},"functionParams":{"type":"array","items":{"type":"string"}},"validation":{"type":"object","properties":{"required":{"type":"boolean"},"min":{"type":"number"},"max":{"type":"number"},"pattern":{"type":"string"}},"additionalProperties":false}},"required":["id","label"],"additionalProperties":false}},"outputs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"field":{"type":"string"},"type":{"type":"string","enum":["string","number","boolean","date","select","multiselect","regex","function","list"]},"enumName":{"type":"string"},"options":{"type":"array","items":{"type":"string"}},"caseSensitive":{"type":"boolean"},"functionName":{"type":"string"},"functionParams":{"type":"array","items":{"type":"string"}},"validation":{"type":"object","properties":{"required":{"type":"boolean"},"min":{"type":"number"},"max":{"type":"number"},"pattern":{"type":"string"}},"additionalProperties":false}},"required":["id","label"],"additionalProperties":false}},"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"enabled":{"type":"boolean"},"inputs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"object","properties":{"value":{"type":"string"},"operator":{"type":"string"}},"required":["value"],"additionalProperties":false}]}},"outputs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["id","inputs","outputs"],"additionalProperties":false}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"createdBy":{"type":["string","null"]}},"required":["id","context","name","slugId","description","kind","enabled","priority","preConditions","hitPolicy","inputs","outputs","rules","createdAt","updatedAt","createdBy"],"additionalProperties":false}}}},"201":{"description":"201","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"context":{"type":"object","properties":{"type":{"type":"string","enum":["organization","partner","customer"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"organizationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["type","id"],"additionalProperties":false},"name":{"type":"string"},"slugId":{"type":"string"},"description":{"type":["string","null"]},"kind":{"default":"generic","type":"string","enum":["generic","fraud-block","routing","routing-plan","fees","provider-fees","emi-fees","emi-gas-fees","fx","payment-options","notification-rules","notification-routing"]},"enabled":{"default":true,"type":"boolean"},"priority":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"preConditions":{"default":[],"type":"array","items":{"type":"object","properties":{"field":{"type":"string","minLength":1},"op":{"default":"in","type":"string","enum":["in","not-in"]},"values":{"default":[],"type":"array","items":{"type":"string"}}},"required":["field","op","values"],"additionalProperties":false}},"hitPolicy":{"type":"string","enum":["first","collect"]},"inputs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"field":{"type":"string"},"type":{"type":"string","enum":["string","number","boolean","date","select","multiselect","regex","function","list"]},"enumName":{"type":"string"},"options":{"type":"array","items":{"type":"string"}},"caseSensitive":{"type":"boolean"},"functionName":{"type":"string"},"functionParams":{"type":"array","items":{"type":"string"}},"validation":{"type":"object","properties":{"required":{"type":"boolean"},"min":{"type":"number"},"max":{"type":"number"},"pattern":{"type":"string"}},"additionalProperties":false}},"required":["id","label"],"additionalProperties":false}},"outputs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"field":{"type":"string"},"type":{"type":"string","enum":["string","number","boolean","date","select","multiselect","regex","function","list"]},"enumName":{"type":"string"},"options":{"type":"array","items":{"type":"string"}},"caseSensitive":{"type":"boolean"},"functionName":{"type":"string"},"functionParams":{"type":"array","items":{"type":"string"}},"validation":{"type":"object","properties":{"required":{"type":"boolean"},"min":{"type":"number"},"max":{"type":"number"},"pattern":{"type":"string"}},"additionalProperties":false}},"required":["id","label"],"additionalProperties":false}},"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"enabled":{"type":"boolean"},"inputs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"object","properties":{"value":{"type":"string"},"operator":{"type":"string"}},"required":["value"],"additionalProperties":false}]}},"outputs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["id","inputs","outputs"],"additionalProperties":false}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"createdBy":{"type":["string","null"]}},"required":["id","context","name","slugId","description","kind","enabled","priority","preConditions","hitPolicy","inputs","outputs","rules","createdAt","updatedAt","createdBy"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/decision-tables/{decisionTableId}/metadata":{"patch":{"summary":"Update decision table metadata (name, description, hit policy, slugId)","tags":["decisionTables"],"parameters":[{"name":"decisionTableId","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"contextType","in":"query","required":true,"schema":{"type":"string","enum":["organization","partner","customer"]}},{"name":"contextId","in":"query","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"slugId":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$"},"description":{"type":["string","null"]},"hitPolicy":{"type":"string","enum":["first","collect"]},"kind":{"type":"string","enum":["generic","fraud-block","routing","routing-plan","fees","provider-fees","emi-fees","emi-gas-fees","fx","payment-options","notification-rules","notification-routing"]},"enabled":{"type":"boolean"},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"preConditions":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","minLength":1},"op":{"default":"in","type":"string","enum":["in","not-in"]},"values":{"default":[],"type":"array","items":{"type":"string"}}},"required":["field"]}}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"context":{"type":"object","properties":{"type":{"type":"string","enum":["organization","partner","customer"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"organizationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["type","id"],"additionalProperties":false},"name":{"type":"string"},"slugId":{"type":"string"},"description":{"type":["string","null"]},"kind":{"default":"generic","type":"string","enum":["generic","fraud-block","routing","routing-plan","fees","provider-fees","emi-fees","emi-gas-fees","fx","payment-options","notification-rules","notification-routing"]},"enabled":{"default":true,"type":"boolean"},"priority":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"preConditions":{"default":[],"type":"array","items":{"type":"object","properties":{"field":{"type":"string","minLength":1},"op":{"default":"in","type":"string","enum":["in","not-in"]},"values":{"default":[],"type":"array","items":{"type":"string"}}},"required":["field","op","values"],"additionalProperties":false}},"hitPolicy":{"type":"string","enum":["first","collect"]},"inputs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"field":{"type":"string"},"type":{"type":"string","enum":["string","number","boolean","date","select","multiselect","regex","function","list"]},"enumName":{"type":"string"},"options":{"type":"array","items":{"type":"string"}},"caseSensitive":{"type":"boolean"},"functionName":{"type":"string"},"functionParams":{"type":"array","items":{"type":"string"}},"validation":{"type":"object","properties":{"required":{"type":"boolean"},"min":{"type":"number"},"max":{"type":"number"},"pattern":{"type":"string"}},"additionalProperties":false}},"required":["id","label"],"additionalProperties":false}},"outputs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"field":{"type":"string"},"type":{"type":"string","enum":["string","number","boolean","date","select","multiselect","regex","function","list"]},"enumName":{"type":"string"},"options":{"type":"array","items":{"type":"string"}},"caseSensitive":{"type":"boolean"},"functionName":{"type":"string"},"functionParams":{"type":"array","items":{"type":"string"}},"validation":{"type":"object","properties":{"required":{"type":"boolean"},"min":{"type":"number"},"max":{"type":"number"},"pattern":{"type":"string"}},"additionalProperties":false}},"required":["id","label"],"additionalProperties":false}},"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"enabled":{"type":"boolean"},"inputs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"object","properties":{"value":{"type":"string"},"operator":{"type":"string"}},"required":["value"],"additionalProperties":false}]}},"outputs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["id","inputs","outputs"],"additionalProperties":false}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"createdBy":{"type":["string","null"]}},"required":["id","context","name","slugId","description","kind","enabled","priority","preConditions","hitPolicy","inputs","outputs","rules","createdAt","updatedAt","createdBy"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"409":{"description":"409","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/decision-tables/{decisionTableId}/schema":{"put":{"summary":"Update decision table schema (columns) - replaces all columns","tags":["decisionTables"],"parameters":[{"name":"decisionTableId","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"contextType","in":"query","required":true,"schema":{"type":"string","enum":["organization","partner","customer"]}},{"name":"contextId","in":"query","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"inputs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"field":{"type":"string"},"type":{"type":"string","enum":["string","number","boolean","date","select","multiselect","regex","function","list"]},"enumName":{"type":"string"},"options":{"type":"array","items":{"type":"string"}},"caseSensitive":{"type":"boolean"},"functionName":{"type":"string"},"functionParams":{"type":"array","items":{"type":"string"}},"validation":{"type":"object","properties":{"required":{"type":"boolean"},"min":{"type":"number"},"max":{"type":"number"},"pattern":{"type":"string"}}}},"required":["id","label"]}},"outputs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"field":{"type":"string"},"type":{"type":"string","enum":["string","number","boolean","date","select","multiselect","regex","function","list"]},"enumName":{"type":"string"},"options":{"type":"array","items":{"type":"string"}},"caseSensitive":{"type":"boolean"},"functionName":{"type":"string"},"functionParams":{"type":"array","items":{"type":"string"}},"validation":{"type":"object","properties":{"required":{"type":"boolean"},"min":{"type":"number"},"max":{"type":"number"},"pattern":{"type":"string"}}}},"required":["id","label"]}}},"required":["inputs","outputs"]}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"context":{"type":"object","properties":{"type":{"type":"string","enum":["organization","partner","customer"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"organizationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["type","id"],"additionalProperties":false},"name":{"type":"string"},"slugId":{"type":"string"},"description":{"type":["string","null"]},"kind":{"default":"generic","type":"string","enum":["generic","fraud-block","routing","routing-plan","fees","provider-fees","emi-fees","emi-gas-fees","fx","payment-options","notification-rules","notification-routing"]},"enabled":{"default":true,"type":"boolean"},"priority":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"preConditions":{"default":[],"type":"array","items":{"type":"object","properties":{"field":{"type":"string","minLength":1},"op":{"default":"in","type":"string","enum":["in","not-in"]},"values":{"default":[],"type":"array","items":{"type":"string"}}},"required":["field","op","values"],"additionalProperties":false}},"hitPolicy":{"type":"string","enum":["first","collect"]},"inputs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"field":{"type":"string"},"type":{"type":"string","enum":["string","number","boolean","date","select","multiselect","regex","function","list"]},"enumName":{"type":"string"},"options":{"type":"array","items":{"type":"string"}},"caseSensitive":{"type":"boolean"},"functionName":{"type":"string"},"functionParams":{"type":"array","items":{"type":"string"}},"validation":{"type":"object","properties":{"required":{"type":"boolean"},"min":{"type":"number"},"max":{"type":"number"},"pattern":{"type":"string"}},"additionalProperties":false}},"required":["id","label"],"additionalProperties":false}},"outputs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"field":{"type":"string"},"type":{"type":"string","enum":["string","number","boolean","date","select","multiselect","regex","function","list"]},"enumName":{"type":"string"},"options":{"type":"array","items":{"type":"string"}},"caseSensitive":{"type":"boolean"},"functionName":{"type":"string"},"functionParams":{"type":"array","items":{"type":"string"}},"validation":{"type":"object","properties":{"required":{"type":"boolean"},"min":{"type":"number"},"max":{"type":"number"},"pattern":{"type":"string"}},"additionalProperties":false}},"required":["id","label"],"additionalProperties":false}},"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"enabled":{"type":"boolean"},"inputs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"object","properties":{"value":{"type":"string"},"operator":{"type":"string"}},"required":["value"],"additionalProperties":false}]}},"outputs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["id","inputs","outputs"],"additionalProperties":false}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"createdBy":{"type":["string","null"]}},"required":["id","context","name","slugId","description","kind","enabled","priority","preConditions","hitPolicy","inputs","outputs","rules","createdAt","updatedAt","createdBy"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/decision-tables/{decisionTableId}/rules":{"put":{"summary":"Update decision table rules - replaces all rules","tags":["decisionTables"],"parameters":[{"name":"decisionTableId","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"contextType","in":"query","required":true,"schema":{"type":"string","enum":["organization","partner","customer"]}},{"name":"contextId","in":"query","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"enabled":{"type":"boolean"},"inputs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"object","properties":{"value":{"type":"string"},"operator":{"type":"string"}},"required":["value"]}]}},"outputs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["id","inputs","outputs"]}}},"required":["rules"]}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"context":{"type":"object","properties":{"type":{"type":"string","enum":["organization","partner","customer"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"organizationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["type","id"],"additionalProperties":false},"name":{"type":"string"},"slugId":{"type":"string"},"description":{"type":["string","null"]},"kind":{"default":"generic","type":"string","enum":["generic","fraud-block","routing","routing-plan","fees","provider-fees","emi-fees","emi-gas-fees","fx","payment-options","notification-rules","notification-routing"]},"enabled":{"default":true,"type":"boolean"},"priority":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"preConditions":{"default":[],"type":"array","items":{"type":"object","properties":{"field":{"type":"string","minLength":1},"op":{"default":"in","type":"string","enum":["in","not-in"]},"values":{"default":[],"type":"array","items":{"type":"string"}}},"required":["field","op","values"],"additionalProperties":false}},"hitPolicy":{"type":"string","enum":["first","collect"]},"inputs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"field":{"type":"string"},"type":{"type":"string","enum":["string","number","boolean","date","select","multiselect","regex","function","list"]},"enumName":{"type":"string"},"options":{"type":"array","items":{"type":"string"}},"caseSensitive":{"type":"boolean"},"functionName":{"type":"string"},"functionParams":{"type":"array","items":{"type":"string"}},"validation":{"type":"object","properties":{"required":{"type":"boolean"},"min":{"type":"number"},"max":{"type":"number"},"pattern":{"type":"string"}},"additionalProperties":false}},"required":["id","label"],"additionalProperties":false}},"outputs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"field":{"type":"string"},"type":{"type":"string","enum":["string","number","boolean","date","select","multiselect","regex","function","list"]},"enumName":{"type":"string"},"options":{"type":"array","items":{"type":"string"}},"caseSensitive":{"type":"boolean"},"functionName":{"type":"string"},"functionParams":{"type":"array","items":{"type":"string"}},"validation":{"type":"object","properties":{"required":{"type":"boolean"},"min":{"type":"number"},"max":{"type":"number"},"pattern":{"type":"string"}},"additionalProperties":false}},"required":["id","label"],"additionalProperties":false}},"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"enabled":{"type":"boolean"},"inputs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"object","properties":{"value":{"type":"string"},"operator":{"type":"string"}},"required":["value"],"additionalProperties":false}]}},"outputs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["id","inputs","outputs"],"additionalProperties":false}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"createdBy":{"type":["string","null"]}},"required":["id","context","name","slugId","description","kind","enabled","priority","preConditions","hitPolicy","inputs","outputs","rules","createdAt","updatedAt","createdBy"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/decision-tables/reorder":{"post":{"summary":"Reorder decision tables of a given kind by setting their priority","tags":["decisionTables"],"parameters":[{"name":"contextType","in":"query","required":true,"schema":{"type":"string","enum":["organization","partner","customer"]}},{"name":"contextId","in":"query","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["generic","fraud-block","routing","routing-plan","fees","provider-fees","emi-fees","emi-gas-fees","fx","payment-options","notification-rules","notification-routing"]},"decisionTableIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["kind","decisionTableIds"]}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"context":{"type":"object","properties":{"type":{"type":"string","enum":["organization","partner","customer"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"organizationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["type","id"],"additionalProperties":false},"name":{"type":"string"},"slugId":{"type":"string"},"description":{"type":["string","null"]},"kind":{"default":"generic","type":"string","enum":["generic","fraud-block","routing","routing-plan","fees","provider-fees","emi-fees","emi-gas-fees","fx","payment-options","notification-rules","notification-routing"]},"enabled":{"default":true,"type":"boolean"},"priority":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"preConditions":{"default":[],"type":"array","items":{"type":"object","properties":{"field":{"type":"string","minLength":1},"op":{"default":"in","type":"string","enum":["in","not-in"]},"values":{"default":[],"type":"array","items":{"type":"string"}}},"required":["field","op","values"],"additionalProperties":false}},"hitPolicy":{"type":"string","enum":["first","collect"]},"inputs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"field":{"type":"string"},"type":{"type":"string","enum":["string","number","boolean","date","select","multiselect","regex","function","list"]},"enumName":{"type":"string"},"options":{"type":"array","items":{"type":"string"}},"caseSensitive":{"type":"boolean"},"functionName":{"type":"string"},"functionParams":{"type":"array","items":{"type":"string"}},"validation":{"type":"object","properties":{"required":{"type":"boolean"},"min":{"type":"number"},"max":{"type":"number"},"pattern":{"type":"string"}},"additionalProperties":false}},"required":["id","label"],"additionalProperties":false}},"outputs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"field":{"type":"string"},"type":{"type":"string","enum":["string","number","boolean","date","select","multiselect","regex","function","list"]},"enumName":{"type":"string"},"options":{"type":"array","items":{"type":"string"}},"caseSensitive":{"type":"boolean"},"functionName":{"type":"string"},"functionParams":{"type":"array","items":{"type":"string"}},"validation":{"type":"object","properties":{"required":{"type":"boolean"},"min":{"type":"number"},"max":{"type":"number"},"pattern":{"type":"string"}},"additionalProperties":false}},"required":["id","label"],"additionalProperties":false}},"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"enabled":{"type":"boolean"},"inputs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"object","properties":{"value":{"type":"string"},"operator":{"type":"string"}},"required":["value"],"additionalProperties":false}]}},"outputs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["id","inputs","outputs"],"additionalProperties":false}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"createdBy":{"type":["string","null"]}},"required":["id","context","name","slugId","description","kind","enabled","priority","preConditions","hitPolicy","inputs","outputs","rules","createdAt","updatedAt","createdBy"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/decision-tables/{decisionTableId}/test":{"post":{"summary":"Test a decision table with input values","tags":["decisionTables"],"parameters":[{"name":"decisionTableId","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"contextType","in":"query","required":true,"schema":{"type":"string","enum":["organization","partner","customer"]}},{"name":"contextId","in":"query","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"matchedRuleIds":{"type":"array","items":{"type":"string"}},"outputs":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}}},"required":["matchedRuleIds","outputs"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/fx/rates":{"get":{"summary":"Get the FX rate table for a context","tags":["fx"],"parameters":[{"name":"contextType","in":"query","required":true,"schema":{"type":"string","enum":["organization","customer"]}},{"name":"contextId","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"contextType":{"type":"string","enum":["organization","customer"]},"contextId":{"type":"string"},"baseCurrency":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9]{2,10}$"},{"type":"null"}]},"rates":{"type":"array","items":{"type":"object","properties":{"baseCurrency":{"type":"string","pattern":"^[A-Za-z0-9]{2,10}$"},"quoteCurrency":{"type":"string","pattern":"^[A-Za-z0-9]{2,10}$"},"rate":{"type":"number","exclusiveMinimum":0},"source":{"type":"string","enum":["provider","manual"]},"provider":{"type":["string","null"]},"asOf":{"type":["string","null"]},"updatedAt":{"type":["string","null"]}},"required":["baseCurrency","quoteCurrency","rate","source"],"additionalProperties":false}}},"required":["contextType","contextId","rates"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/fx/rates/override":{"put":{"summary":"Override a single FX rate (permission-gated)","tags":["fx"],"parameters":[{"name":"contextType","in":"query","required":true,"schema":{"type":"string","enum":["organization","customer"]}},{"name":"contextId","in":"query","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"baseCurrency":{"type":"string","pattern":"^[A-Za-z0-9]{2,10}$"},"quoteCurrency":{"type":"string","pattern":"^[A-Za-z0-9]{2,10}$"},"rate":{"type":"number","exclusiveMinimum":0}},"required":["baseCurrency","quoteCurrency","rate"]}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"baseCurrency":{"type":"string","pattern":"^[A-Za-z0-9]{2,10}$"},"quoteCurrency":{"type":"string","pattern":"^[A-Za-z0-9]{2,10}$"},"rate":{"type":"number","exclusiveMinimum":0},"source":{"type":"string","enum":["provider","manual"]},"provider":{"type":["string","null"]},"asOf":{"type":["string","null"]},"updatedAt":{"type":["string","null"]}},"required":["baseCurrency","quoteCurrency","rate","source"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}},"delete":{"summary":"Undo a manual FX rate override (permission-gated)","tags":["fx"],"parameters":[{"name":"contextType","in":"query","required":true,"schema":{"type":"string","enum":["organization","customer"]}},{"name":"contextId","in":"query","required":true,"schema":{"type":"string"}},{"name":"baseCurrency","in":"query","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9]{2,10}$"}},{"name":"quoteCurrency","in":"query","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9]{2,10}$"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/fx/refresh":{"post":{"summary":"Refresh FX rates from the provider","tags":["fx"],"parameters":[{"name":"contextType","in":"query","required":true,"schema":{"type":"string","enum":["organization","customer"]}},{"name":"contextId","in":"query","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"contextType":{"type":"string","enum":["organization","customer"]},"contextId":{"type":"string"},"baseCurrency":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9]{2,10}$"},{"type":"null"}]},"rates":{"type":"array","items":{"type":"object","properties":{"baseCurrency":{"type":"string","pattern":"^[A-Za-z0-9]{2,10}$"},"quoteCurrency":{"type":"string","pattern":"^[A-Za-z0-9]{2,10}$"},"rate":{"type":"number","exclusiveMinimum":0},"source":{"type":"string","enum":["provider","manual"]},"provider":{"type":["string","null"]},"asOf":{"type":["string","null"]},"updatedAt":{"type":["string","null"]}},"required":["baseCurrency","quoteCurrency","rate","source"],"additionalProperties":false}}},"required":["contextType","contextId","rates"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"502":{"description":"502","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/services/definitions":{"get":{"summary":"Get the service definitions available to a context","tags":["serviceConnections"],"parameters":[{"name":"contextType","in":"query","schema":{"type":"string","enum":["organization","partner","customer"]}},{"name":"contextId","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"interfaces":{"type":"array","items":{"type":"string","enum":["erp","payment","analytics","crm","iplookup","binlookup","cardinspect","exchange","cryptoexchange","devicefingerprint","threeds","risk","email","sms","ai","bank","observability"]}},"contexts":{"type":"array","items":{"type":"string","enum":["organization","partner","customer"]}},"authTypes":{"type":"array","items":{"type":"string","enum":["oauth","api_key"]}},"allowsMultipleConnections":{"default":true,"type":"boolean"},"uiMetadata":{"type":"object","properties":{"icon":{"type":"string"},"category":{"type":"string"},"fields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","enum":["text","password","select","textarea","number","email","url","checkbox","multiselect"]},"required":{"type":"boolean"},"placeholder":{"type":"string"},"description":{"type":"string"},"help":{"type":"object","properties":{"text":{"type":"string"},"codes":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"meaning":{"type":"string"}},"required":["value","meaning"],"additionalProperties":false}},"links":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"url":{"type":"string","format":"uri"}},"required":["label","url"],"additionalProperties":false}}},"required":["text"],"additionalProperties":false},"default":{},"options":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"label":{"type":"string"}},"required":["value","label"],"additionalProperties":false}},"validation":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["name","label","type"],"additionalProperties":false}},"description":{"type":"string"},"testing":{"type":"object","properties":{"intro":{"type":"string"},"cards":{"type":"array","items":{"type":"object","properties":{"pan":{"type":"string"},"brand":{"type":"string"},"expiry":{"type":"string"},"cvv":{"type":"string"},"scenario":{"type":"string"}},"required":["pan","scenario"],"additionalProperties":false}},"triggers":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"value":{"type":"string"},"effect":{"type":"string"}},"required":["field","value","effect"],"additionalProperties":false}},"notes":{"type":"array","items":{"type":"string"}},"links":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"url":{"type":"string","format":"uri"}},"required":["label","url"],"additionalProperties":false}}},"additionalProperties":false}},"additionalProperties":false},"supportsWhiteLabel":{"type":"boolean"},"supportedPaymentOptions":{"type":"array","items":{"type":"string"}},"outputFields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","enum":["string","number","boolean"]},"description":{"type":"string"}},"required":["id","label","type"],"additionalProperties":false}},"capabilities":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"defaults":{"type":"object","properties":{"constraints":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"allow":{"readOnly":true,"type":"array","items":{"type":"string"}},"deny":{"readOnly":true,"type":"array","items":{"type":"string"}}},"additionalProperties":false}}},"additionalProperties":false},"options":{"readOnly":true,"type":"array","items":{"type":"object","properties":{"option":{"type":"string"},"operations":{"readOnly":true,"type":"array","items":{"type":"string"}},"constraints":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"allow":{"readOnly":true,"type":"array","items":{"type":"string"}},"deny":{"readOnly":true,"type":"array","items":{"type":"string"}}},"additionalProperties":false}},"flows":{"readOnly":true,"type":"array","items":{"type":"string"}},"notes":{"type":"string"}},"required":["option","operations"],"additionalProperties":false}}},"required":["options"],"additionalProperties":false}}},"required":["id","name","description","interfaces","contexts","authTypes","allowsMultipleConnections"],"additionalProperties":false}}}}}}}},"/api/v1/services/interfaces/{interface}":{"get":{"summary":"Get services implementing a specific interface","tags":["serviceConnections"],"parameters":[{"name":"interface","in":"path","required":true,"schema":{"type":"string","enum":["erp","payment","analytics","crm","iplookup","binlookup","cardinspect","exchange","cryptoexchange","devicefingerprint","threeds","risk","email","sms","ai","bank","observability"]}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"interfaces":{"type":"array","items":{"type":"string","enum":["erp","payment","analytics","crm","iplookup","binlookup","cardinspect","exchange","cryptoexchange","devicefingerprint","threeds","risk","email","sms","ai","bank","observability"]}},"contexts":{"type":"array","items":{"type":"string","enum":["organization","partner","customer"]}},"authTypes":{"type":"array","items":{"type":"string","enum":["oauth","api_key"]}},"allowsMultipleConnections":{"default":true,"type":"boolean"},"uiMetadata":{"type":"object","properties":{"icon":{"type":"string"},"category":{"type":"string"},"fields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","enum":["text","password","select","textarea","number","email","url","checkbox","multiselect"]},"required":{"type":"boolean"},"placeholder":{"type":"string"},"description":{"type":"string"},"help":{"type":"object","properties":{"text":{"type":"string"},"codes":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"meaning":{"type":"string"}},"required":["value","meaning"],"additionalProperties":false}},"links":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"url":{"type":"string","format":"uri"}},"required":["label","url"],"additionalProperties":false}}},"required":["text"],"additionalProperties":false},"default":{},"options":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"label":{"type":"string"}},"required":["value","label"],"additionalProperties":false}},"validation":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["name","label","type"],"additionalProperties":false}},"description":{"type":"string"},"testing":{"type":"object","properties":{"intro":{"type":"string"},"cards":{"type":"array","items":{"type":"object","properties":{"pan":{"type":"string"},"brand":{"type":"string"},"expiry":{"type":"string"},"cvv":{"type":"string"},"scenario":{"type":"string"}},"required":["pan","scenario"],"additionalProperties":false}},"triggers":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"value":{"type":"string"},"effect":{"type":"string"}},"required":["field","value","effect"],"additionalProperties":false}},"notes":{"type":"array","items":{"type":"string"}},"links":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"url":{"type":"string","format":"uri"}},"required":["label","url"],"additionalProperties":false}}},"additionalProperties":false}},"additionalProperties":false},"supportsWhiteLabel":{"type":"boolean"},"supportedPaymentOptions":{"type":"array","items":{"type":"string"}},"outputFields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","enum":["string","number","boolean"]},"description":{"type":"string"}},"required":["id","label","type"],"additionalProperties":false}},"capabilities":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"defaults":{"type":"object","properties":{"constraints":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"allow":{"readOnly":true,"type":"array","items":{"type":"string"}},"deny":{"readOnly":true,"type":"array","items":{"type":"string"}}},"additionalProperties":false}}},"additionalProperties":false},"options":{"readOnly":true,"type":"array","items":{"type":"object","properties":{"option":{"type":"string"},"operations":{"readOnly":true,"type":"array","items":{"type":"string"}},"constraints":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"allow":{"readOnly":true,"type":"array","items":{"type":"string"}},"deny":{"readOnly":true,"type":"array","items":{"type":"string"}}},"additionalProperties":false}},"flows":{"readOnly":true,"type":"array","items":{"type":"string"}},"notes":{"type":"string"}},"required":["option","operations"],"additionalProperties":false}}},"required":["options"],"additionalProperties":false}}},"required":["id","name","description","interfaces","contexts","authTypes","allowsMultipleConnections"],"additionalProperties":false}}}}}}}},"/api/v1/services/contexts/{context}":{"get":{"summary":"Get services available for a specific context","tags":["serviceConnections"],"parameters":[{"name":"context","in":"path","required":true,"schema":{"type":"string","enum":["organization","partner","customer"]}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"interfaces":{"type":"array","items":{"type":"string","enum":["erp","payment","analytics","crm","iplookup","binlookup","cardinspect","exchange","cryptoexchange","devicefingerprint","threeds","risk","email","sms","ai","bank","observability"]}},"contexts":{"type":"array","items":{"type":"string","enum":["organization","partner","customer"]}},"authTypes":{"type":"array","items":{"type":"string","enum":["oauth","api_key"]}},"allowsMultipleConnections":{"default":true,"type":"boolean"},"uiMetadata":{"type":"object","properties":{"icon":{"type":"string"},"category":{"type":"string"},"fields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","enum":["text","password","select","textarea","number","email","url","checkbox","multiselect"]},"required":{"type":"boolean"},"placeholder":{"type":"string"},"description":{"type":"string"},"help":{"type":"object","properties":{"text":{"type":"string"},"codes":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"meaning":{"type":"string"}},"required":["value","meaning"],"additionalProperties":false}},"links":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"url":{"type":"string","format":"uri"}},"required":["label","url"],"additionalProperties":false}}},"required":["text"],"additionalProperties":false},"default":{},"options":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"label":{"type":"string"}},"required":["value","label"],"additionalProperties":false}},"validation":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["name","label","type"],"additionalProperties":false}},"description":{"type":"string"},"testing":{"type":"object","properties":{"intro":{"type":"string"},"cards":{"type":"array","items":{"type":"object","properties":{"pan":{"type":"string"},"brand":{"type":"string"},"expiry":{"type":"string"},"cvv":{"type":"string"},"scenario":{"type":"string"}},"required":["pan","scenario"],"additionalProperties":false}},"triggers":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"value":{"type":"string"},"effect":{"type":"string"}},"required":["field","value","effect"],"additionalProperties":false}},"notes":{"type":"array","items":{"type":"string"}},"links":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"url":{"type":"string","format":"uri"}},"required":["label","url"],"additionalProperties":false}}},"additionalProperties":false}},"additionalProperties":false},"supportsWhiteLabel":{"type":"boolean"},"supportedPaymentOptions":{"type":"array","items":{"type":"string"}},"outputFields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","enum":["string","number","boolean"]},"description":{"type":"string"}},"required":["id","label","type"],"additionalProperties":false}},"capabilities":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"defaults":{"type":"object","properties":{"constraints":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"allow":{"readOnly":true,"type":"array","items":{"type":"string"}},"deny":{"readOnly":true,"type":"array","items":{"type":"string"}}},"additionalProperties":false}}},"additionalProperties":false},"options":{"readOnly":true,"type":"array","items":{"type":"object","properties":{"option":{"type":"string"},"operations":{"readOnly":true,"type":"array","items":{"type":"string"}},"constraints":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"allow":{"readOnly":true,"type":"array","items":{"type":"string"}},"deny":{"readOnly":true,"type":"array","items":{"type":"string"}}},"additionalProperties":false}},"flows":{"readOnly":true,"type":"array","items":{"type":"string"}},"notes":{"type":"string"}},"required":["option","operations"],"additionalProperties":false}}},"required":["options"],"additionalProperties":false}}},"required":["id","name","description","interfaces","contexts","authTypes","allowsMultipleConnections"],"additionalProperties":false}}}}}}}},"/api/v1/service-connections":{"get":{"summary":"List service connections for current context","tags":["serviceConnections"],"parameters":[{"name":"contextType","in":"query","schema":{"type":"string","enum":["organization","partner","customer"]}},{"name":"contextId","in":"query","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"serviceId":{"type":"string"},"slugId":{"type":"string","minLength":3,"maxLength":256,"pattern":"^[a-z0-9-]+$"},"providerId":{"type":"string"},"contextType":{"type":"string","enum":["organization","partner","customer"]},"contextId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"authenticationType":{"type":"string","const":"oauth"},"name":{"type":"string","minLength":1},"status":{"type":"string","enum":["ACTIVE","INACTIVE","PENDING","ERROR","EXPIRED"]},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"lastSyncedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"managedByApplicationId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"clientId":{"type":"string"},"tokenExpiry":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","serviceId","slugId","contextType","contextId","authenticationType","name","status","config","createdAt","updatedAt","clientId","tokenExpiry"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"serviceId":{"type":"string"},"slugId":{"type":"string","minLength":3,"maxLength":256,"pattern":"^[a-z0-9-]+$"},"providerId":{"type":"string"},"contextType":{"type":"string","enum":["organization","partner","customer"]},"contextId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"authenticationType":{"type":"string","const":"api_key"},"name":{"type":"string","minLength":1},"status":{"type":"string","enum":["ACTIVE","INACTIVE","PENDING","ERROR","EXPIRED"]},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"lastSyncedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"managedByApplicationId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"clientId":{"type":"string"},"clientSecret":{"type":"string"},"refreshToken":{"type":"string"},"tokenExpiry":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","serviceId","slugId","contextType","contextId","authenticationType","name","status","config","createdAt","updatedAt"],"additionalProperties":false}]}}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/service-connections/{slugId}":{"get":{"summary":"Get a service connection by slugId (context from auth header)","tags":["serviceConnections"],"parameters":[{"name":"slugId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"serviceId":{"type":"string"},"slugId":{"type":"string","minLength":3,"maxLength":256,"pattern":"^[a-z0-9-]+$"},"providerId":{"type":"string"},"contextType":{"type":"string","enum":["organization","partner","customer"]},"contextId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"authenticationType":{"type":"string","const":"oauth"},"name":{"type":"string","minLength":1},"status":{"type":"string","enum":["ACTIVE","INACTIVE","PENDING","ERROR","EXPIRED"]},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"lastSyncedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"managedByApplicationId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"clientId":{"type":"string"},"tokenExpiry":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","serviceId","slugId","contextType","contextId","authenticationType","name","status","config","createdAt","updatedAt","clientId","tokenExpiry"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"serviceId":{"type":"string"},"slugId":{"type":"string","minLength":3,"maxLength":256,"pattern":"^[a-z0-9-]+$"},"providerId":{"type":"string"},"contextType":{"type":"string","enum":["organization","partner","customer"]},"contextId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"authenticationType":{"type":"string","const":"api_key"},"name":{"type":"string","minLength":1},"status":{"type":"string","enum":["ACTIVE","INACTIVE","PENDING","ERROR","EXPIRED"]},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"lastSyncedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"managedByApplicationId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"clientId":{"type":"string"},"clientSecret":{"type":"string"},"refreshToken":{"type":"string"},"tokenExpiry":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","serviceId","slugId","contextType","contextId","authenticationType","name","status","config","createdAt","updatedAt"],"additionalProperties":false}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/service-connections/oauth":{"post":{"summary":"Initiate an OAuth service connection flow","tags":["serviceConnections"],"parameters":[],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"serviceId":{"type":"string"},"providerSlug":{"type":"string"},"slugId":{"type":"string","minLength":3,"maxLength":256,"pattern":"^[a-z0-9-]+$"},"contextType":{"type":"string","enum":["organization","partner","customer"]},"contextId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"authenticationType":{"type":"string","const":"oauth"},"name":{"type":"string","minLength":1},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["serviceId","contextType","contextId","authenticationType","name","config"]}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"authorizationUrl":{"type":"string","format":"uri"},"state":{"type":"string"}},"required":["authorizationUrl","state"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"500":{"description":"500","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/oauth/callback":{"get":{"summary":"Complete a service connection OAuth flow","tags":["serviceConnections"],"parameters":[{"name":"code","in":"query","required":true,"schema":{"type":"string"}},{"name":"state","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"serviceId":{"type":"string"},"slugId":{"type":"string","minLength":3,"maxLength":256,"pattern":"^[a-z0-9-]+$"},"providerId":{"type":"string"},"contextType":{"type":"string","enum":["organization","partner","customer"]},"contextId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"authenticationType":{"type":"string","const":"oauth"},"name":{"type":"string","minLength":1},"status":{"type":"string","enum":["ACTIVE","INACTIVE","PENDING","ERROR","EXPIRED"]},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"lastSyncedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"managedByApplicationId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"clientId":{"type":"string"},"tokenExpiry":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","serviceId","slugId","contextType","contextId","authenticationType","name","status","config","createdAt","updatedAt","clientId","tokenExpiry"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"serviceId":{"type":"string"},"slugId":{"type":"string","minLength":3,"maxLength":256,"pattern":"^[a-z0-9-]+$"},"providerId":{"type":"string"},"contextType":{"type":"string","enum":["organization","partner","customer"]},"contextId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"authenticationType":{"type":"string","const":"api_key"},"name":{"type":"string","minLength":1},"status":{"type":"string","enum":["ACTIVE","INACTIVE","PENDING","ERROR","EXPIRED"]},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"lastSyncedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"managedByApplicationId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"clientId":{"type":"string"},"clientSecret":{"type":"string"},"refreshToken":{"type":"string"},"tokenExpiry":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","serviceId","slugId","contextType","contextId","authenticationType","name","status","config","createdAt","updatedAt"],"additionalProperties":false}]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/service-connections/api-key":{"post":{"summary":"Create an API key service connection","tags":["serviceConnections"],"parameters":[],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"serviceId":{"type":"string"},"providerSlug":{"type":"string"},"slugId":{"type":"string","minLength":3,"maxLength":256,"pattern":"^[a-z0-9-]+$"},"contextType":{"type":"string","enum":["organization","partner","customer"]},"contextId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"authenticationType":{"type":"string","const":"api_key"},"name":{"type":"string","minLength":1},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["serviceId","contextType","contextId","authenticationType","name","config"]}}}},"responses":{"201":{"description":"201","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"serviceId":{"type":"string"},"slugId":{"type":"string","minLength":3,"maxLength":256,"pattern":"^[a-z0-9-]+$"},"providerId":{"type":"string"},"contextType":{"type":"string","enum":["organization","partner","customer"]},"contextId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"authenticationType":{"type":"string","const":"oauth"},"name":{"type":"string","minLength":1},"status":{"type":"string","enum":["ACTIVE","INACTIVE","PENDING","ERROR","EXPIRED"]},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"lastSyncedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"managedByApplicationId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"clientId":{"type":"string"},"tokenExpiry":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","serviceId","slugId","contextType","contextId","authenticationType","name","status","config","createdAt","updatedAt","clientId","tokenExpiry"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"serviceId":{"type":"string"},"slugId":{"type":"string","minLength":3,"maxLength":256,"pattern":"^[a-z0-9-]+$"},"providerId":{"type":"string"},"contextType":{"type":"string","enum":["organization","partner","customer"]},"contextId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"authenticationType":{"type":"string","const":"api_key"},"name":{"type":"string","minLength":1},"status":{"type":"string","enum":["ACTIVE","INACTIVE","PENDING","ERROR","EXPIRED"]},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"lastSyncedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"managedByApplicationId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"clientId":{"type":"string"},"clientSecret":{"type":"string"},"refreshToken":{"type":"string"},"tokenExpiry":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","serviceId","slugId","contextType","contextId","authenticationType","name","status","config","createdAt","updatedAt"],"additionalProperties":false}]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"500":{"description":"500","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/service-connections/{id}/test":{"post":{"summary":"Test a service connection","tags":["serviceConnections"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ACTIVE","INACTIVE","PENDING","ERROR","EXPIRED"]},"message":{"type":"string"}},"required":["status"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"500":{"description":"500","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/service-connections/{id}":{"put":{"summary":"Update a service connection","tags":["serviceConnections"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"slugId":{"type":"string","minLength":3,"maxLength":256,"pattern":"^[a-z0-9-]+$"},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"serviceId":{"type":"string"},"slugId":{"type":"string","minLength":3,"maxLength":256,"pattern":"^[a-z0-9-]+$"},"providerId":{"type":"string"},"contextType":{"type":"string","enum":["organization","partner","customer"]},"contextId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"authenticationType":{"type":"string","const":"oauth"},"name":{"type":"string","minLength":1},"status":{"type":"string","enum":["ACTIVE","INACTIVE","PENDING","ERROR","EXPIRED"]},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"lastSyncedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"managedByApplicationId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"clientId":{"type":"string"},"tokenExpiry":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","serviceId","slugId","contextType","contextId","authenticationType","name","status","config","createdAt","updatedAt","clientId","tokenExpiry"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"serviceId":{"type":"string"},"slugId":{"type":"string","minLength":3,"maxLength":256,"pattern":"^[a-z0-9-]+$"},"providerId":{"type":"string"},"contextType":{"type":"string","enum":["organization","partner","customer"]},"contextId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"authenticationType":{"type":"string","const":"api_key"},"name":{"type":"string","minLength":1},"status":{"type":"string","enum":["ACTIVE","INACTIVE","PENDING","ERROR","EXPIRED"]},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"lastSyncedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"managedByApplicationId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"clientId":{"type":"string"},"clientSecret":{"type":"string"},"refreshToken":{"type":"string"},"tokenExpiry":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","serviceId","slugId","contextType","contextId","authenticationType","name","status","config","createdAt","updatedAt"],"additionalProperties":false}]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}},"delete":{"summary":"Delete a service connection","tags":["serviceConnections"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"409":{"description":"409","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"openTransactions":{"type":"number"},"recentTransactions":{"type":"number"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/providers":{"get":{"summary":"List providers for the current context","tags":["providers"],"parameters":[{"name":"serviceInterface","in":"query","schema":{"type":"string"}},{"name":"connectorId","in":"query","schema":{"type":"string"}},{"name":"contextType","in":"query","schema":{"type":"string","enum":["organization","partner","customer"]}},{"name":"contextId","in":"query","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"slugId":{"type":"string","minLength":3,"maxLength":256,"pattern":"^[a-z0-9-]+$"},"connectorId":{"type":"string"},"serviceInterface":{"type":"string"},"contextType":{"type":"string","enum":["organization","partner","customer"]},"contextId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1},"description":{"type":["string","null"]},"enabled":{"type":"boolean"},"capabilities":{"type":"array","items":{"type":"object","properties":{"option":{"type":"string"},"enabled":{"type":"boolean"},"operations":{"readOnly":true,"type":"array","items":{"type":"string"}},"constraints":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"allow":{"readOnly":true,"type":"array","items":{"type":"string"}},"deny":{"readOnly":true,"type":"array","items":{"type":"string"}}},"additionalProperties":false}}},"required":["option"],"additionalProperties":false}},"branding":{"anyOf":[{"type":"object","properties":{"displayName":{"type":"string"},"logoUrl":{"type":"string","format":"uri"},"supportUrl":{"type":"string","format":"uri"},"statementDescriptor":{"type":"string"}},"additionalProperties":false},{"type":"null"}]},"metadata":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","slugId","connectorId","serviceInterface","contextType","contextId","name","enabled","capabilities","createdAt","updatedAt"],"additionalProperties":false}}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}},"post":{"summary":"Define a provider over a connector","tags":["providers"],"parameters":[{"name":"contextType","in":"query","schema":{"type":"string","enum":["organization","partner","customer"]}},{"name":"contextId","in":"query","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"slugId":{"type":"string","minLength":3,"maxLength":256,"pattern":"^[a-z0-9-]+$"},"connectorId":{"type":"string"},"serviceInterface":{"type":"string"},"name":{"type":"string","minLength":1},"description":{"type":["string","null"]},"enabled":{"default":true,"type":"boolean"},"capabilities":{"default":[],"type":"array","items":{"type":"object","properties":{"option":{"type":"string"},"enabled":{"type":"boolean"},"operations":{"readOnly":true,"type":"array","items":{"type":"string"}},"constraints":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"allow":{"readOnly":true,"type":"array","items":{"type":"string"}},"deny":{"readOnly":true,"type":"array","items":{"type":"string"}}}}}},"required":["option"]}},"branding":{"anyOf":[{"type":"object","properties":{"displayName":{"type":"string"},"logoUrl":{"type":"string","format":"uri"},"supportUrl":{"type":"string","format":"uri"},"statementDescriptor":{"type":"string"}}},{"type":"null"}]},"metadata":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]}},"required":["slugId","connectorId","serviceInterface","name"]}}}},"responses":{"201":{"description":"201","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"slugId":{"type":"string","minLength":3,"maxLength":256,"pattern":"^[a-z0-9-]+$"},"connectorId":{"type":"string"},"serviceInterface":{"type":"string"},"contextType":{"type":"string","enum":["organization","partner","customer"]},"contextId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1},"description":{"type":["string","null"]},"enabled":{"type":"boolean"},"capabilities":{"type":"array","items":{"type":"object","properties":{"option":{"type":"string"},"enabled":{"type":"boolean"},"operations":{"readOnly":true,"type":"array","items":{"type":"string"}},"constraints":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"allow":{"readOnly":true,"type":"array","items":{"type":"string"}},"deny":{"readOnly":true,"type":"array","items":{"type":"string"}}},"additionalProperties":false}}},"required":["option"],"additionalProperties":false}},"branding":{"anyOf":[{"type":"object","properties":{"displayName":{"type":"string"},"logoUrl":{"type":"string","format":"uri"},"supportUrl":{"type":"string","format":"uri"},"statementDescriptor":{"type":"string"}},"additionalProperties":false},{"type":"null"}]},"metadata":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","slugId","connectorId","serviceInterface","contextType","contextId","name","enabled","capabilities","createdAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"violations":{"type":"array","items":{"type":"object","properties":{"option":{"type":"string"},"operations":{"type":"array","items":{"type":"string"}},"dimension":{"type":"string"},"message":{"type":"string"}},"required":["option","message"],"additionalProperties":false}}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/providers/{slugId}":{"get":{"summary":"Get one provider by slug","tags":["providers"],"parameters":[{"name":"slugId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"slugId":{"type":"string","minLength":3,"maxLength":256,"pattern":"^[a-z0-9-]+$"},"connectorId":{"type":"string"},"serviceInterface":{"type":"string"},"contextType":{"type":"string","enum":["organization","partner","customer"]},"contextId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1},"description":{"type":["string","null"]},"enabled":{"type":"boolean"},"capabilities":{"type":"array","items":{"type":"object","properties":{"option":{"type":"string"},"enabled":{"type":"boolean"},"operations":{"readOnly":true,"type":"array","items":{"type":"string"}},"constraints":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"allow":{"readOnly":true,"type":"array","items":{"type":"string"}},"deny":{"readOnly":true,"type":"array","items":{"type":"string"}}},"additionalProperties":false}}},"required":["option"],"additionalProperties":false}},"branding":{"anyOf":[{"type":"object","properties":{"displayName":{"type":"string"},"logoUrl":{"type":"string","format":"uri"},"supportUrl":{"type":"string","format":"uri"},"statementDescriptor":{"type":"string"}},"additionalProperties":false},{"type":"null"}]},"metadata":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","slugId","connectorId","serviceInterface","contextType","contextId","name","enabled","capabilities","createdAt","updatedAt"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}},"patch":{"summary":"Change a provider's narrowing or display identity","tags":["providers"],"parameters":[{"name":"slugId","in":"path","required":true,"schema":{"type":"string"}},{"name":"contextType","in":"query","schema":{"type":"string","enum":["organization","partner","customer"]}},{"name":"contextId","in":"query","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"description":{"type":["string","null"]},"enabled":{"type":"boolean"},"capabilities":{"type":"array","items":{"type":"object","properties":{"option":{"type":"string"},"enabled":{"type":"boolean"},"operations":{"readOnly":true,"type":"array","items":{"type":"string"}},"constraints":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"allow":{"readOnly":true,"type":"array","items":{"type":"string"}},"deny":{"readOnly":true,"type":"array","items":{"type":"string"}}}}}},"required":["option"]}},"branding":{"anyOf":[{"type":"object","properties":{"displayName":{"type":"string"},"logoUrl":{"type":"string","format":"uri"},"supportUrl":{"type":"string","format":"uri"},"statementDescriptor":{"type":"string"}}},{"type":"null"}]},"metadata":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"slugId":{"type":"string","minLength":3,"maxLength":256,"pattern":"^[a-z0-9-]+$"},"connectorId":{"type":"string"},"serviceInterface":{"type":"string"},"contextType":{"type":"string","enum":["organization","partner","customer"]},"contextId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1},"description":{"type":["string","null"]},"enabled":{"type":"boolean"},"capabilities":{"type":"array","items":{"type":"object","properties":{"option":{"type":"string"},"enabled":{"type":"boolean"},"operations":{"readOnly":true,"type":"array","items":{"type":"string"}},"constraints":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"allow":{"readOnly":true,"type":"array","items":{"type":"string"}},"deny":{"readOnly":true,"type":"array","items":{"type":"string"}}},"additionalProperties":false}}},"required":["option"],"additionalProperties":false}},"branding":{"anyOf":[{"type":"object","properties":{"displayName":{"type":"string"},"logoUrl":{"type":"string","format":"uri"},"supportUrl":{"type":"string","format":"uri"},"statementDescriptor":{"type":"string"}},"additionalProperties":false},{"type":"null"}]},"metadata":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","slugId","connectorId","serviceInterface","contextType","contextId","name","enabled","capabilities","createdAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"violations":{"type":"array","items":{"type":"object","properties":{"option":{"type":"string"},"operations":{"type":"array","items":{"type":"string"}},"dimension":{"type":"string"},"message":{"type":"string"}},"required":["option","message"],"additionalProperties":false}}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}},"delete":{"summary":"Delete a provider that has no accounts","tags":["providers"],"parameters":[{"name":"slugId","in":"path","required":true,"schema":{"type":"string"}},{"name":"contextType","in":"query","schema":{"type":"string","enum":["organization","partner","customer"]}},{"name":"contextId","in":"query","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"204":{"description":"204","content":{"application/json":{"schema":{}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"409":{"description":"409","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"accountCount":{"type":"number"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/connector-policies":{"get":{"description":"Returns the policy stored on an organization or customer, the connectors it may currently attach, and the candidates it may choose from (the parent's effective set).","summary":"Get the connector availability policy for a context","tags":["providerPolicies"],"parameters":[{"name":"contextType","in":"query","required":true,"schema":{"type":"string","enum":["organization","customer"]}},{"name":"contextId","in":"query","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"contextType":{"type":"string","enum":["organization","customer"]},"contextId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"policy":{"type":"object","properties":{"mode":{"default":"inherit","type":"string","enum":["inherit","allowlist"]},"allowed":{"default":[],"type":"array","items":{"type":"string","minLength":1}}},"required":["mode","allowed"],"additionalProperties":false},"effective":{"type":"array","items":{"type":"string"}},"candidates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"slugId":{"type":"string","minLength":3,"maxLength":256,"pattern":"^[a-z0-9-]+$"},"connectorId":{"type":"string"},"serviceInterface":{"type":"string"},"contextType":{"type":"string","enum":["organization","partner","customer"]},"contextId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1},"description":{"type":["string","null"]},"enabled":{"type":"boolean"},"capabilities":{"type":"array","items":{"type":"object","properties":{"option":{"type":"string"},"enabled":{"type":"boolean"},"operations":{"readOnly":true,"type":"array","items":{"type":"string"}},"constraints":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"allow":{"readOnly":true,"type":"array","items":{"type":"string"}},"deny":{"readOnly":true,"type":"array","items":{"type":"string"}}},"additionalProperties":false}}},"required":["option"],"additionalProperties":false}},"branding":{"anyOf":[{"type":"object","properties":{"displayName":{"type":"string"},"logoUrl":{"type":"string","format":"uri"},"supportUrl":{"type":"string","format":"uri"},"statementDescriptor":{"type":"string"}},"additionalProperties":false},{"type":"null"}]},"metadata":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","slugId","connectorId","serviceInterface","contextType","contextId","name","enabled","capabilities","createdAt","updatedAt"],"additionalProperties":false}},"inheritedFrom":{"type":"object","properties":{"contextType":{"type":"string","const":"organization"},"contextId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["contextType","contextId"],"additionalProperties":false},"updatedAt":{"type":"string"}},"required":["contextType","contextId","policy","effective","candidates"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}},"put":{"description":"An organization policy can only be changed by the platform root user. A customer policy can only narrow its organization's set; connector ids outside the candidates are rejected.","summary":"Replace the connector availability policy for a context","tags":["providerPolicies"],"parameters":[{"name":"contextType","in":"query","required":true,"schema":{"type":"string","enum":["organization","customer"]}},{"name":"contextId","in":"query","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"mode":{"default":"inherit","type":"string","enum":["inherit","allowlist"]},"allowed":{"default":[],"type":"array","items":{"type":"string","minLength":1}}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"contextType":{"type":"string","enum":["organization","customer"]},"contextId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"policy":{"type":"object","properties":{"mode":{"default":"inherit","type":"string","enum":["inherit","allowlist"]},"allowed":{"default":[],"type":"array","items":{"type":"string","minLength":1}}},"required":["mode","allowed"],"additionalProperties":false},"effective":{"type":"array","items":{"type":"string"}},"candidates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"slugId":{"type":"string","minLength":3,"maxLength":256,"pattern":"^[a-z0-9-]+$"},"connectorId":{"type":"string"},"serviceInterface":{"type":"string"},"contextType":{"type":"string","enum":["organization","partner","customer"]},"contextId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1},"description":{"type":["string","null"]},"enabled":{"type":"boolean"},"capabilities":{"type":"array","items":{"type":"object","properties":{"option":{"type":"string"},"enabled":{"type":"boolean"},"operations":{"readOnly":true,"type":"array","items":{"type":"string"}},"constraints":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"allow":{"readOnly":true,"type":"array","items":{"type":"string"}},"deny":{"readOnly":true,"type":"array","items":{"type":"string"}}},"additionalProperties":false}}},"required":["option"],"additionalProperties":false}},"branding":{"anyOf":[{"type":"object","properties":{"displayName":{"type":"string"},"logoUrl":{"type":"string","format":"uri"},"supportUrl":{"type":"string","format":"uri"},"statementDescriptor":{"type":"string"}},"additionalProperties":false},{"type":"null"}]},"metadata":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","slugId","connectorId","serviceInterface","contextType","contextId","name","enabled","capabilities","createdAt","updatedAt"],"additionalProperties":false}},"inheritedFrom":{"type":"object","properties":{"contextType":{"type":"string","const":"organization"},"contextId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["contextType","contextId"],"additionalProperties":false},"updatedAt":{"type":"string"}},"required":["contextType","contextId","policy","effective","candidates"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/account-applications/apply-form":{"get":{"summary":"What the apply dialog shows for one provider","tags":["accountApplications"],"parameters":[{"name":"providerSlug","in":"query","required":true,"schema":{"type":"string"}},{"name":"contextType","in":"query","schema":{"type":"string","enum":["organization","customer"]}},{"name":"contextId","in":"query","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"offeringId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"offeringName":{"type":"string"},"providerOrganizationName":{"type":"string"},"description":{"type":["string","null"]},"branding":{"anyOf":[{"type":"object","properties":{"displayName":{"type":"string"},"logoUrl":{"type":"string","format":"uri"},"supportUrl":{"type":"string","format":"uri"},"statementDescriptor":{"type":"string"}},"additionalProperties":false},{"type":"null"}]},"terms":{"type":["string","null"]},"termsVersion":{"type":["string","null"]},"form":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z][a-zA-Z0-9_]*$"},"label":{"type":"string","minLength":1},"type":{"type":"string","enum":["text","textarea","email","url","number","select","checkbox"]},"required":{"default":false,"type":"boolean"},"options":{"type":"array","items":{"type":"string","minLength":1}},"help":{"type":"string"}},"required":["name","label","type","required"],"additionalProperties":false}},"prefill":{"type":"object","properties":{"legalName":{"type":"string","minLength":1},"name":{"type":["string","null"]},"url":{"type":["string","null"]},"regNo":{"type":["string","null"]},"vat":{"anyOf":[{"type":"object","properties":{"number":{"description":"VAT number","type":"string"},"type":{"description":"VAT type","type":"string","enum":["SEVAT","SEREVERSEDVAT","EUREVERSEDVAT","EUVAT","EXPORT"]}},"additionalProperties":false},{"type":"null"}]},"address1":{"type":["string","null"]},"address2":{"type":["string","null"]},"zipCode":{"type":["string","null"]},"city":{"type":["string","null"]},"state":{"type":["string","null"]},"countryCode":{"anyOf":[{"type":"string","enum":["AFG","ALA","ALB","DZA","ASM","AND","AGO","AIA","ATA","ATG","ARG","ARM","ABW","AUS","AUT","AZE","BHS","BHR","BGD","BRB","BLR","BEL","BLZ","BEN","BMU","BTN","BOL","BES","BIH","BWA","BVT","BRA","IOT","VGB","BRN","BGR","BFA","BDI","KHM","CMR","CAN","CPV","CYM","CAF","TCD","CHL","CHN","CXR","CCK","COL","COM","COG","COD","COK","CRI","CIV","HRV","CUB","CUW","CYP","CZE","DNK","DJI","DMA","DOM","ECU","EGY","SLV","GNQ","ERI","EST","SWZ","ETH","FLK","FRO","FJI","FIN","FRA","GUF","PYF","ATF","GAB","GMB","GEO","DEU","GHA","GIB","GRC","GRL","GRD","GLP","GUM","GTM","GGY","GIN","GNB","GUY","HTI","HMD","HND","HKG","HUN","ISL","IND","IDN","IRN","IRQ","IRL","IMN","ISR","ITA","JAM","JPN","JEY","JOR","KAZ","KEN","KIR","PRK","KOR","KWT","KGZ","LAO","LVA","LBN","LSO","LBR","LBY","LIE","LTU","LUX","MAC","MKD","MDG","MWI","MYS","MDV","MLI","MLT","MHL","MTQ","MRT","MUS","MYT","MEX","FSM","MDA","MCO","MNG","MNE","MSR","MAR","MOZ","MMR","NAM","NRU","NPL","NLD","NCL","NZL","NIC","NER","NGA","NIU","NFK","MNP","NOR","OMN","PAK","PLW","PSE","PAN","PNG","PRY","PER","PHL","PCN","POL","PRT","PRI","QAT","REU","ROU","RUS","RWA","BLM","SHN","KNA","LCA","MAF","SPM","VCT","WSM","SMR","STP","SAU","SEN","SRB","SYC","SLE","SGP","SXM","SVK","SVN","SLB","SOM","ZAF","SGS","SSD","ESP","LKA","SDN","SUR","SJM","SWE","CHE","SYR","TWN","TJK","TZA","THA","TLS","TGO","TKL","TON","TTO","TUN","TUR","TKM","TCA","TUV","UGA","UKR","ARE","GBR","USA","UMI","VIR","URY","UZB","VUT","VAT","VEN","VNM","WLF","ESH","YEM","ZMB","ZWE","ZZZ"]},{"type":"null"}]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"financeEmail":{"type":["string","null"]},"contact":{"type":["string","null"]},"contactEmail":{"type":["string","null"]}},"additionalProperties":false},"suggestedAccountName":{"type":"string"},"followUp":{"anyOf":[{"type":"object","properties":{"fromApplicationId":{"type":"string"},"termsChanged":{"type":"boolean"},"missingQuestions":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z][a-zA-Z0-9_]*$"},"label":{"type":"string","minLength":1},"type":{"type":"string","enum":["text","textarea","email","url","number","select","checkbox"]},"required":{"default":false,"type":"boolean"},"options":{"type":"array","items":{"type":"string","minLength":1}},"help":{"type":"string"}},"required":["name","label","type","required"],"additionalProperties":false}},"existingAccounts":{"type":"array","items":{"type":"string"}}},"required":["fromApplicationId","termsChanged","missingQuestions","existingAccounts"],"additionalProperties":false},{"type":"null"}]}},"required":["offeringId","offeringName","providerOrganizationName","form","prefill","suggestedAccountName"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/account-applications":{"post":{"summary":"Apply for an account at a provider","tags":["accountApplications"],"parameters":[{"name":"contextType","in":"query","schema":{"type":"string","enum":["organization","partner","customer"]}},{"name":"contextId","in":"query","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"providerSlug":{"type":"string","minLength":3,"maxLength":256,"pattern":"^[a-z0-9-]+$"},"accountName":{"type":"string","minLength":1,"maxLength":80},"snapshot":{"type":"object","properties":{"legalName":{"type":"string","minLength":1},"name":{"type":["string","null"]},"url":{"type":["string","null"]},"regNo":{"type":["string","null"]},"vat":{"anyOf":[{"type":"object","properties":{"number":{"description":"VAT number","type":"string"},"type":{"description":"VAT type","type":"string","enum":["SEVAT","SEREVERSEDVAT","EUREVERSEDVAT","EUVAT","EXPORT"]}}},{"type":"null"}]},"address1":{"type":["string","null"]},"address2":{"type":["string","null"]},"zipCode":{"type":["string","null"]},"city":{"type":["string","null"]},"state":{"type":["string","null"]},"countryCode":{"anyOf":[{"type":"string","enum":["AFG","ALA","ALB","DZA","ASM","AND","AGO","AIA","ATA","ATG","ARG","ARM","ABW","AUS","AUT","AZE","BHS","BHR","BGD","BRB","BLR","BEL","BLZ","BEN","BMU","BTN","BOL","BES","BIH","BWA","BVT","BRA","IOT","VGB","BRN","BGR","BFA","BDI","KHM","CMR","CAN","CPV","CYM","CAF","TCD","CHL","CHN","CXR","CCK","COL","COM","COG","COD","COK","CRI","CIV","HRV","CUB","CUW","CYP","CZE","DNK","DJI","DMA","DOM","ECU","EGY","SLV","GNQ","ERI","EST","SWZ","ETH","FLK","FRO","FJI","FIN","FRA","GUF","PYF","ATF","GAB","GMB","GEO","DEU","GHA","GIB","GRC","GRL","GRD","GLP","GUM","GTM","GGY","GIN","GNB","GUY","HTI","HMD","HND","HKG","HUN","ISL","IND","IDN","IRN","IRQ","IRL","IMN","ISR","ITA","JAM","JPN","JEY","JOR","KAZ","KEN","KIR","PRK","KOR","KWT","KGZ","LAO","LVA","LBN","LSO","LBR","LBY","LIE","LTU","LUX","MAC","MKD","MDG","MWI","MYS","MDV","MLI","MLT","MHL","MTQ","MRT","MUS","MYT","MEX","FSM","MDA","MCO","MNG","MNE","MSR","MAR","MOZ","MMR","NAM","NRU","NPL","NLD","NCL","NZL","NIC","NER","NGA","NIU","NFK","MNP","NOR","OMN","PAK","PLW","PSE","PAN","PNG","PRY","PER","PHL","PCN","POL","PRT","PRI","QAT","REU","ROU","RUS","RWA","BLM","SHN","KNA","LCA","MAF","SPM","VCT","WSM","SMR","STP","SAU","SEN","SRB","SYC","SLE","SGP","SXM","SVK","SVN","SLB","SOM","ZAF","SGS","SSD","ESP","LKA","SDN","SUR","SJM","SWE","CHE","SYR","TWN","TJK","TZA","THA","TLS","TGO","TKL","TON","TTO","TUN","TUR","TKM","TCA","TUV","UGA","UKR","ARE","GBR","USA","UMI","VIR","URY","UZB","VUT","VAT","VEN","VNM","WLF","ESH","YEM","ZMB","ZWE","ZZZ"]},{"type":"null"}]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"financeEmail":{"type":["string","null"]},"contact":{"type":["string","null"]},"contactEmail":{"type":["string","null"]}},"required":["legalName"]},"answers":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"acceptTerms":{"type":"boolean"},"consentToShare":{"type":"boolean"}},"required":["providerSlug","accountName"]}}}},"responses":{"201":{"description":"201","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["SUBMITTED","IN_REVIEW","INFO_REQUESTED","APPROVED","PROVISIONING","PROVISIONING_FAILED","AWAITING_ACTIVATION","AWAITING_CLAIM","WAITING_FOR_PLATFORM","ACTIVE","SUSPENDED","REJECTED","WITHDRAWN","TERMINATED","DISCONNECTED"]},"offeringId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"offeringName":{"type":"string"},"accountName":{"type":"string"},"accountSlug":{"type":["string","null"]},"providerOrganizationName":{"type":"string"},"providerSlug":{"type":["string","null"]},"applicantContextType":{"type":"string","enum":["organization","partner","customer"]},"applicantContextId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"snapshot":{"type":"object","properties":{"legalName":{"type":"string","minLength":1},"name":{"type":["string","null"]},"url":{"type":["string","null"]},"regNo":{"type":["string","null"]},"vat":{"anyOf":[{"type":"object","properties":{"number":{"description":"VAT number","type":"string"},"type":{"description":"VAT type","type":"string","enum":["SEVAT","SEREVERSEDVAT","EUREVERSEDVAT","EUVAT","EXPORT"]}},"additionalProperties":false},{"type":"null"}]},"address1":{"type":["string","null"]},"address2":{"type":["string","null"]},"zipCode":{"type":["string","null"]},"city":{"type":["string","null"]},"state":{"type":["string","null"]},"countryCode":{"anyOf":[{"type":"string","enum":["AFG","ALA","ALB","DZA","ASM","AND","AGO","AIA","ATA","ATG","ARG","ARM","ABW","AUS","AUT","AZE","BHS","BHR","BGD","BRB","BLR","BEL","BLZ","BEN","BMU","BTN","BOL","BES","BIH","BWA","BVT","BRA","IOT","VGB","BRN","BGR","BFA","BDI","KHM","CMR","CAN","CPV","CYM","CAF","TCD","CHL","CHN","CXR","CCK","COL","COM","COG","COD","COK","CRI","CIV","HRV","CUB","CUW","CYP","CZE","DNK","DJI","DMA","DOM","ECU","EGY","SLV","GNQ","ERI","EST","SWZ","ETH","FLK","FRO","FJI","FIN","FRA","GUF","PYF","ATF","GAB","GMB","GEO","DEU","GHA","GIB","GRC","GRL","GRD","GLP","GUM","GTM","GGY","GIN","GNB","GUY","HTI","HMD","HND","HKG","HUN","ISL","IND","IDN","IRN","IRQ","IRL","IMN","ISR","ITA","JAM","JPN","JEY","JOR","KAZ","KEN","KIR","PRK","KOR","KWT","KGZ","LAO","LVA","LBN","LSO","LBR","LBY","LIE","LTU","LUX","MAC","MKD","MDG","MWI","MYS","MDV","MLI","MLT","MHL","MTQ","MRT","MUS","MYT","MEX","FSM","MDA","MCO","MNG","MNE","MSR","MAR","MOZ","MMR","NAM","NRU","NPL","NLD","NCL","NZL","NIC","NER","NGA","NIU","NFK","MNP","NOR","OMN","PAK","PLW","PSE","PAN","PNG","PRY","PER","PHL","PCN","POL","PRT","PRI","QAT","REU","ROU","RUS","RWA","BLM","SHN","KNA","LCA","MAF","SPM","VCT","WSM","SMR","STP","SAU","SEN","SRB","SYC","SLE","SGP","SXM","SVK","SVN","SLB","SOM","ZAF","SGS","SSD","ESP","LKA","SDN","SUR","SJM","SWE","CHE","SYR","TWN","TJK","TZA","THA","TLS","TGO","TKL","TON","TTO","TUN","TUR","TKM","TCA","TUV","UGA","UKR","ARE","GBR","USA","UMI","VIR","URY","UZB","VUT","VAT","VEN","VNM","WLF","ESH","YEM","ZMB","ZWE","ZZZ"]},{"type":"null"}]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"financeEmail":{"type":["string","null"]},"contact":{"type":["string","null"]},"contactEmail":{"type":["string","null"]}},"required":["legalName"],"additionalProperties":false},"answers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"connectionId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"decisionNote":{"type":["string","null"]},"becameDefaultRoute":{"type":"boolean"},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["STATUS","MESSAGE","PROVISIONING_STEP"]},"side":{"type":"string","enum":["applicant","provider","system"]},"actorName":{"type":["string","null"]},"status":{"anyOf":[{"type":"string","enum":["SUBMITTED","IN_REVIEW","INFO_REQUESTED","APPROVED","PROVISIONING","PROVISIONING_FAILED","AWAITING_ACTIVATION","AWAITING_CLAIM","WAITING_FOR_PLATFORM","ACTIVE","SUSPENDED","REJECTED","WITHDRAWN","TERMINATED","DISCONNECTED"]},{"type":"null"}]},"message":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","kind","side","createdAt"],"additionalProperties":false}},"submittedAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","status","offeringId","offeringName","accountName","providerOrganizationName","applicantContextType","applicantContextId","snapshot","answers","becameDefaultRoute","events","submittedAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"409":{"description":"409","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}},"get":{"summary":"Applications to this organization's offerings","tags":["accountApplications"],"parameters":[{"name":"q","in":"query","schema":{"type":"string"}},{"name":"customerId","in":"query","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"sort","in":"query","schema":{"type":"string","enum":["asc","desc"]}},{"name":"page","in":"query","schema":{"default":1,"type":"number","minimum":1}},{"name":"limit","in":"query","schema":{"default":100,"type":"number","minimum":1}},{"name":"dateRange","in":"query","style":"deepObject","schema":{"type":"object","properties":{"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}}}},{"name":"refresh","in":"query","schema":{"type":"boolean"}},{"name":"filters","in":"query","description":"Filters to apply, as `{ field, op, values }` entries","schema":{"type":"array","items":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"field":{"type":"string","enum":["status","offeringName","accountName","applicantName","countryCode","regNo","submittedAt"]},"op":{"type":"string","enum":["eq","ne","in","nin","contains","notContains","startsWith","notStartsWith","gt","gte","lt","lte","isEmpty","isNotEmpty"]},"values":{"type":"array"}},"required":["field"],"description":"A single search filter"},"maxItems":25}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["SUBMITTED","IN_REVIEW","INFO_REQUESTED","APPROVED","PROVISIONING","PROVISIONING_FAILED","AWAITING_ACTIVATION","AWAITING_CLAIM","WAITING_FOR_PLATFORM","ACTIVE","SUSPENDED","REJECTED","WITHDRAWN","TERMINATED","DISCONNECTED"]},"offeringId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"offeringName":{"type":"string"},"accountName":{"type":"string"},"applicantName":{"type":"string"},"applicantOrigin":{"type":["string","null"]},"decidedAt":{"type":["string","null"]},"submittedAt":{"type":"string"},"updatedAt":{"type":"string"},"countryCode":{"anyOf":[{"type":"string","enum":["AFG","ALA","ALB","DZA","ASM","AND","AGO","AIA","ATA","ATG","ARG","ARM","ABW","AUS","AUT","AZE","BHS","BHR","BGD","BRB","BLR","BEL","BLZ","BEN","BMU","BTN","BOL","BES","BIH","BWA","BVT","BRA","IOT","VGB","BRN","BGR","BFA","BDI","KHM","CMR","CAN","CPV","CYM","CAF","TCD","CHL","CHN","CXR","CCK","COL","COM","COG","COD","COK","CRI","CIV","HRV","CUB","CUW","CYP","CZE","DNK","DJI","DMA","DOM","ECU","EGY","SLV","GNQ","ERI","EST","SWZ","ETH","FLK","FRO","FJI","FIN","FRA","GUF","PYF","ATF","GAB","GMB","GEO","DEU","GHA","GIB","GRC","GRL","GRD","GLP","GUM","GTM","GGY","GIN","GNB","GUY","HTI","HMD","HND","HKG","HUN","ISL","IND","IDN","IRN","IRQ","IRL","IMN","ISR","ITA","JAM","JPN","JEY","JOR","KAZ","KEN","KIR","PRK","KOR","KWT","KGZ","LAO","LVA","LBN","LSO","LBR","LBY","LIE","LTU","LUX","MAC","MKD","MDG","MWI","MYS","MDV","MLI","MLT","MHL","MTQ","MRT","MUS","MYT","MEX","FSM","MDA","MCO","MNG","MNE","MSR","MAR","MOZ","MMR","NAM","NRU","NPL","NLD","NCL","NZL","NIC","NER","NGA","NIU","NFK","MNP","NOR","OMN","PAK","PLW","PSE","PAN","PNG","PRY","PER","PHL","PCN","POL","PRT","PRI","QAT","REU","ROU","RUS","RWA","BLM","SHN","KNA","LCA","MAF","SPM","VCT","WSM","SMR","STP","SAU","SEN","SRB","SYC","SLE","SGP","SXM","SVK","SVN","SLB","SOM","ZAF","SGS","SSD","ESP","LKA","SDN","SUR","SJM","SWE","CHE","SYR","TWN","TJK","TZA","THA","TLS","TGO","TKL","TON","TTO","TUN","TUR","TKM","TCA","TUV","UGA","UKR","ARE","GBR","USA","UMI","VIR","URY","UZB","VUT","VAT","VEN","VNM","WLF","ESH","YEM","ZMB","ZWE","ZZZ"]},{"type":"null"}]},"regNo":{"type":["string","null"]}},"required":["id","status","offeringId","offeringName","accountName","applicantName","submittedAt","updatedAt"],"additionalProperties":false}},"meta":{"type":"object","properties":{"page":{"type":"number"},"pageSize":{"type":"number"},"hasMore":{"type":"boolean"},"total":{"type":"number"}},"required":["page","pageSize","hasMore"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/account-applications/mine":{"get":{"summary":"This context's applications and links","tags":["accountApplications"],"parameters":[{"name":"contextType","in":"query","schema":{"type":"string","enum":["organization","partner","customer"]}},{"name":"contextId","in":"query","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["SUBMITTED","IN_REVIEW","INFO_REQUESTED","APPROVED","PROVISIONING","PROVISIONING_FAILED","AWAITING_ACTIVATION","AWAITING_CLAIM","WAITING_FOR_PLATFORM","ACTIVE","SUSPENDED","REJECTED","WITHDRAWN","TERMINATED","DISCONNECTED"]},"offeringId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"offeringName":{"type":"string"},"accountName":{"type":"string"},"accountSlug":{"type":["string","null"]},"providerOrganizationName":{"type":"string"},"providerSlug":{"type":["string","null"]},"applicantContextType":{"type":"string","enum":["organization","partner","customer"]},"applicantContextId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"snapshot":{"type":"object","properties":{"legalName":{"type":"string","minLength":1},"name":{"type":["string","null"]},"url":{"type":["string","null"]},"regNo":{"type":["string","null"]},"vat":{"anyOf":[{"type":"object","properties":{"number":{"description":"VAT number","type":"string"},"type":{"description":"VAT type","type":"string","enum":["SEVAT","SEREVERSEDVAT","EUREVERSEDVAT","EUVAT","EXPORT"]}},"additionalProperties":false},{"type":"null"}]},"address1":{"type":["string","null"]},"address2":{"type":["string","null"]},"zipCode":{"type":["string","null"]},"city":{"type":["string","null"]},"state":{"type":["string","null"]},"countryCode":{"anyOf":[{"type":"string","enum":["AFG","ALA","ALB","DZA","ASM","AND","AGO","AIA","ATA","ATG","ARG","ARM","ABW","AUS","AUT","AZE","BHS","BHR","BGD","BRB","BLR","BEL","BLZ","BEN","BMU","BTN","BOL","BES","BIH","BWA","BVT","BRA","IOT","VGB","BRN","BGR","BFA","BDI","KHM","CMR","CAN","CPV","CYM","CAF","TCD","CHL","CHN","CXR","CCK","COL","COM","COG","COD","COK","CRI","CIV","HRV","CUB","CUW","CYP","CZE","DNK","DJI","DMA","DOM","ECU","EGY","SLV","GNQ","ERI","EST","SWZ","ETH","FLK","FRO","FJI","FIN","FRA","GUF","PYF","ATF","GAB","GMB","GEO","DEU","GHA","GIB","GRC","GRL","GRD","GLP","GUM","GTM","GGY","GIN","GNB","GUY","HTI","HMD","HND","HKG","HUN","ISL","IND","IDN","IRN","IRQ","IRL","IMN","ISR","ITA","JAM","JPN","JEY","JOR","KAZ","KEN","KIR","PRK","KOR","KWT","KGZ","LAO","LVA","LBN","LSO","LBR","LBY","LIE","LTU","LUX","MAC","MKD","MDG","MWI","MYS","MDV","MLI","MLT","MHL","MTQ","MRT","MUS","MYT","MEX","FSM","MDA","MCO","MNG","MNE","MSR","MAR","MOZ","MMR","NAM","NRU","NPL","NLD","NCL","NZL","NIC","NER","NGA","NIU","NFK","MNP","NOR","OMN","PAK","PLW","PSE","PAN","PNG","PRY","PER","PHL","PCN","POL","PRT","PRI","QAT","REU","ROU","RUS","RWA","BLM","SHN","KNA","LCA","MAF","SPM","VCT","WSM","SMR","STP","SAU","SEN","SRB","SYC","SLE","SGP","SXM","SVK","SVN","SLB","SOM","ZAF","SGS","SSD","ESP","LKA","SDN","SUR","SJM","SWE","CHE","SYR","TWN","TJK","TZA","THA","TLS","TGO","TKL","TON","TTO","TUN","TUR","TKM","TCA","TUV","UGA","UKR","ARE","GBR","USA","UMI","VIR","URY","UZB","VUT","VAT","VEN","VNM","WLF","ESH","YEM","ZMB","ZWE","ZZZ"]},{"type":"null"}]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"financeEmail":{"type":["string","null"]},"contact":{"type":["string","null"]},"contactEmail":{"type":["string","null"]}},"required":["legalName"],"additionalProperties":false},"answers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"connectionId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"decisionNote":{"type":["string","null"]},"becameDefaultRoute":{"type":"boolean"},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["STATUS","MESSAGE","PROVISIONING_STEP"]},"side":{"type":"string","enum":["applicant","provider","system"]},"actorName":{"type":["string","null"]},"status":{"anyOf":[{"type":"string","enum":["SUBMITTED","IN_REVIEW","INFO_REQUESTED","APPROVED","PROVISIONING","PROVISIONING_FAILED","AWAITING_ACTIVATION","AWAITING_CLAIM","WAITING_FOR_PLATFORM","ACTIVE","SUSPENDED","REJECTED","WITHDRAWN","TERMINATED","DISCONNECTED"]},{"type":"null"}]},"message":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","kind","side","createdAt"],"additionalProperties":false}},"submittedAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","status","offeringId","offeringName","accountName","providerOrganizationName","applicantContextType","applicantContextId","snapshot","answers","becameDefaultRoute","events","submittedAt","updatedAt"],"additionalProperties":false}}}}}}}},"/api/v1/account-applications/pending-count":{"get":{"summary":"How many applications wait for this organization to act — the nav badge","tags":["accountApplications"],"parameters":[],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"number"}},"required":["count"],"additionalProperties":false}}}}}}},"/api/v1/account-applications/mine/{id}":{"get":{"summary":"One of this context's applications","tags":["accountApplications"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"contextType","in":"query","schema":{"type":"string","enum":["organization","partner","customer"]}},{"name":"contextId","in":"query","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["SUBMITTED","IN_REVIEW","INFO_REQUESTED","APPROVED","PROVISIONING","PROVISIONING_FAILED","AWAITING_ACTIVATION","AWAITING_CLAIM","WAITING_FOR_PLATFORM","ACTIVE","SUSPENDED","REJECTED","WITHDRAWN","TERMINATED","DISCONNECTED"]},"offeringId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"offeringName":{"type":"string"},"accountName":{"type":"string"},"accountSlug":{"type":["string","null"]},"providerOrganizationName":{"type":"string"},"providerSlug":{"type":["string","null"]},"applicantContextType":{"type":"string","enum":["organization","partner","customer"]},"applicantContextId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"snapshot":{"type":"object","properties":{"legalName":{"type":"string","minLength":1},"name":{"type":["string","null"]},"url":{"type":["string","null"]},"regNo":{"type":["string","null"]},"vat":{"anyOf":[{"type":"object","properties":{"number":{"description":"VAT number","type":"string"},"type":{"description":"VAT type","type":"string","enum":["SEVAT","SEREVERSEDVAT","EUREVERSEDVAT","EUVAT","EXPORT"]}},"additionalProperties":false},{"type":"null"}]},"address1":{"type":["string","null"]},"address2":{"type":["string","null"]},"zipCode":{"type":["string","null"]},"city":{"type":["string","null"]},"state":{"type":["string","null"]},"countryCode":{"anyOf":[{"type":"string","enum":["AFG","ALA","ALB","DZA","ASM","AND","AGO","AIA","ATA","ATG","ARG","ARM","ABW","AUS","AUT","AZE","BHS","BHR","BGD","BRB","BLR","BEL","BLZ","BEN","BMU","BTN","BOL","BES","BIH","BWA","BVT","BRA","IOT","VGB","BRN","BGR","BFA","BDI","KHM","CMR","CAN","CPV","CYM","CAF","TCD","CHL","CHN","CXR","CCK","COL","COM","COG","COD","COK","CRI","CIV","HRV","CUB","CUW","CYP","CZE","DNK","DJI","DMA","DOM","ECU","EGY","SLV","GNQ","ERI","EST","SWZ","ETH","FLK","FRO","FJI","FIN","FRA","GUF","PYF","ATF","GAB","GMB","GEO","DEU","GHA","GIB","GRC","GRL","GRD","GLP","GUM","GTM","GGY","GIN","GNB","GUY","HTI","HMD","HND","HKG","HUN","ISL","IND","IDN","IRN","IRQ","IRL","IMN","ISR","ITA","JAM","JPN","JEY","JOR","KAZ","KEN","KIR","PRK","KOR","KWT","KGZ","LAO","LVA","LBN","LSO","LBR","LBY","LIE","LTU","LUX","MAC","MKD","MDG","MWI","MYS","MDV","MLI","MLT","MHL","MTQ","MRT","MUS","MYT","MEX","FSM","MDA","MCO","MNG","MNE","MSR","MAR","MOZ","MMR","NAM","NRU","NPL","NLD","NCL","NZL","NIC","NER","NGA","NIU","NFK","MNP","NOR","OMN","PAK","PLW","PSE","PAN","PNG","PRY","PER","PHL","PCN","POL","PRT","PRI","QAT","REU","ROU","RUS","RWA","BLM","SHN","KNA","LCA","MAF","SPM","VCT","WSM","SMR","STP","SAU","SEN","SRB","SYC","SLE","SGP","SXM","SVK","SVN","SLB","SOM","ZAF","SGS","SSD","ESP","LKA","SDN","SUR","SJM","SWE","CHE","SYR","TWN","TJK","TZA","THA","TLS","TGO","TKL","TON","TTO","TUN","TUR","TKM","TCA","TUV","UGA","UKR","ARE","GBR","USA","UMI","VIR","URY","UZB","VUT","VAT","VEN","VNM","WLF","ESH","YEM","ZMB","ZWE","ZZZ"]},{"type":"null"}]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"financeEmail":{"type":["string","null"]},"contact":{"type":["string","null"]},"contactEmail":{"type":["string","null"]}},"required":["legalName"],"additionalProperties":false},"answers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"connectionId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"decisionNote":{"type":["string","null"]},"becameDefaultRoute":{"type":"boolean"},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["STATUS","MESSAGE","PROVISIONING_STEP"]},"side":{"type":"string","enum":["applicant","provider","system"]},"actorName":{"type":["string","null"]},"status":{"anyOf":[{"type":"string","enum":["SUBMITTED","IN_REVIEW","INFO_REQUESTED","APPROVED","PROVISIONING","PROVISIONING_FAILED","AWAITING_ACTIVATION","AWAITING_CLAIM","WAITING_FOR_PLATFORM","ACTIVE","SUSPENDED","REJECTED","WITHDRAWN","TERMINATED","DISCONNECTED"]},{"type":"null"}]},"message":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","kind","side","createdAt"],"additionalProperties":false}},"submittedAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","status","offeringId","offeringName","accountName","providerOrganizationName","applicantContextType","applicantContextId","snapshot","answers","becameDefaultRoute","events","submittedAt","updatedAt"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/account-applications/mine/{id}/respond":{"post":{"summary":"Answer the provider's request for information","tags":["accountApplications"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"contextType","in":"query","schema":{"type":"string","enum":["organization","partner","customer"]}},{"name":"contextId","in":"query","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","minLength":1,"maxLength":5000},"answers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}}},"required":["message"]}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["SUBMITTED","IN_REVIEW","INFO_REQUESTED","APPROVED","PROVISIONING","PROVISIONING_FAILED","AWAITING_ACTIVATION","AWAITING_CLAIM","WAITING_FOR_PLATFORM","ACTIVE","SUSPENDED","REJECTED","WITHDRAWN","TERMINATED","DISCONNECTED"]},"offeringId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"offeringName":{"type":"string"},"accountName":{"type":"string"},"accountSlug":{"type":["string","null"]},"providerOrganizationName":{"type":"string"},"providerSlug":{"type":["string","null"]},"applicantContextType":{"type":"string","enum":["organization","partner","customer"]},"applicantContextId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"snapshot":{"type":"object","properties":{"legalName":{"type":"string","minLength":1},"name":{"type":["string","null"]},"url":{"type":["string","null"]},"regNo":{"type":["string","null"]},"vat":{"anyOf":[{"type":"object","properties":{"number":{"description":"VAT number","type":"string"},"type":{"description":"VAT type","type":"string","enum":["SEVAT","SEREVERSEDVAT","EUREVERSEDVAT","EUVAT","EXPORT"]}},"additionalProperties":false},{"type":"null"}]},"address1":{"type":["string","null"]},"address2":{"type":["string","null"]},"zipCode":{"type":["string","null"]},"city":{"type":["string","null"]},"state":{"type":["string","null"]},"countryCode":{"anyOf":[{"type":"string","enum":["AFG","ALA","ALB","DZA","ASM","AND","AGO","AIA","ATA","ATG","ARG","ARM","ABW","AUS","AUT","AZE","BHS","BHR","BGD","BRB","BLR","BEL","BLZ","BEN","BMU","BTN","BOL","BES","BIH","BWA","BVT","BRA","IOT","VGB","BRN","BGR","BFA","BDI","KHM","CMR","CAN","CPV","CYM","CAF","TCD","CHL","CHN","CXR","CCK","COL","COM","COG","COD","COK","CRI","CIV","HRV","CUB","CUW","CYP","CZE","DNK","DJI","DMA","DOM","ECU","EGY","SLV","GNQ","ERI","EST","SWZ","ETH","FLK","FRO","FJI","FIN","FRA","GUF","PYF","ATF","GAB","GMB","GEO","DEU","GHA","GIB","GRC","GRL","GRD","GLP","GUM","GTM","GGY","GIN","GNB","GUY","HTI","HMD","HND","HKG","HUN","ISL","IND","IDN","IRN","IRQ","IRL","IMN","ISR","ITA","JAM","JPN","JEY","JOR","KAZ","KEN","KIR","PRK","KOR","KWT","KGZ","LAO","LVA","LBN","LSO","LBR","LBY","LIE","LTU","LUX","MAC","MKD","MDG","MWI","MYS","MDV","MLI","MLT","MHL","MTQ","MRT","MUS","MYT","MEX","FSM","MDA","MCO","MNG","MNE","MSR","MAR","MOZ","MMR","NAM","NRU","NPL","NLD","NCL","NZL","NIC","NER","NGA","NIU","NFK","MNP","NOR","OMN","PAK","PLW","PSE","PAN","PNG","PRY","PER","PHL","PCN","POL","PRT","PRI","QAT","REU","ROU","RUS","RWA","BLM","SHN","KNA","LCA","MAF","SPM","VCT","WSM","SMR","STP","SAU","SEN","SRB","SYC","SLE","SGP","SXM","SVK","SVN","SLB","SOM","ZAF","SGS","SSD","ESP","LKA","SDN","SUR","SJM","SWE","CHE","SYR","TWN","TJK","TZA","THA","TLS","TGO","TKL","TON","TTO","TUN","TUR","TKM","TCA","TUV","UGA","UKR","ARE","GBR","USA","UMI","VIR","URY","UZB","VUT","VAT","VEN","VNM","WLF","ESH","YEM","ZMB","ZWE","ZZZ"]},{"type":"null"}]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"financeEmail":{"type":["string","null"]},"contact":{"type":["string","null"]},"contactEmail":{"type":["string","null"]}},"required":["legalName"],"additionalProperties":false},"answers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"connectionId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"decisionNote":{"type":["string","null"]},"becameDefaultRoute":{"type":"boolean"},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["STATUS","MESSAGE","PROVISIONING_STEP"]},"side":{"type":"string","enum":["applicant","provider","system"]},"actorName":{"type":["string","null"]},"status":{"anyOf":[{"type":"string","enum":["SUBMITTED","IN_REVIEW","INFO_REQUESTED","APPROVED","PROVISIONING","PROVISIONING_FAILED","AWAITING_ACTIVATION","AWAITING_CLAIM","WAITING_FOR_PLATFORM","ACTIVE","SUSPENDED","REJECTED","WITHDRAWN","TERMINATED","DISCONNECTED"]},{"type":"null"}]},"message":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","kind","side","createdAt"],"additionalProperties":false}},"submittedAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","status","offeringId","offeringName","accountName","providerOrganizationName","applicantContextType","applicantContextId","snapshot","answers","becameDefaultRoute","events","submittedAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/account-applications/mine/{id}/withdraw":{"post":{"summary":"Withdraw an application still under review","tags":["accountApplications"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"contextType","in":"query","schema":{"type":"string","enum":["organization","partner","customer"]}},{"name":"contextId","in":"query","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["SUBMITTED","IN_REVIEW","INFO_REQUESTED","APPROVED","PROVISIONING","PROVISIONING_FAILED","AWAITING_ACTIVATION","AWAITING_CLAIM","WAITING_FOR_PLATFORM","ACTIVE","SUSPENDED","REJECTED","WITHDRAWN","TERMINATED","DISCONNECTED"]},"offeringId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"offeringName":{"type":"string"},"accountName":{"type":"string"},"accountSlug":{"type":["string","null"]},"providerOrganizationName":{"type":"string"},"providerSlug":{"type":["string","null"]},"applicantContextType":{"type":"string","enum":["organization","partner","customer"]},"applicantContextId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"snapshot":{"type":"object","properties":{"legalName":{"type":"string","minLength":1},"name":{"type":["string","null"]},"url":{"type":["string","null"]},"regNo":{"type":["string","null"]},"vat":{"anyOf":[{"type":"object","properties":{"number":{"description":"VAT number","type":"string"},"type":{"description":"VAT type","type":"string","enum":["SEVAT","SEREVERSEDVAT","EUREVERSEDVAT","EUVAT","EXPORT"]}},"additionalProperties":false},{"type":"null"}]},"address1":{"type":["string","null"]},"address2":{"type":["string","null"]},"zipCode":{"type":["string","null"]},"city":{"type":["string","null"]},"state":{"type":["string","null"]},"countryCode":{"anyOf":[{"type":"string","enum":["AFG","ALA","ALB","DZA","ASM","AND","AGO","AIA","ATA","ATG","ARG","ARM","ABW","AUS","AUT","AZE","BHS","BHR","BGD","BRB","BLR","BEL","BLZ","BEN","BMU","BTN","BOL","BES","BIH","BWA","BVT","BRA","IOT","VGB","BRN","BGR","BFA","BDI","KHM","CMR","CAN","CPV","CYM","CAF","TCD","CHL","CHN","CXR","CCK","COL","COM","COG","COD","COK","CRI","CIV","HRV","CUB","CUW","CYP","CZE","DNK","DJI","DMA","DOM","ECU","EGY","SLV","GNQ","ERI","EST","SWZ","ETH","FLK","FRO","FJI","FIN","FRA","GUF","PYF","ATF","GAB","GMB","GEO","DEU","GHA","GIB","GRC","GRL","GRD","GLP","GUM","GTM","GGY","GIN","GNB","GUY","HTI","HMD","HND","HKG","HUN","ISL","IND","IDN","IRN","IRQ","IRL","IMN","ISR","ITA","JAM","JPN","JEY","JOR","KAZ","KEN","KIR","PRK","KOR","KWT","KGZ","LAO","LVA","LBN","LSO","LBR","LBY","LIE","LTU","LUX","MAC","MKD","MDG","MWI","MYS","MDV","MLI","MLT","MHL","MTQ","MRT","MUS","MYT","MEX","FSM","MDA","MCO","MNG","MNE","MSR","MAR","MOZ","MMR","NAM","NRU","NPL","NLD","NCL","NZL","NIC","NER","NGA","NIU","NFK","MNP","NOR","OMN","PAK","PLW","PSE","PAN","PNG","PRY","PER","PHL","PCN","POL","PRT","PRI","QAT","REU","ROU","RUS","RWA","BLM","SHN","KNA","LCA","MAF","SPM","VCT","WSM","SMR","STP","SAU","SEN","SRB","SYC","SLE","SGP","SXM","SVK","SVN","SLB","SOM","ZAF","SGS","SSD","ESP","LKA","SDN","SUR","SJM","SWE","CHE","SYR","TWN","TJK","TZA","THA","TLS","TGO","TKL","TON","TTO","TUN","TUR","TKM","TCA","TUV","UGA","UKR","ARE","GBR","USA","UMI","VIR","URY","UZB","VUT","VAT","VEN","VNM","WLF","ESH","YEM","ZMB","ZWE","ZZZ"]},{"type":"null"}]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"financeEmail":{"type":["string","null"]},"contact":{"type":["string","null"]},"contactEmail":{"type":["string","null"]}},"required":["legalName"],"additionalProperties":false},"answers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"connectionId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"decisionNote":{"type":["string","null"]},"becameDefaultRoute":{"type":"boolean"},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["STATUS","MESSAGE","PROVISIONING_STEP"]},"side":{"type":"string","enum":["applicant","provider","system"]},"actorName":{"type":["string","null"]},"status":{"anyOf":[{"type":"string","enum":["SUBMITTED","IN_REVIEW","INFO_REQUESTED","APPROVED","PROVISIONING","PROVISIONING_FAILED","AWAITING_ACTIVATION","AWAITING_CLAIM","WAITING_FOR_PLATFORM","ACTIVE","SUSPENDED","REJECTED","WITHDRAWN","TERMINATED","DISCONNECTED"]},{"type":"null"}]},"message":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","kind","side","createdAt"],"additionalProperties":false}},"submittedAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","status","offeringId","offeringName","accountName","providerOrganizationName","applicantContextType","applicantContextId","snapshot","answers","becameDefaultRoute","events","submittedAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/account-applications/mine/{id}/disconnect":{"post":{"summary":"Close the account at the provider and remove the connection","tags":["accountApplications"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"contextType","in":"query","schema":{"type":"string","enum":["organization","partner","customer"]}},{"name":"contextId","in":"query","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string"},"force":{"type":"boolean"}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["SUBMITTED","IN_REVIEW","INFO_REQUESTED","APPROVED","PROVISIONING","PROVISIONING_FAILED","AWAITING_ACTIVATION","AWAITING_CLAIM","WAITING_FOR_PLATFORM","ACTIVE","SUSPENDED","REJECTED","WITHDRAWN","TERMINATED","DISCONNECTED"]},"offeringId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"offeringName":{"type":"string"},"accountName":{"type":"string"},"accountSlug":{"type":["string","null"]},"providerOrganizationName":{"type":"string"},"providerSlug":{"type":["string","null"]},"applicantContextType":{"type":"string","enum":["organization","partner","customer"]},"applicantContextId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"snapshot":{"type":"object","properties":{"legalName":{"type":"string","minLength":1},"name":{"type":["string","null"]},"url":{"type":["string","null"]},"regNo":{"type":["string","null"]},"vat":{"anyOf":[{"type":"object","properties":{"number":{"description":"VAT number","type":"string"},"type":{"description":"VAT type","type":"string","enum":["SEVAT","SEREVERSEDVAT","EUREVERSEDVAT","EUVAT","EXPORT"]}},"additionalProperties":false},{"type":"null"}]},"address1":{"type":["string","null"]},"address2":{"type":["string","null"]},"zipCode":{"type":["string","null"]},"city":{"type":["string","null"]},"state":{"type":["string","null"]},"countryCode":{"anyOf":[{"type":"string","enum":["AFG","ALA","ALB","DZA","ASM","AND","AGO","AIA","ATA","ATG","ARG","ARM","ABW","AUS","AUT","AZE","BHS","BHR","BGD","BRB","BLR","BEL","BLZ","BEN","BMU","BTN","BOL","BES","BIH","BWA","BVT","BRA","IOT","VGB","BRN","BGR","BFA","BDI","KHM","CMR","CAN","CPV","CYM","CAF","TCD","CHL","CHN","CXR","CCK","COL","COM","COG","COD","COK","CRI","CIV","HRV","CUB","CUW","CYP","CZE","DNK","DJI","DMA","DOM","ECU","EGY","SLV","GNQ","ERI","EST","SWZ","ETH","FLK","FRO","FJI","FIN","FRA","GUF","PYF","ATF","GAB","GMB","GEO","DEU","GHA","GIB","GRC","GRL","GRD","GLP","GUM","GTM","GGY","GIN","GNB","GUY","HTI","HMD","HND","HKG","HUN","ISL","IND","IDN","IRN","IRQ","IRL","IMN","ISR","ITA","JAM","JPN","JEY","JOR","KAZ","KEN","KIR","PRK","KOR","KWT","KGZ","LAO","LVA","LBN","LSO","LBR","LBY","LIE","LTU","LUX","MAC","MKD","MDG","MWI","MYS","MDV","MLI","MLT","MHL","MTQ","MRT","MUS","MYT","MEX","FSM","MDA","MCO","MNG","MNE","MSR","MAR","MOZ","MMR","NAM","NRU","NPL","NLD","NCL","NZL","NIC","NER","NGA","NIU","NFK","MNP","NOR","OMN","PAK","PLW","PSE","PAN","PNG","PRY","PER","PHL","PCN","POL","PRT","PRI","QAT","REU","ROU","RUS","RWA","BLM","SHN","KNA","LCA","MAF","SPM","VCT","WSM","SMR","STP","SAU","SEN","SRB","SYC","SLE","SGP","SXM","SVK","SVN","SLB","SOM","ZAF","SGS","SSD","ESP","LKA","SDN","SUR","SJM","SWE","CHE","SYR","TWN","TJK","TZA","THA","TLS","TGO","TKL","TON","TTO","TUN","TUR","TKM","TCA","TUV","UGA","UKR","ARE","GBR","USA","UMI","VIR","URY","UZB","VUT","VAT","VEN","VNM","WLF","ESH","YEM","ZMB","ZWE","ZZZ"]},{"type":"null"}]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"financeEmail":{"type":["string","null"]},"contact":{"type":["string","null"]},"contactEmail":{"type":["string","null"]}},"required":["legalName"],"additionalProperties":false},"answers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"connectionId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"decisionNote":{"type":["string","null"]},"becameDefaultRoute":{"type":"boolean"},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["STATUS","MESSAGE","PROVISIONING_STEP"]},"side":{"type":"string","enum":["applicant","provider","system"]},"actorName":{"type":["string","null"]},"status":{"anyOf":[{"type":"string","enum":["SUBMITTED","IN_REVIEW","INFO_REQUESTED","APPROVED","PROVISIONING","PROVISIONING_FAILED","AWAITING_ACTIVATION","AWAITING_CLAIM","WAITING_FOR_PLATFORM","ACTIVE","SUSPENDED","REJECTED","WITHDRAWN","TERMINATED","DISCONNECTED"]},{"type":"null"}]},"message":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","kind","side","createdAt"],"additionalProperties":false}},"submittedAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","status","offeringId","offeringName","accountName","providerOrganizationName","applicantContextType","applicantContextId","snapshot","answers","becameDefaultRoute","events","submittedAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"409":{"description":"409","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"openTransactions":{"type":"number"},"recentTransactions":{"type":"number"}},"required":["message","openTransactions","recentTransactions"],"additionalProperties":false}}}}}}},"/api/v1/account-applications/mine/{id}/messages":{"post":{"summary":"Write to the provider","tags":["accountApplications"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"contextType","in":"query","schema":{"type":"string","enum":["organization","partner","customer"]}},{"name":"contextId","in":"query","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","minLength":1,"maxLength":5000}},"required":["message"]}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["SUBMITTED","IN_REVIEW","INFO_REQUESTED","APPROVED","PROVISIONING","PROVISIONING_FAILED","AWAITING_ACTIVATION","AWAITING_CLAIM","WAITING_FOR_PLATFORM","ACTIVE","SUSPENDED","REJECTED","WITHDRAWN","TERMINATED","DISCONNECTED"]},"offeringId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"offeringName":{"type":"string"},"accountName":{"type":"string"},"accountSlug":{"type":["string","null"]},"providerOrganizationName":{"type":"string"},"providerSlug":{"type":["string","null"]},"applicantContextType":{"type":"string","enum":["organization","partner","customer"]},"applicantContextId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"snapshot":{"type":"object","properties":{"legalName":{"type":"string","minLength":1},"name":{"type":["string","null"]},"url":{"type":["string","null"]},"regNo":{"type":["string","null"]},"vat":{"anyOf":[{"type":"object","properties":{"number":{"description":"VAT number","type":"string"},"type":{"description":"VAT type","type":"string","enum":["SEVAT","SEREVERSEDVAT","EUREVERSEDVAT","EUVAT","EXPORT"]}},"additionalProperties":false},{"type":"null"}]},"address1":{"type":["string","null"]},"address2":{"type":["string","null"]},"zipCode":{"type":["string","null"]},"city":{"type":["string","null"]},"state":{"type":["string","null"]},"countryCode":{"anyOf":[{"type":"string","enum":["AFG","ALA","ALB","DZA","ASM","AND","AGO","AIA","ATA","ATG","ARG","ARM","ABW","AUS","AUT","AZE","BHS","BHR","BGD","BRB","BLR","BEL","BLZ","BEN","BMU","BTN","BOL","BES","BIH","BWA","BVT","BRA","IOT","VGB","BRN","BGR","BFA","BDI","KHM","CMR","CAN","CPV","CYM","CAF","TCD","CHL","CHN","CXR","CCK","COL","COM","COG","COD","COK","CRI","CIV","HRV","CUB","CUW","CYP","CZE","DNK","DJI","DMA","DOM","ECU","EGY","SLV","GNQ","ERI","EST","SWZ","ETH","FLK","FRO","FJI","FIN","FRA","GUF","PYF","ATF","GAB","GMB","GEO","DEU","GHA","GIB","GRC","GRL","GRD","GLP","GUM","GTM","GGY","GIN","GNB","GUY","HTI","HMD","HND","HKG","HUN","ISL","IND","IDN","IRN","IRQ","IRL","IMN","ISR","ITA","JAM","JPN","JEY","JOR","KAZ","KEN","KIR","PRK","KOR","KWT","KGZ","LAO","LVA","LBN","LSO","LBR","LBY","LIE","LTU","LUX","MAC","MKD","MDG","MWI","MYS","MDV","MLI","MLT","MHL","MTQ","MRT","MUS","MYT","MEX","FSM","MDA","MCO","MNG","MNE","MSR","MAR","MOZ","MMR","NAM","NRU","NPL","NLD","NCL","NZL","NIC","NER","NGA","NIU","NFK","MNP","NOR","OMN","PAK","PLW","PSE","PAN","PNG","PRY","PER","PHL","PCN","POL","PRT","PRI","QAT","REU","ROU","RUS","RWA","BLM","SHN","KNA","LCA","MAF","SPM","VCT","WSM","SMR","STP","SAU","SEN","SRB","SYC","SLE","SGP","SXM","SVK","SVN","SLB","SOM","ZAF","SGS","SSD","ESP","LKA","SDN","SUR","SJM","SWE","CHE","SYR","TWN","TJK","TZA","THA","TLS","TGO","TKL","TON","TTO","TUN","TUR","TKM","TCA","TUV","UGA","UKR","ARE","GBR","USA","UMI","VIR","URY","UZB","VUT","VAT","VEN","VNM","WLF","ESH","YEM","ZMB","ZWE","ZZZ"]},{"type":"null"}]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"financeEmail":{"type":["string","null"]},"contact":{"type":["string","null"]},"contactEmail":{"type":["string","null"]}},"required":["legalName"],"additionalProperties":false},"answers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"connectionId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"decisionNote":{"type":["string","null"]},"becameDefaultRoute":{"type":"boolean"},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["STATUS","MESSAGE","PROVISIONING_STEP"]},"side":{"type":"string","enum":["applicant","provider","system"]},"actorName":{"type":["string","null"]},"status":{"anyOf":[{"type":"string","enum":["SUBMITTED","IN_REVIEW","INFO_REQUESTED","APPROVED","PROVISIONING","PROVISIONING_FAILED","AWAITING_ACTIVATION","AWAITING_CLAIM","WAITING_FOR_PLATFORM","ACTIVE","SUSPENDED","REJECTED","WITHDRAWN","TERMINATED","DISCONNECTED"]},{"type":"null"}]},"message":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","kind","side","createdAt"],"additionalProperties":false}},"submittedAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","status","offeringId","offeringName","accountName","providerOrganizationName","applicantContextType","applicantContextId","snapshot","answers","becameDefaultRoute","events","submittedAt","updatedAt"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/account-applications/mine/{id}/rotate":{"post":{"summary":"Replace the account's credentials","tags":["accountApplications"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"contextType","in":"query","schema":{"type":"string","enum":["organization","partner","customer"]}},{"name":"contextId","in":"query","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["SUBMITTED","IN_REVIEW","INFO_REQUESTED","APPROVED","PROVISIONING","PROVISIONING_FAILED","AWAITING_ACTIVATION","AWAITING_CLAIM","WAITING_FOR_PLATFORM","ACTIVE","SUSPENDED","REJECTED","WITHDRAWN","TERMINATED","DISCONNECTED"]},"offeringId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"offeringName":{"type":"string"},"accountName":{"type":"string"},"accountSlug":{"type":["string","null"]},"providerOrganizationName":{"type":"string"},"providerSlug":{"type":["string","null"]},"applicantContextType":{"type":"string","enum":["organization","partner","customer"]},"applicantContextId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"snapshot":{"type":"object","properties":{"legalName":{"type":"string","minLength":1},"name":{"type":["string","null"]},"url":{"type":["string","null"]},"regNo":{"type":["string","null"]},"vat":{"anyOf":[{"type":"object","properties":{"number":{"description":"VAT number","type":"string"},"type":{"description":"VAT type","type":"string","enum":["SEVAT","SEREVERSEDVAT","EUREVERSEDVAT","EUVAT","EXPORT"]}},"additionalProperties":false},{"type":"null"}]},"address1":{"type":["string","null"]},"address2":{"type":["string","null"]},"zipCode":{"type":["string","null"]},"city":{"type":["string","null"]},"state":{"type":["string","null"]},"countryCode":{"anyOf":[{"type":"string","enum":["AFG","ALA","ALB","DZA","ASM","AND","AGO","AIA","ATA","ATG","ARG","ARM","ABW","AUS","AUT","AZE","BHS","BHR","BGD","BRB","BLR","BEL","BLZ","BEN","BMU","BTN","BOL","BES","BIH","BWA","BVT","BRA","IOT","VGB","BRN","BGR","BFA","BDI","KHM","CMR","CAN","CPV","CYM","CAF","TCD","CHL","CHN","CXR","CCK","COL","COM","COG","COD","COK","CRI","CIV","HRV","CUB","CUW","CYP","CZE","DNK","DJI","DMA","DOM","ECU","EGY","SLV","GNQ","ERI","EST","SWZ","ETH","FLK","FRO","FJI","FIN","FRA","GUF","PYF","ATF","GAB","GMB","GEO","DEU","GHA","GIB","GRC","GRL","GRD","GLP","GUM","GTM","GGY","GIN","GNB","GUY","HTI","HMD","HND","HKG","HUN","ISL","IND","IDN","IRN","IRQ","IRL","IMN","ISR","ITA","JAM","JPN","JEY","JOR","KAZ","KEN","KIR","PRK","KOR","KWT","KGZ","LAO","LVA","LBN","LSO","LBR","LBY","LIE","LTU","LUX","MAC","MKD","MDG","MWI","MYS","MDV","MLI","MLT","MHL","MTQ","MRT","MUS","MYT","MEX","FSM","MDA","MCO","MNG","MNE","MSR","MAR","MOZ","MMR","NAM","NRU","NPL","NLD","NCL","NZL","NIC","NER","NGA","NIU","NFK","MNP","NOR","OMN","PAK","PLW","PSE","PAN","PNG","PRY","PER","PHL","PCN","POL","PRT","PRI","QAT","REU","ROU","RUS","RWA","BLM","SHN","KNA","LCA","MAF","SPM","VCT","WSM","SMR","STP","SAU","SEN","SRB","SYC","SLE","SGP","SXM","SVK","SVN","SLB","SOM","ZAF","SGS","SSD","ESP","LKA","SDN","SUR","SJM","SWE","CHE","SYR","TWN","TJK","TZA","THA","TLS","TGO","TKL","TON","TTO","TUN","TUR","TKM","TCA","TUV","UGA","UKR","ARE","GBR","USA","UMI","VIR","URY","UZB","VUT","VAT","VEN","VNM","WLF","ESH","YEM","ZMB","ZWE","ZZZ"]},{"type":"null"}]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"financeEmail":{"type":["string","null"]},"contact":{"type":["string","null"]},"contactEmail":{"type":["string","null"]}},"required":["legalName"],"additionalProperties":false},"answers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"connectionId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"decisionNote":{"type":["string","null"]},"becameDefaultRoute":{"type":"boolean"},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["STATUS","MESSAGE","PROVISIONING_STEP"]},"side":{"type":"string","enum":["applicant","provider","system"]},"actorName":{"type":["string","null"]},"status":{"anyOf":[{"type":"string","enum":["SUBMITTED","IN_REVIEW","INFO_REQUESTED","APPROVED","PROVISIONING","PROVISIONING_FAILED","AWAITING_ACTIVATION","AWAITING_CLAIM","WAITING_FOR_PLATFORM","ACTIVE","SUSPENDED","REJECTED","WITHDRAWN","TERMINATED","DISCONNECTED"]},{"type":"null"}]},"message":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","kind","side","createdAt"],"additionalProperties":false}},"submittedAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","status","offeringId","offeringName","accountName","providerOrganizationName","applicantContextType","applicantContextId","snapshot","answers","becameDefaultRoute","events","submittedAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/account-applications/{id}":{"get":{"summary":"One application, as its reviewer sees it","tags":["accountApplications"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["SUBMITTED","IN_REVIEW","INFO_REQUESTED","APPROVED","PROVISIONING","PROVISIONING_FAILED","AWAITING_ACTIVATION","AWAITING_CLAIM","WAITING_FOR_PLATFORM","ACTIVE","SUSPENDED","REJECTED","WITHDRAWN","TERMINATED","DISCONNECTED"]},"offeringId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"offeringName":{"type":"string"},"accountName":{"type":"string"},"applicantName":{"type":"string"},"applicantOrigin":{"type":["string","null"]},"snapshot":{"type":"object","properties":{"legalName":{"type":"string","minLength":1},"name":{"type":["string","null"]},"url":{"type":["string","null"]},"regNo":{"type":["string","null"]},"vat":{"anyOf":[{"type":"object","properties":{"number":{"description":"VAT number","type":"string"},"type":{"description":"VAT type","type":"string","enum":["SEVAT","SEREVERSEDVAT","EUREVERSEDVAT","EUVAT","EXPORT"]}},"additionalProperties":false},{"type":"null"}]},"address1":{"type":["string","null"]},"address2":{"type":["string","null"]},"zipCode":{"type":["string","null"]},"city":{"type":["string","null"]},"state":{"type":["string","null"]},"countryCode":{"anyOf":[{"type":"string","enum":["AFG","ALA","ALB","DZA","ASM","AND","AGO","AIA","ATA","ATG","ARG","ARM","ABW","AUS","AUT","AZE","BHS","BHR","BGD","BRB","BLR","BEL","BLZ","BEN","BMU","BTN","BOL","BES","BIH","BWA","BVT","BRA","IOT","VGB","BRN","BGR","BFA","BDI","KHM","CMR","CAN","CPV","CYM","CAF","TCD","CHL","CHN","CXR","CCK","COL","COM","COG","COD","COK","CRI","CIV","HRV","CUB","CUW","CYP","CZE","DNK","DJI","DMA","DOM","ECU","EGY","SLV","GNQ","ERI","EST","SWZ","ETH","FLK","FRO","FJI","FIN","FRA","GUF","PYF","ATF","GAB","GMB","GEO","DEU","GHA","GIB","GRC","GRL","GRD","GLP","GUM","GTM","GGY","GIN","GNB","GUY","HTI","HMD","HND","HKG","HUN","ISL","IND","IDN","IRN","IRQ","IRL","IMN","ISR","ITA","JAM","JPN","JEY","JOR","KAZ","KEN","KIR","PRK","KOR","KWT","KGZ","LAO","LVA","LBN","LSO","LBR","LBY","LIE","LTU","LUX","MAC","MKD","MDG","MWI","MYS","MDV","MLI","MLT","MHL","MTQ","MRT","MUS","MYT","MEX","FSM","MDA","MCO","MNG","MNE","MSR","MAR","MOZ","MMR","NAM","NRU","NPL","NLD","NCL","NZL","NIC","NER","NGA","NIU","NFK","MNP","NOR","OMN","PAK","PLW","PSE","PAN","PNG","PRY","PER","PHL","PCN","POL","PRT","PRI","QAT","REU","ROU","RUS","RWA","BLM","SHN","KNA","LCA","MAF","SPM","VCT","WSM","SMR","STP","SAU","SEN","SRB","SYC","SLE","SGP","SXM","SVK","SVN","SLB","SOM","ZAF","SGS","SSD","ESP","LKA","SDN","SUR","SJM","SWE","CHE","SYR","TWN","TJK","TZA","THA","TLS","TGO","TKL","TON","TTO","TUN","TUR","TKM","TCA","TUV","UGA","UKR","ARE","GBR","USA","UMI","VIR","URY","UZB","VUT","VAT","VEN","VNM","WLF","ESH","YEM","ZMB","ZWE","ZZZ"]},{"type":"null"}]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"financeEmail":{"type":["string","null"]},"contact":{"type":["string","null"]},"contactEmail":{"type":["string","null"]}},"required":["legalName"],"additionalProperties":false},"answers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"termsVersion":{"type":["string","null"]},"termsAcceptedAt":{"type":["string","null"]},"provisioned":{"type":"object","properties":{"attachToCustomerId":{"type":"string"},"customerId":{"type":"string"},"applicationId":{"type":"string"},"appSlugId":{"type":"string"},"apiKeyId":{"type":"string"},"connectionId":{"type":"string"},"becameDefaultRoute":{"type":"boolean"},"steps":{"default":[],"type":"array","items":{"type":"object","properties":{"step":{"type":"string"},"ok":{"type":"boolean"},"detail":{"type":"string"},"at":{"type":"string"}},"required":["step","ok","at"],"additionalProperties":false}}},"required":["steps"],"additionalProperties":false},"possibleDuplicates":{"type":"array","items":{"type":"object","properties":{"customerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"legalName":{"type":"string"},"regNo":{"type":["string","null"]},"vatNo":{"type":["string","null"]},"matchedOn":{"type":"array","items":{"type":"string","enum":["regNo","vatNo","legalName"]}}},"required":["customerId","legalName","matchedOn"],"additionalProperties":false}},"existingCustomerId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"decidedBy":{"type":["string","null"]},"decidedAt":{"type":["string","null"]},"decisionNote":{"type":["string","null"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["STATUS","MESSAGE","PROVISIONING_STEP"]},"side":{"type":"string","enum":["applicant","provider","system"]},"actorName":{"type":["string","null"]},"status":{"anyOf":[{"type":"string","enum":["SUBMITTED","IN_REVIEW","INFO_REQUESTED","APPROVED","PROVISIONING","PROVISIONING_FAILED","AWAITING_ACTIVATION","AWAITING_CLAIM","WAITING_FOR_PLATFORM","ACTIVE","SUSPENDED","REJECTED","WITHDRAWN","TERMINATED","DISCONNECTED"]},{"type":"null"}]},"message":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","kind","side","createdAt"],"additionalProperties":false}},"submittedAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","status","offeringId","offeringName","accountName","applicantName","snapshot","answers","provisioned","possibleDuplicates","events","submittedAt","updatedAt"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/account-applications/{id}/start-review":{"post":{"summary":"Mark an application as being reviewed","tags":["accountApplications"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["SUBMITTED","IN_REVIEW","INFO_REQUESTED","APPROVED","PROVISIONING","PROVISIONING_FAILED","AWAITING_ACTIVATION","AWAITING_CLAIM","WAITING_FOR_PLATFORM","ACTIVE","SUSPENDED","REJECTED","WITHDRAWN","TERMINATED","DISCONNECTED"]},"offeringId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"offeringName":{"type":"string"},"accountName":{"type":"string"},"applicantName":{"type":"string"},"applicantOrigin":{"type":["string","null"]},"snapshot":{"type":"object","properties":{"legalName":{"type":"string","minLength":1},"name":{"type":["string","null"]},"url":{"type":["string","null"]},"regNo":{"type":["string","null"]},"vat":{"anyOf":[{"type":"object","properties":{"number":{"description":"VAT number","type":"string"},"type":{"description":"VAT type","type":"string","enum":["SEVAT","SEREVERSEDVAT","EUREVERSEDVAT","EUVAT","EXPORT"]}},"additionalProperties":false},{"type":"null"}]},"address1":{"type":["string","null"]},"address2":{"type":["string","null"]},"zipCode":{"type":["string","null"]},"city":{"type":["string","null"]},"state":{"type":["string","null"]},"countryCode":{"anyOf":[{"type":"string","enum":["AFG","ALA","ALB","DZA","ASM","AND","AGO","AIA","ATA","ATG","ARG","ARM","ABW","AUS","AUT","AZE","BHS","BHR","BGD","BRB","BLR","BEL","BLZ","BEN","BMU","BTN","BOL","BES","BIH","BWA","BVT","BRA","IOT","VGB","BRN","BGR","BFA","BDI","KHM","CMR","CAN","CPV","CYM","CAF","TCD","CHL","CHN","CXR","CCK","COL","COM","COG","COD","COK","CRI","CIV","HRV","CUB","CUW","CYP","CZE","DNK","DJI","DMA","DOM","ECU","EGY","SLV","GNQ","ERI","EST","SWZ","ETH","FLK","FRO","FJI","FIN","FRA","GUF","PYF","ATF","GAB","GMB","GEO","DEU","GHA","GIB","GRC","GRL","GRD","GLP","GUM","GTM","GGY","GIN","GNB","GUY","HTI","HMD","HND","HKG","HUN","ISL","IND","IDN","IRN","IRQ","IRL","IMN","ISR","ITA","JAM","JPN","JEY","JOR","KAZ","KEN","KIR","PRK","KOR","KWT","KGZ","LAO","LVA","LBN","LSO","LBR","LBY","LIE","LTU","LUX","MAC","MKD","MDG","MWI","MYS","MDV","MLI","MLT","MHL","MTQ","MRT","MUS","MYT","MEX","FSM","MDA","MCO","MNG","MNE","MSR","MAR","MOZ","MMR","NAM","NRU","NPL","NLD","NCL","NZL","NIC","NER","NGA","NIU","NFK","MNP","NOR","OMN","PAK","PLW","PSE","PAN","PNG","PRY","PER","PHL","PCN","POL","PRT","PRI","QAT","REU","ROU","RUS","RWA","BLM","SHN","KNA","LCA","MAF","SPM","VCT","WSM","SMR","STP","SAU","SEN","SRB","SYC","SLE","SGP","SXM","SVK","SVN","SLB","SOM","ZAF","SGS","SSD","ESP","LKA","SDN","SUR","SJM","SWE","CHE","SYR","TWN","TJK","TZA","THA","TLS","TGO","TKL","TON","TTO","TUN","TUR","TKM","TCA","TUV","UGA","UKR","ARE","GBR","USA","UMI","VIR","URY","UZB","VUT","VAT","VEN","VNM","WLF","ESH","YEM","ZMB","ZWE","ZZZ"]},{"type":"null"}]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"financeEmail":{"type":["string","null"]},"contact":{"type":["string","null"]},"contactEmail":{"type":["string","null"]}},"required":["legalName"],"additionalProperties":false},"answers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"termsVersion":{"type":["string","null"]},"termsAcceptedAt":{"type":["string","null"]},"provisioned":{"type":"object","properties":{"attachToCustomerId":{"type":"string"},"customerId":{"type":"string"},"applicationId":{"type":"string"},"appSlugId":{"type":"string"},"apiKeyId":{"type":"string"},"connectionId":{"type":"string"},"becameDefaultRoute":{"type":"boolean"},"steps":{"default":[],"type":"array","items":{"type":"object","properties":{"step":{"type":"string"},"ok":{"type":"boolean"},"detail":{"type":"string"},"at":{"type":"string"}},"required":["step","ok","at"],"additionalProperties":false}}},"required":["steps"],"additionalProperties":false},"possibleDuplicates":{"type":"array","items":{"type":"object","properties":{"customerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"legalName":{"type":"string"},"regNo":{"type":["string","null"]},"vatNo":{"type":["string","null"]},"matchedOn":{"type":"array","items":{"type":"string","enum":["regNo","vatNo","legalName"]}}},"required":["customerId","legalName","matchedOn"],"additionalProperties":false}},"existingCustomerId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"decidedBy":{"type":["string","null"]},"decidedAt":{"type":["string","null"]},"decisionNote":{"type":["string","null"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["STATUS","MESSAGE","PROVISIONING_STEP"]},"side":{"type":"string","enum":["applicant","provider","system"]},"actorName":{"type":["string","null"]},"status":{"anyOf":[{"type":"string","enum":["SUBMITTED","IN_REVIEW","INFO_REQUESTED","APPROVED","PROVISIONING","PROVISIONING_FAILED","AWAITING_ACTIVATION","AWAITING_CLAIM","WAITING_FOR_PLATFORM","ACTIVE","SUSPENDED","REJECTED","WITHDRAWN","TERMINATED","DISCONNECTED"]},{"type":"null"}]},"message":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","kind","side","createdAt"],"additionalProperties":false}},"submittedAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","status","offeringId","offeringName","accountName","applicantName","snapshot","answers","provisioned","possibleDuplicates","events","submittedAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/account-applications/{id}/request-info":{"post":{"summary":"Ask the applicant for more information","tags":["accountApplications"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","minLength":1,"maxLength":5000}},"required":["message"]}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["SUBMITTED","IN_REVIEW","INFO_REQUESTED","APPROVED","PROVISIONING","PROVISIONING_FAILED","AWAITING_ACTIVATION","AWAITING_CLAIM","WAITING_FOR_PLATFORM","ACTIVE","SUSPENDED","REJECTED","WITHDRAWN","TERMINATED","DISCONNECTED"]},"offeringId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"offeringName":{"type":"string"},"accountName":{"type":"string"},"applicantName":{"type":"string"},"applicantOrigin":{"type":["string","null"]},"snapshot":{"type":"object","properties":{"legalName":{"type":"string","minLength":1},"name":{"type":["string","null"]},"url":{"type":["string","null"]},"regNo":{"type":["string","null"]},"vat":{"anyOf":[{"type":"object","properties":{"number":{"description":"VAT number","type":"string"},"type":{"description":"VAT type","type":"string","enum":["SEVAT","SEREVERSEDVAT","EUREVERSEDVAT","EUVAT","EXPORT"]}},"additionalProperties":false},{"type":"null"}]},"address1":{"type":["string","null"]},"address2":{"type":["string","null"]},"zipCode":{"type":["string","null"]},"city":{"type":["string","null"]},"state":{"type":["string","null"]},"countryCode":{"anyOf":[{"type":"string","enum":["AFG","ALA","ALB","DZA","ASM","AND","AGO","AIA","ATA","ATG","ARG","ARM","ABW","AUS","AUT","AZE","BHS","BHR","BGD","BRB","BLR","BEL","BLZ","BEN","BMU","BTN","BOL","BES","BIH","BWA","BVT","BRA","IOT","VGB","BRN","BGR","BFA","BDI","KHM","CMR","CAN","CPV","CYM","CAF","TCD","CHL","CHN","CXR","CCK","COL","COM","COG","COD","COK","CRI","CIV","HRV","CUB","CUW","CYP","CZE","DNK","DJI","DMA","DOM","ECU","EGY","SLV","GNQ","ERI","EST","SWZ","ETH","FLK","FRO","FJI","FIN","FRA","GUF","PYF","ATF","GAB","GMB","GEO","DEU","GHA","GIB","GRC","GRL","GRD","GLP","GUM","GTM","GGY","GIN","GNB","GUY","HTI","HMD","HND","HKG","HUN","ISL","IND","IDN","IRN","IRQ","IRL","IMN","ISR","ITA","JAM","JPN","JEY","JOR","KAZ","KEN","KIR","PRK","KOR","KWT","KGZ","LAO","LVA","LBN","LSO","LBR","LBY","LIE","LTU","LUX","MAC","MKD","MDG","MWI","MYS","MDV","MLI","MLT","MHL","MTQ","MRT","MUS","MYT","MEX","FSM","MDA","MCO","MNG","MNE","MSR","MAR","MOZ","MMR","NAM","NRU","NPL","NLD","NCL","NZL","NIC","NER","NGA","NIU","NFK","MNP","NOR","OMN","PAK","PLW","PSE","PAN","PNG","PRY","PER","PHL","PCN","POL","PRT","PRI","QAT","REU","ROU","RUS","RWA","BLM","SHN","KNA","LCA","MAF","SPM","VCT","WSM","SMR","STP","SAU","SEN","SRB","SYC","SLE","SGP","SXM","SVK","SVN","SLB","SOM","ZAF","SGS","SSD","ESP","LKA","SDN","SUR","SJM","SWE","CHE","SYR","TWN","TJK","TZA","THA","TLS","TGO","TKL","TON","TTO","TUN","TUR","TKM","TCA","TUV","UGA","UKR","ARE","GBR","USA","UMI","VIR","URY","UZB","VUT","VAT","VEN","VNM","WLF","ESH","YEM","ZMB","ZWE","ZZZ"]},{"type":"null"}]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"financeEmail":{"type":["string","null"]},"contact":{"type":["string","null"]},"contactEmail":{"type":["string","null"]}},"required":["legalName"],"additionalProperties":false},"answers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"termsVersion":{"type":["string","null"]},"termsAcceptedAt":{"type":["string","null"]},"provisioned":{"type":"object","properties":{"attachToCustomerId":{"type":"string"},"customerId":{"type":"string"},"applicationId":{"type":"string"},"appSlugId":{"type":"string"},"apiKeyId":{"type":"string"},"connectionId":{"type":"string"},"becameDefaultRoute":{"type":"boolean"},"steps":{"default":[],"type":"array","items":{"type":"object","properties":{"step":{"type":"string"},"ok":{"type":"boolean"},"detail":{"type":"string"},"at":{"type":"string"}},"required":["step","ok","at"],"additionalProperties":false}}},"required":["steps"],"additionalProperties":false},"possibleDuplicates":{"type":"array","items":{"type":"object","properties":{"customerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"legalName":{"type":"string"},"regNo":{"type":["string","null"]},"vatNo":{"type":["string","null"]},"matchedOn":{"type":"array","items":{"type":"string","enum":["regNo","vatNo","legalName"]}}},"required":["customerId","legalName","matchedOn"],"additionalProperties":false}},"existingCustomerId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"decidedBy":{"type":["string","null"]},"decidedAt":{"type":["string","null"]},"decisionNote":{"type":["string","null"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["STATUS","MESSAGE","PROVISIONING_STEP"]},"side":{"type":"string","enum":["applicant","provider","system"]},"actorName":{"type":["string","null"]},"status":{"anyOf":[{"type":"string","enum":["SUBMITTED","IN_REVIEW","INFO_REQUESTED","APPROVED","PROVISIONING","PROVISIONING_FAILED","AWAITING_ACTIVATION","AWAITING_CLAIM","WAITING_FOR_PLATFORM","ACTIVE","SUSPENDED","REJECTED","WITHDRAWN","TERMINATED","DISCONNECTED"]},{"type":"null"}]},"message":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","kind","side","createdAt"],"additionalProperties":false}},"submittedAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","status","offeringId","offeringName","accountName","applicantName","snapshot","answers","provisioned","possibleDuplicates","events","submittedAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/account-applications/{id}/approve":{"post":{"summary":"Approve and provision the account","tags":["accountApplications"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"note":{"type":"string"},"attachToCustomerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["SUBMITTED","IN_REVIEW","INFO_REQUESTED","APPROVED","PROVISIONING","PROVISIONING_FAILED","AWAITING_ACTIVATION","AWAITING_CLAIM","WAITING_FOR_PLATFORM","ACTIVE","SUSPENDED","REJECTED","WITHDRAWN","TERMINATED","DISCONNECTED"]},"offeringId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"offeringName":{"type":"string"},"accountName":{"type":"string"},"applicantName":{"type":"string"},"applicantOrigin":{"type":["string","null"]},"snapshot":{"type":"object","properties":{"legalName":{"type":"string","minLength":1},"name":{"type":["string","null"]},"url":{"type":["string","null"]},"regNo":{"type":["string","null"]},"vat":{"anyOf":[{"type":"object","properties":{"number":{"description":"VAT number","type":"string"},"type":{"description":"VAT type","type":"string","enum":["SEVAT","SEREVERSEDVAT","EUREVERSEDVAT","EUVAT","EXPORT"]}},"additionalProperties":false},{"type":"null"}]},"address1":{"type":["string","null"]},"address2":{"type":["string","null"]},"zipCode":{"type":["string","null"]},"city":{"type":["string","null"]},"state":{"type":["string","null"]},"countryCode":{"anyOf":[{"type":"string","enum":["AFG","ALA","ALB","DZA","ASM","AND","AGO","AIA","ATA","ATG","ARG","ARM","ABW","AUS","AUT","AZE","BHS","BHR","BGD","BRB","BLR","BEL","BLZ","BEN","BMU","BTN","BOL","BES","BIH","BWA","BVT","BRA","IOT","VGB","BRN","BGR","BFA","BDI","KHM","CMR","CAN","CPV","CYM","CAF","TCD","CHL","CHN","CXR","CCK","COL","COM","COG","COD","COK","CRI","CIV","HRV","CUB","CUW","CYP","CZE","DNK","DJI","DMA","DOM","ECU","EGY","SLV","GNQ","ERI","EST","SWZ","ETH","FLK","FRO","FJI","FIN","FRA","GUF","PYF","ATF","GAB","GMB","GEO","DEU","GHA","GIB","GRC","GRL","GRD","GLP","GUM","GTM","GGY","GIN","GNB","GUY","HTI","HMD","HND","HKG","HUN","ISL","IND","IDN","IRN","IRQ","IRL","IMN","ISR","ITA","JAM","JPN","JEY","JOR","KAZ","KEN","KIR","PRK","KOR","KWT","KGZ","LAO","LVA","LBN","LSO","LBR","LBY","LIE","LTU","LUX","MAC","MKD","MDG","MWI","MYS","MDV","MLI","MLT","MHL","MTQ","MRT","MUS","MYT","MEX","FSM","MDA","MCO","MNG","MNE","MSR","MAR","MOZ","MMR","NAM","NRU","NPL","NLD","NCL","NZL","NIC","NER","NGA","NIU","NFK","MNP","NOR","OMN","PAK","PLW","PSE","PAN","PNG","PRY","PER","PHL","PCN","POL","PRT","PRI","QAT","REU","ROU","RUS","RWA","BLM","SHN","KNA","LCA","MAF","SPM","VCT","WSM","SMR","STP","SAU","SEN","SRB","SYC","SLE","SGP","SXM","SVK","SVN","SLB","SOM","ZAF","SGS","SSD","ESP","LKA","SDN","SUR","SJM","SWE","CHE","SYR","TWN","TJK","TZA","THA","TLS","TGO","TKL","TON","TTO","TUN","TUR","TKM","TCA","TUV","UGA","UKR","ARE","GBR","USA","UMI","VIR","URY","UZB","VUT","VAT","VEN","VNM","WLF","ESH","YEM","ZMB","ZWE","ZZZ"]},{"type":"null"}]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"financeEmail":{"type":["string","null"]},"contact":{"type":["string","null"]},"contactEmail":{"type":["string","null"]}},"required":["legalName"],"additionalProperties":false},"answers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"termsVersion":{"type":["string","null"]},"termsAcceptedAt":{"type":["string","null"]},"provisioned":{"type":"object","properties":{"attachToCustomerId":{"type":"string"},"customerId":{"type":"string"},"applicationId":{"type":"string"},"appSlugId":{"type":"string"},"apiKeyId":{"type":"string"},"connectionId":{"type":"string"},"becameDefaultRoute":{"type":"boolean"},"steps":{"default":[],"type":"array","items":{"type":"object","properties":{"step":{"type":"string"},"ok":{"type":"boolean"},"detail":{"type":"string"},"at":{"type":"string"}},"required":["step","ok","at"],"additionalProperties":false}}},"required":["steps"],"additionalProperties":false},"possibleDuplicates":{"type":"array","items":{"type":"object","properties":{"customerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"legalName":{"type":"string"},"regNo":{"type":["string","null"]},"vatNo":{"type":["string","null"]},"matchedOn":{"type":"array","items":{"type":"string","enum":["regNo","vatNo","legalName"]}}},"required":["customerId","legalName","matchedOn"],"additionalProperties":false}},"existingCustomerId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"decidedBy":{"type":["string","null"]},"decidedAt":{"type":["string","null"]},"decisionNote":{"type":["string","null"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["STATUS","MESSAGE","PROVISIONING_STEP"]},"side":{"type":"string","enum":["applicant","provider","system"]},"actorName":{"type":["string","null"]},"status":{"anyOf":[{"type":"string","enum":["SUBMITTED","IN_REVIEW","INFO_REQUESTED","APPROVED","PROVISIONING","PROVISIONING_FAILED","AWAITING_ACTIVATION","AWAITING_CLAIM","WAITING_FOR_PLATFORM","ACTIVE","SUSPENDED","REJECTED","WITHDRAWN","TERMINATED","DISCONNECTED"]},{"type":"null"}]},"message":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","kind","side","createdAt"],"additionalProperties":false}},"submittedAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","status","offeringId","offeringName","accountName","applicantName","snapshot","answers","provisioned","possibleDuplicates","events","submittedAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/account-applications/{id}/reject":{"post":{"summary":"Reject an application","tags":["accountApplications"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":1}},"required":["reason"]}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["SUBMITTED","IN_REVIEW","INFO_REQUESTED","APPROVED","PROVISIONING","PROVISIONING_FAILED","AWAITING_ACTIVATION","AWAITING_CLAIM","WAITING_FOR_PLATFORM","ACTIVE","SUSPENDED","REJECTED","WITHDRAWN","TERMINATED","DISCONNECTED"]},"offeringId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"offeringName":{"type":"string"},"accountName":{"type":"string"},"applicantName":{"type":"string"},"applicantOrigin":{"type":["string","null"]},"snapshot":{"type":"object","properties":{"legalName":{"type":"string","minLength":1},"name":{"type":["string","null"]},"url":{"type":["string","null"]},"regNo":{"type":["string","null"]},"vat":{"anyOf":[{"type":"object","properties":{"number":{"description":"VAT number","type":"string"},"type":{"description":"VAT type","type":"string","enum":["SEVAT","SEREVERSEDVAT","EUREVERSEDVAT","EUVAT","EXPORT"]}},"additionalProperties":false},{"type":"null"}]},"address1":{"type":["string","null"]},"address2":{"type":["string","null"]},"zipCode":{"type":["string","null"]},"city":{"type":["string","null"]},"state":{"type":["string","null"]},"countryCode":{"anyOf":[{"type":"string","enum":["AFG","ALA","ALB","DZA","ASM","AND","AGO","AIA","ATA","ATG","ARG","ARM","ABW","AUS","AUT","AZE","BHS","BHR","BGD","BRB","BLR","BEL","BLZ","BEN","BMU","BTN","BOL","BES","BIH","BWA","BVT","BRA","IOT","VGB","BRN","BGR","BFA","BDI","KHM","CMR","CAN","CPV","CYM","CAF","TCD","CHL","CHN","CXR","CCK","COL","COM","COG","COD","COK","CRI","CIV","HRV","CUB","CUW","CYP","CZE","DNK","DJI","DMA","DOM","ECU","EGY","SLV","GNQ","ERI","EST","SWZ","ETH","FLK","FRO","FJI","FIN","FRA","GUF","PYF","ATF","GAB","GMB","GEO","DEU","GHA","GIB","GRC","GRL","GRD","GLP","GUM","GTM","GGY","GIN","GNB","GUY","HTI","HMD","HND","HKG","HUN","ISL","IND","IDN","IRN","IRQ","IRL","IMN","ISR","ITA","JAM","JPN","JEY","JOR","KAZ","KEN","KIR","PRK","KOR","KWT","KGZ","LAO","LVA","LBN","LSO","LBR","LBY","LIE","LTU","LUX","MAC","MKD","MDG","MWI","MYS","MDV","MLI","MLT","MHL","MTQ","MRT","MUS","MYT","MEX","FSM","MDA","MCO","MNG","MNE","MSR","MAR","MOZ","MMR","NAM","NRU","NPL","NLD","NCL","NZL","NIC","NER","NGA","NIU","NFK","MNP","NOR","OMN","PAK","PLW","PSE","PAN","PNG","PRY","PER","PHL","PCN","POL","PRT","PRI","QAT","REU","ROU","RUS","RWA","BLM","SHN","KNA","LCA","MAF","SPM","VCT","WSM","SMR","STP","SAU","SEN","SRB","SYC","SLE","SGP","SXM","SVK","SVN","SLB","SOM","ZAF","SGS","SSD","ESP","LKA","SDN","SUR","SJM","SWE","CHE","SYR","TWN","TJK","TZA","THA","TLS","TGO","TKL","TON","TTO","TUN","TUR","TKM","TCA","TUV","UGA","UKR","ARE","GBR","USA","UMI","VIR","URY","UZB","VUT","VAT","VEN","VNM","WLF","ESH","YEM","ZMB","ZWE","ZZZ"]},{"type":"null"}]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"financeEmail":{"type":["string","null"]},"contact":{"type":["string","null"]},"contactEmail":{"type":["string","null"]}},"required":["legalName"],"additionalProperties":false},"answers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"termsVersion":{"type":["string","null"]},"termsAcceptedAt":{"type":["string","null"]},"provisioned":{"type":"object","properties":{"attachToCustomerId":{"type":"string"},"customerId":{"type":"string"},"applicationId":{"type":"string"},"appSlugId":{"type":"string"},"apiKeyId":{"type":"string"},"connectionId":{"type":"string"},"becameDefaultRoute":{"type":"boolean"},"steps":{"default":[],"type":"array","items":{"type":"object","properties":{"step":{"type":"string"},"ok":{"type":"boolean"},"detail":{"type":"string"},"at":{"type":"string"}},"required":["step","ok","at"],"additionalProperties":false}}},"required":["steps"],"additionalProperties":false},"possibleDuplicates":{"type":"array","items":{"type":"object","properties":{"customerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"legalName":{"type":"string"},"regNo":{"type":["string","null"]},"vatNo":{"type":["string","null"]},"matchedOn":{"type":"array","items":{"type":"string","enum":["regNo","vatNo","legalName"]}}},"required":["customerId","legalName","matchedOn"],"additionalProperties":false}},"existingCustomerId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"decidedBy":{"type":["string","null"]},"decidedAt":{"type":["string","null"]},"decisionNote":{"type":["string","null"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["STATUS","MESSAGE","PROVISIONING_STEP"]},"side":{"type":"string","enum":["applicant","provider","system"]},"actorName":{"type":["string","null"]},"status":{"anyOf":[{"type":"string","enum":["SUBMITTED","IN_REVIEW","INFO_REQUESTED","APPROVED","PROVISIONING","PROVISIONING_FAILED","AWAITING_ACTIVATION","AWAITING_CLAIM","WAITING_FOR_PLATFORM","ACTIVE","SUSPENDED","REJECTED","WITHDRAWN","TERMINATED","DISCONNECTED"]},{"type":"null"}]},"message":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","kind","side","createdAt"],"additionalProperties":false}},"submittedAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","status","offeringId","offeringName","accountName","applicantName","snapshot","answers","provisioned","possibleDuplicates","events","submittedAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/account-applications/{id}/retry-provisioning":{"post":{"summary":"Run the remaining provisioning steps again","tags":["accountApplications"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["SUBMITTED","IN_REVIEW","INFO_REQUESTED","APPROVED","PROVISIONING","PROVISIONING_FAILED","AWAITING_ACTIVATION","AWAITING_CLAIM","WAITING_FOR_PLATFORM","ACTIVE","SUSPENDED","REJECTED","WITHDRAWN","TERMINATED","DISCONNECTED"]},"offeringId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"offeringName":{"type":"string"},"accountName":{"type":"string"},"applicantName":{"type":"string"},"applicantOrigin":{"type":["string","null"]},"snapshot":{"type":"object","properties":{"legalName":{"type":"string","minLength":1},"name":{"type":["string","null"]},"url":{"type":["string","null"]},"regNo":{"type":["string","null"]},"vat":{"anyOf":[{"type":"object","properties":{"number":{"description":"VAT number","type":"string"},"type":{"description":"VAT type","type":"string","enum":["SEVAT","SEREVERSEDVAT","EUREVERSEDVAT","EUVAT","EXPORT"]}},"additionalProperties":false},{"type":"null"}]},"address1":{"type":["string","null"]},"address2":{"type":["string","null"]},"zipCode":{"type":["string","null"]},"city":{"type":["string","null"]},"state":{"type":["string","null"]},"countryCode":{"anyOf":[{"type":"string","enum":["AFG","ALA","ALB","DZA","ASM","AND","AGO","AIA","ATA","ATG","ARG","ARM","ABW","AUS","AUT","AZE","BHS","BHR","BGD","BRB","BLR","BEL","BLZ","BEN","BMU","BTN","BOL","BES","BIH","BWA","BVT","BRA","IOT","VGB","BRN","BGR","BFA","BDI","KHM","CMR","CAN","CPV","CYM","CAF","TCD","CHL","CHN","CXR","CCK","COL","COM","COG","COD","COK","CRI","CIV","HRV","CUB","CUW","CYP","CZE","DNK","DJI","DMA","DOM","ECU","EGY","SLV","GNQ","ERI","EST","SWZ","ETH","FLK","FRO","FJI","FIN","FRA","GUF","PYF","ATF","GAB","GMB","GEO","DEU","GHA","GIB","GRC","GRL","GRD","GLP","GUM","GTM","GGY","GIN","GNB","GUY","HTI","HMD","HND","HKG","HUN","ISL","IND","IDN","IRN","IRQ","IRL","IMN","ISR","ITA","JAM","JPN","JEY","JOR","KAZ","KEN","KIR","PRK","KOR","KWT","KGZ","LAO","LVA","LBN","LSO","LBR","LBY","LIE","LTU","LUX","MAC","MKD","MDG","MWI","MYS","MDV","MLI","MLT","MHL","MTQ","MRT","MUS","MYT","MEX","FSM","MDA","MCO","MNG","MNE","MSR","MAR","MOZ","MMR","NAM","NRU","NPL","NLD","NCL","NZL","NIC","NER","NGA","NIU","NFK","MNP","NOR","OMN","PAK","PLW","PSE","PAN","PNG","PRY","PER","PHL","PCN","POL","PRT","PRI","QAT","REU","ROU","RUS","RWA","BLM","SHN","KNA","LCA","MAF","SPM","VCT","WSM","SMR","STP","SAU","SEN","SRB","SYC","SLE","SGP","SXM","SVK","SVN","SLB","SOM","ZAF","SGS","SSD","ESP","LKA","SDN","SUR","SJM","SWE","CHE","SYR","TWN","TJK","TZA","THA","TLS","TGO","TKL","TON","TTO","TUN","TUR","TKM","TCA","TUV","UGA","UKR","ARE","GBR","USA","UMI","VIR","URY","UZB","VUT","VAT","VEN","VNM","WLF","ESH","YEM","ZMB","ZWE","ZZZ"]},{"type":"null"}]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"financeEmail":{"type":["string","null"]},"contact":{"type":["string","null"]},"contactEmail":{"type":["string","null"]}},"required":["legalName"],"additionalProperties":false},"answers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"termsVersion":{"type":["string","null"]},"termsAcceptedAt":{"type":["string","null"]},"provisioned":{"type":"object","properties":{"attachToCustomerId":{"type":"string"},"customerId":{"type":"string"},"applicationId":{"type":"string"},"appSlugId":{"type":"string"},"apiKeyId":{"type":"string"},"connectionId":{"type":"string"},"becameDefaultRoute":{"type":"boolean"},"steps":{"default":[],"type":"array","items":{"type":"object","properties":{"step":{"type":"string"},"ok":{"type":"boolean"},"detail":{"type":"string"},"at":{"type":"string"}},"required":["step","ok","at"],"additionalProperties":false}}},"required":["steps"],"additionalProperties":false},"possibleDuplicates":{"type":"array","items":{"type":"object","properties":{"customerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"legalName":{"type":"string"},"regNo":{"type":["string","null"]},"vatNo":{"type":["string","null"]},"matchedOn":{"type":"array","items":{"type":"string","enum":["regNo","vatNo","legalName"]}}},"required":["customerId","legalName","matchedOn"],"additionalProperties":false}},"existingCustomerId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"decidedBy":{"type":["string","null"]},"decidedAt":{"type":["string","null"]},"decisionNote":{"type":["string","null"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["STATUS","MESSAGE","PROVISIONING_STEP"]},"side":{"type":"string","enum":["applicant","provider","system"]},"actorName":{"type":["string","null"]},"status":{"anyOf":[{"type":"string","enum":["SUBMITTED","IN_REVIEW","INFO_REQUESTED","APPROVED","PROVISIONING","PROVISIONING_FAILED","AWAITING_ACTIVATION","AWAITING_CLAIM","WAITING_FOR_PLATFORM","ACTIVE","SUSPENDED","REJECTED","WITHDRAWN","TERMINATED","DISCONNECTED"]},{"type":"null"}]},"message":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","kind","side","createdAt"],"additionalProperties":false}},"submittedAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","status","offeringId","offeringName","accountName","applicantName","snapshot","answers","provisioned","possibleDuplicates","events","submittedAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/account-applications/{id}/activate":{"post":{"summary":"Activate a customer provisioned in ONBOARDING, and its link","tags":["accountApplications"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["SUBMITTED","IN_REVIEW","INFO_REQUESTED","APPROVED","PROVISIONING","PROVISIONING_FAILED","AWAITING_ACTIVATION","AWAITING_CLAIM","WAITING_FOR_PLATFORM","ACTIVE","SUSPENDED","REJECTED","WITHDRAWN","TERMINATED","DISCONNECTED"]},"offeringId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"offeringName":{"type":"string"},"accountName":{"type":"string"},"applicantName":{"type":"string"},"applicantOrigin":{"type":["string","null"]},"snapshot":{"type":"object","properties":{"legalName":{"type":"string","minLength":1},"name":{"type":["string","null"]},"url":{"type":["string","null"]},"regNo":{"type":["string","null"]},"vat":{"anyOf":[{"type":"object","properties":{"number":{"description":"VAT number","type":"string"},"type":{"description":"VAT type","type":"string","enum":["SEVAT","SEREVERSEDVAT","EUREVERSEDVAT","EUVAT","EXPORT"]}},"additionalProperties":false},{"type":"null"}]},"address1":{"type":["string","null"]},"address2":{"type":["string","null"]},"zipCode":{"type":["string","null"]},"city":{"type":["string","null"]},"state":{"type":["string","null"]},"countryCode":{"anyOf":[{"type":"string","enum":["AFG","ALA","ALB","DZA","ASM","AND","AGO","AIA","ATA","ATG","ARG","ARM","ABW","AUS","AUT","AZE","BHS","BHR","BGD","BRB","BLR","BEL","BLZ","BEN","BMU","BTN","BOL","BES","BIH","BWA","BVT","BRA","IOT","VGB","BRN","BGR","BFA","BDI","KHM","CMR","CAN","CPV","CYM","CAF","TCD","CHL","CHN","CXR","CCK","COL","COM","COG","COD","COK","CRI","CIV","HRV","CUB","CUW","CYP","CZE","DNK","DJI","DMA","DOM","ECU","EGY","SLV","GNQ","ERI","EST","SWZ","ETH","FLK","FRO","FJI","FIN","FRA","GUF","PYF","ATF","GAB","GMB","GEO","DEU","GHA","GIB","GRC","GRL","GRD","GLP","GUM","GTM","GGY","GIN","GNB","GUY","HTI","HMD","HND","HKG","HUN","ISL","IND","IDN","IRN","IRQ","IRL","IMN","ISR","ITA","JAM","JPN","JEY","JOR","KAZ","KEN","KIR","PRK","KOR","KWT","KGZ","LAO","LVA","LBN","LSO","LBR","LBY","LIE","LTU","LUX","MAC","MKD","MDG","MWI","MYS","MDV","MLI","MLT","MHL","MTQ","MRT","MUS","MYT","MEX","FSM","MDA","MCO","MNG","MNE","MSR","MAR","MOZ","MMR","NAM","NRU","NPL","NLD","NCL","NZL","NIC","NER","NGA","NIU","NFK","MNP","NOR","OMN","PAK","PLW","PSE","PAN","PNG","PRY","PER","PHL","PCN","POL","PRT","PRI","QAT","REU","ROU","RUS","RWA","BLM","SHN","KNA","LCA","MAF","SPM","VCT","WSM","SMR","STP","SAU","SEN","SRB","SYC","SLE","SGP","SXM","SVK","SVN","SLB","SOM","ZAF","SGS","SSD","ESP","LKA","SDN","SUR","SJM","SWE","CHE","SYR","TWN","TJK","TZA","THA","TLS","TGO","TKL","TON","TTO","TUN","TUR","TKM","TCA","TUV","UGA","UKR","ARE","GBR","USA","UMI","VIR","URY","UZB","VUT","VAT","VEN","VNM","WLF","ESH","YEM","ZMB","ZWE","ZZZ"]},{"type":"null"}]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"financeEmail":{"type":["string","null"]},"contact":{"type":["string","null"]},"contactEmail":{"type":["string","null"]}},"required":["legalName"],"additionalProperties":false},"answers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"termsVersion":{"type":["string","null"]},"termsAcceptedAt":{"type":["string","null"]},"provisioned":{"type":"object","properties":{"attachToCustomerId":{"type":"string"},"customerId":{"type":"string"},"applicationId":{"type":"string"},"appSlugId":{"type":"string"},"apiKeyId":{"type":"string"},"connectionId":{"type":"string"},"becameDefaultRoute":{"type":"boolean"},"steps":{"default":[],"type":"array","items":{"type":"object","properties":{"step":{"type":"string"},"ok":{"type":"boolean"},"detail":{"type":"string"},"at":{"type":"string"}},"required":["step","ok","at"],"additionalProperties":false}}},"required":["steps"],"additionalProperties":false},"possibleDuplicates":{"type":"array","items":{"type":"object","properties":{"customerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"legalName":{"type":"string"},"regNo":{"type":["string","null"]},"vatNo":{"type":["string","null"]},"matchedOn":{"type":"array","items":{"type":"string","enum":["regNo","vatNo","legalName"]}}},"required":["customerId","legalName","matchedOn"],"additionalProperties":false}},"existingCustomerId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"decidedBy":{"type":["string","null"]},"decidedAt":{"type":["string","null"]},"decisionNote":{"type":["string","null"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["STATUS","MESSAGE","PROVISIONING_STEP"]},"side":{"type":"string","enum":["applicant","provider","system"]},"actorName":{"type":["string","null"]},"status":{"anyOf":[{"type":"string","enum":["SUBMITTED","IN_REVIEW","INFO_REQUESTED","APPROVED","PROVISIONING","PROVISIONING_FAILED","AWAITING_ACTIVATION","AWAITING_CLAIM","WAITING_FOR_PLATFORM","ACTIVE","SUSPENDED","REJECTED","WITHDRAWN","TERMINATED","DISCONNECTED"]},{"type":"null"}]},"message":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","kind","side","createdAt"],"additionalProperties":false}},"submittedAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","status","offeringId","offeringName","accountName","applicantName","snapshot","answers","provisioned","possibleDuplicates","events","submittedAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/account-applications/{id}/suspend":{"post":{"summary":"Stop the link carrying traffic, keeping its credentials","tags":["accountApplications"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":1}},"required":["reason"]}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["SUBMITTED","IN_REVIEW","INFO_REQUESTED","APPROVED","PROVISIONING","PROVISIONING_FAILED","AWAITING_ACTIVATION","AWAITING_CLAIM","WAITING_FOR_PLATFORM","ACTIVE","SUSPENDED","REJECTED","WITHDRAWN","TERMINATED","DISCONNECTED"]},"offeringId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"offeringName":{"type":"string"},"accountName":{"type":"string"},"applicantName":{"type":"string"},"applicantOrigin":{"type":["string","null"]},"snapshot":{"type":"object","properties":{"legalName":{"type":"string","minLength":1},"name":{"type":["string","null"]},"url":{"type":["string","null"]},"regNo":{"type":["string","null"]},"vat":{"anyOf":[{"type":"object","properties":{"number":{"description":"VAT number","type":"string"},"type":{"description":"VAT type","type":"string","enum":["SEVAT","SEREVERSEDVAT","EUREVERSEDVAT","EUVAT","EXPORT"]}},"additionalProperties":false},{"type":"null"}]},"address1":{"type":["string","null"]},"address2":{"type":["string","null"]},"zipCode":{"type":["string","null"]},"city":{"type":["string","null"]},"state":{"type":["string","null"]},"countryCode":{"anyOf":[{"type":"string","enum":["AFG","ALA","ALB","DZA","ASM","AND","AGO","AIA","ATA","ATG","ARG","ARM","ABW","AUS","AUT","AZE","BHS","BHR","BGD","BRB","BLR","BEL","BLZ","BEN","BMU","BTN","BOL","BES","BIH","BWA","BVT","BRA","IOT","VGB","BRN","BGR","BFA","BDI","KHM","CMR","CAN","CPV","CYM","CAF","TCD","CHL","CHN","CXR","CCK","COL","COM","COG","COD","COK","CRI","CIV","HRV","CUB","CUW","CYP","CZE","DNK","DJI","DMA","DOM","ECU","EGY","SLV","GNQ","ERI","EST","SWZ","ETH","FLK","FRO","FJI","FIN","FRA","GUF","PYF","ATF","GAB","GMB","GEO","DEU","GHA","GIB","GRC","GRL","GRD","GLP","GUM","GTM","GGY","GIN","GNB","GUY","HTI","HMD","HND","HKG","HUN","ISL","IND","IDN","IRN","IRQ","IRL","IMN","ISR","ITA","JAM","JPN","JEY","JOR","KAZ","KEN","KIR","PRK","KOR","KWT","KGZ","LAO","LVA","LBN","LSO","LBR","LBY","LIE","LTU","LUX","MAC","MKD","MDG","MWI","MYS","MDV","MLI","MLT","MHL","MTQ","MRT","MUS","MYT","MEX","FSM","MDA","MCO","MNG","MNE","MSR","MAR","MOZ","MMR","NAM","NRU","NPL","NLD","NCL","NZL","NIC","NER","NGA","NIU","NFK","MNP","NOR","OMN","PAK","PLW","PSE","PAN","PNG","PRY","PER","PHL","PCN","POL","PRT","PRI","QAT","REU","ROU","RUS","RWA","BLM","SHN","KNA","LCA","MAF","SPM","VCT","WSM","SMR","STP","SAU","SEN","SRB","SYC","SLE","SGP","SXM","SVK","SVN","SLB","SOM","ZAF","SGS","SSD","ESP","LKA","SDN","SUR","SJM","SWE","CHE","SYR","TWN","TJK","TZA","THA","TLS","TGO","TKL","TON","TTO","TUN","TUR","TKM","TCA","TUV","UGA","UKR","ARE","GBR","USA","UMI","VIR","URY","UZB","VUT","VAT","VEN","VNM","WLF","ESH","YEM","ZMB","ZWE","ZZZ"]},{"type":"null"}]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"financeEmail":{"type":["string","null"]},"contact":{"type":["string","null"]},"contactEmail":{"type":["string","null"]}},"required":["legalName"],"additionalProperties":false},"answers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"termsVersion":{"type":["string","null"]},"termsAcceptedAt":{"type":["string","null"]},"provisioned":{"type":"object","properties":{"attachToCustomerId":{"type":"string"},"customerId":{"type":"string"},"applicationId":{"type":"string"},"appSlugId":{"type":"string"},"apiKeyId":{"type":"string"},"connectionId":{"type":"string"},"becameDefaultRoute":{"type":"boolean"},"steps":{"default":[],"type":"array","items":{"type":"object","properties":{"step":{"type":"string"},"ok":{"type":"boolean"},"detail":{"type":"string"},"at":{"type":"string"}},"required":["step","ok","at"],"additionalProperties":false}}},"required":["steps"],"additionalProperties":false},"possibleDuplicates":{"type":"array","items":{"type":"object","properties":{"customerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"legalName":{"type":"string"},"regNo":{"type":["string","null"]},"vatNo":{"type":["string","null"]},"matchedOn":{"type":"array","items":{"type":"string","enum":["regNo","vatNo","legalName"]}}},"required":["customerId","legalName","matchedOn"],"additionalProperties":false}},"existingCustomerId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"decidedBy":{"type":["string","null"]},"decidedAt":{"type":["string","null"]},"decisionNote":{"type":["string","null"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["STATUS","MESSAGE","PROVISIONING_STEP"]},"side":{"type":"string","enum":["applicant","provider","system"]},"actorName":{"type":["string","null"]},"status":{"anyOf":[{"type":"string","enum":["SUBMITTED","IN_REVIEW","INFO_REQUESTED","APPROVED","PROVISIONING","PROVISIONING_FAILED","AWAITING_ACTIVATION","AWAITING_CLAIM","WAITING_FOR_PLATFORM","ACTIVE","SUSPENDED","REJECTED","WITHDRAWN","TERMINATED","DISCONNECTED"]},{"type":"null"}]},"message":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","kind","side","createdAt"],"additionalProperties":false}},"submittedAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","status","offeringId","offeringName","accountName","applicantName","snapshot","answers","provisioned","possibleDuplicates","events","submittedAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/account-applications/{id}/resume":{"post":{"summary":"Undo a suspension","tags":["accountApplications"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["SUBMITTED","IN_REVIEW","INFO_REQUESTED","APPROVED","PROVISIONING","PROVISIONING_FAILED","AWAITING_ACTIVATION","AWAITING_CLAIM","WAITING_FOR_PLATFORM","ACTIVE","SUSPENDED","REJECTED","WITHDRAWN","TERMINATED","DISCONNECTED"]},"offeringId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"offeringName":{"type":"string"},"accountName":{"type":"string"},"applicantName":{"type":"string"},"applicantOrigin":{"type":["string","null"]},"snapshot":{"type":"object","properties":{"legalName":{"type":"string","minLength":1},"name":{"type":["string","null"]},"url":{"type":["string","null"]},"regNo":{"type":["string","null"]},"vat":{"anyOf":[{"type":"object","properties":{"number":{"description":"VAT number","type":"string"},"type":{"description":"VAT type","type":"string","enum":["SEVAT","SEREVERSEDVAT","EUREVERSEDVAT","EUVAT","EXPORT"]}},"additionalProperties":false},{"type":"null"}]},"address1":{"type":["string","null"]},"address2":{"type":["string","null"]},"zipCode":{"type":["string","null"]},"city":{"type":["string","null"]},"state":{"type":["string","null"]},"countryCode":{"anyOf":[{"type":"string","enum":["AFG","ALA","ALB","DZA","ASM","AND","AGO","AIA","ATA","ATG","ARG","ARM","ABW","AUS","AUT","AZE","BHS","BHR","BGD","BRB","BLR","BEL","BLZ","BEN","BMU","BTN","BOL","BES","BIH","BWA","BVT","BRA","IOT","VGB","BRN","BGR","BFA","BDI","KHM","CMR","CAN","CPV","CYM","CAF","TCD","CHL","CHN","CXR","CCK","COL","COM","COG","COD","COK","CRI","CIV","HRV","CUB","CUW","CYP","CZE","DNK","DJI","DMA","DOM","ECU","EGY","SLV","GNQ","ERI","EST","SWZ","ETH","FLK","FRO","FJI","FIN","FRA","GUF","PYF","ATF","GAB","GMB","GEO","DEU","GHA","GIB","GRC","GRL","GRD","GLP","GUM","GTM","GGY","GIN","GNB","GUY","HTI","HMD","HND","HKG","HUN","ISL","IND","IDN","IRN","IRQ","IRL","IMN","ISR","ITA","JAM","JPN","JEY","JOR","KAZ","KEN","KIR","PRK","KOR","KWT","KGZ","LAO","LVA","LBN","LSO","LBR","LBY","LIE","LTU","LUX","MAC","MKD","MDG","MWI","MYS","MDV","MLI","MLT","MHL","MTQ","MRT","MUS","MYT","MEX","FSM","MDA","MCO","MNG","MNE","MSR","MAR","MOZ","MMR","NAM","NRU","NPL","NLD","NCL","NZL","NIC","NER","NGA","NIU","NFK","MNP","NOR","OMN","PAK","PLW","PSE","PAN","PNG","PRY","PER","PHL","PCN","POL","PRT","PRI","QAT","REU","ROU","RUS","RWA","BLM","SHN","KNA","LCA","MAF","SPM","VCT","WSM","SMR","STP","SAU","SEN","SRB","SYC","SLE","SGP","SXM","SVK","SVN","SLB","SOM","ZAF","SGS","SSD","ESP","LKA","SDN","SUR","SJM","SWE","CHE","SYR","TWN","TJK","TZA","THA","TLS","TGO","TKL","TON","TTO","TUN","TUR","TKM","TCA","TUV","UGA","UKR","ARE","GBR","USA","UMI","VIR","URY","UZB","VUT","VAT","VEN","VNM","WLF","ESH","YEM","ZMB","ZWE","ZZZ"]},{"type":"null"}]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"financeEmail":{"type":["string","null"]},"contact":{"type":["string","null"]},"contactEmail":{"type":["string","null"]}},"required":["legalName"],"additionalProperties":false},"answers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"termsVersion":{"type":["string","null"]},"termsAcceptedAt":{"type":["string","null"]},"provisioned":{"type":"object","properties":{"attachToCustomerId":{"type":"string"},"customerId":{"type":"string"},"applicationId":{"type":"string"},"appSlugId":{"type":"string"},"apiKeyId":{"type":"string"},"connectionId":{"type":"string"},"becameDefaultRoute":{"type":"boolean"},"steps":{"default":[],"type":"array","items":{"type":"object","properties":{"step":{"type":"string"},"ok":{"type":"boolean"},"detail":{"type":"string"},"at":{"type":"string"}},"required":["step","ok","at"],"additionalProperties":false}}},"required":["steps"],"additionalProperties":false},"possibleDuplicates":{"type":"array","items":{"type":"object","properties":{"customerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"legalName":{"type":"string"},"regNo":{"type":["string","null"]},"vatNo":{"type":["string","null"]},"matchedOn":{"type":"array","items":{"type":"string","enum":["regNo","vatNo","legalName"]}}},"required":["customerId","legalName","matchedOn"],"additionalProperties":false}},"existingCustomerId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"decidedBy":{"type":["string","null"]},"decidedAt":{"type":["string","null"]},"decisionNote":{"type":["string","null"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["STATUS","MESSAGE","PROVISIONING_STEP"]},"side":{"type":"string","enum":["applicant","provider","system"]},"actorName":{"type":["string","null"]},"status":{"anyOf":[{"type":"string","enum":["SUBMITTED","IN_REVIEW","INFO_REQUESTED","APPROVED","PROVISIONING","PROVISIONING_FAILED","AWAITING_ACTIVATION","AWAITING_CLAIM","WAITING_FOR_PLATFORM","ACTIVE","SUSPENDED","REJECTED","WITHDRAWN","TERMINATED","DISCONNECTED"]},{"type":"null"}]},"message":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","kind","side","createdAt"],"additionalProperties":false}},"submittedAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","status","offeringId","offeringName","accountName","applicantName","snapshot","answers","provisioned","possibleDuplicates","events","submittedAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/account-applications/{id}/terminate":{"post":{"summary":"End the link and revoke its credentials","tags":["accountApplications"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string"},"force":{"type":"boolean"}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["SUBMITTED","IN_REVIEW","INFO_REQUESTED","APPROVED","PROVISIONING","PROVISIONING_FAILED","AWAITING_ACTIVATION","AWAITING_CLAIM","WAITING_FOR_PLATFORM","ACTIVE","SUSPENDED","REJECTED","WITHDRAWN","TERMINATED","DISCONNECTED"]},"offeringId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"offeringName":{"type":"string"},"accountName":{"type":"string"},"applicantName":{"type":"string"},"applicantOrigin":{"type":["string","null"]},"snapshot":{"type":"object","properties":{"legalName":{"type":"string","minLength":1},"name":{"type":["string","null"]},"url":{"type":["string","null"]},"regNo":{"type":["string","null"]},"vat":{"anyOf":[{"type":"object","properties":{"number":{"description":"VAT number","type":"string"},"type":{"description":"VAT type","type":"string","enum":["SEVAT","SEREVERSEDVAT","EUREVERSEDVAT","EUVAT","EXPORT"]}},"additionalProperties":false},{"type":"null"}]},"address1":{"type":["string","null"]},"address2":{"type":["string","null"]},"zipCode":{"type":["string","null"]},"city":{"type":["string","null"]},"state":{"type":["string","null"]},"countryCode":{"anyOf":[{"type":"string","enum":["AFG","ALA","ALB","DZA","ASM","AND","AGO","AIA","ATA","ATG","ARG","ARM","ABW","AUS","AUT","AZE","BHS","BHR","BGD","BRB","BLR","BEL","BLZ","BEN","BMU","BTN","BOL","BES","BIH","BWA","BVT","BRA","IOT","VGB","BRN","BGR","BFA","BDI","KHM","CMR","CAN","CPV","CYM","CAF","TCD","CHL","CHN","CXR","CCK","COL","COM","COG","COD","COK","CRI","CIV","HRV","CUB","CUW","CYP","CZE","DNK","DJI","DMA","DOM","ECU","EGY","SLV","GNQ","ERI","EST","SWZ","ETH","FLK","FRO","FJI","FIN","FRA","GUF","PYF","ATF","GAB","GMB","GEO","DEU","GHA","GIB","GRC","GRL","GRD","GLP","GUM","GTM","GGY","GIN","GNB","GUY","HTI","HMD","HND","HKG","HUN","ISL","IND","IDN","IRN","IRQ","IRL","IMN","ISR","ITA","JAM","JPN","JEY","JOR","KAZ","KEN","KIR","PRK","KOR","KWT","KGZ","LAO","LVA","LBN","LSO","LBR","LBY","LIE","LTU","LUX","MAC","MKD","MDG","MWI","MYS","MDV","MLI","MLT","MHL","MTQ","MRT","MUS","MYT","MEX","FSM","MDA","MCO","MNG","MNE","MSR","MAR","MOZ","MMR","NAM","NRU","NPL","NLD","NCL","NZL","NIC","NER","NGA","NIU","NFK","MNP","NOR","OMN","PAK","PLW","PSE","PAN","PNG","PRY","PER","PHL","PCN","POL","PRT","PRI","QAT","REU","ROU","RUS","RWA","BLM","SHN","KNA","LCA","MAF","SPM","VCT","WSM","SMR","STP","SAU","SEN","SRB","SYC","SLE","SGP","SXM","SVK","SVN","SLB","SOM","ZAF","SGS","SSD","ESP","LKA","SDN","SUR","SJM","SWE","CHE","SYR","TWN","TJK","TZA","THA","TLS","TGO","TKL","TON","TTO","TUN","TUR","TKM","TCA","TUV","UGA","UKR","ARE","GBR","USA","UMI","VIR","URY","UZB","VUT","VAT","VEN","VNM","WLF","ESH","YEM","ZMB","ZWE","ZZZ"]},{"type":"null"}]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"financeEmail":{"type":["string","null"]},"contact":{"type":["string","null"]},"contactEmail":{"type":["string","null"]}},"required":["legalName"],"additionalProperties":false},"answers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"termsVersion":{"type":["string","null"]},"termsAcceptedAt":{"type":["string","null"]},"provisioned":{"type":"object","properties":{"attachToCustomerId":{"type":"string"},"customerId":{"type":"string"},"applicationId":{"type":"string"},"appSlugId":{"type":"string"},"apiKeyId":{"type":"string"},"connectionId":{"type":"string"},"becameDefaultRoute":{"type":"boolean"},"steps":{"default":[],"type":"array","items":{"type":"object","properties":{"step":{"type":"string"},"ok":{"type":"boolean"},"detail":{"type":"string"},"at":{"type":"string"}},"required":["step","ok","at"],"additionalProperties":false}}},"required":["steps"],"additionalProperties":false},"possibleDuplicates":{"type":"array","items":{"type":"object","properties":{"customerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"legalName":{"type":"string"},"regNo":{"type":["string","null"]},"vatNo":{"type":["string","null"]},"matchedOn":{"type":"array","items":{"type":"string","enum":["regNo","vatNo","legalName"]}}},"required":["customerId","legalName","matchedOn"],"additionalProperties":false}},"existingCustomerId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"decidedBy":{"type":["string","null"]},"decidedAt":{"type":["string","null"]},"decisionNote":{"type":["string","null"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["STATUS","MESSAGE","PROVISIONING_STEP"]},"side":{"type":"string","enum":["applicant","provider","system"]},"actorName":{"type":["string","null"]},"status":{"anyOf":[{"type":"string","enum":["SUBMITTED","IN_REVIEW","INFO_REQUESTED","APPROVED","PROVISIONING","PROVISIONING_FAILED","AWAITING_ACTIVATION","AWAITING_CLAIM","WAITING_FOR_PLATFORM","ACTIVE","SUSPENDED","REJECTED","WITHDRAWN","TERMINATED","DISCONNECTED"]},{"type":"null"}]},"message":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","kind","side","createdAt"],"additionalProperties":false}},"submittedAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","status","offeringId","offeringName","accountName","applicantName","snapshot","answers","provisioned","possibleDuplicates","events","submittedAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"409":{"description":"409","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"openTransactions":{"type":"number"},"recentTransactions":{"type":"number"}},"required":["message","openTransactions","recentTransactions"],"additionalProperties":false}}}}}}},"/api/v1/account-applications/{id}/messages":{"post":{"summary":"Write to the applicant","tags":["accountApplications"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","minLength":1,"maxLength":5000}},"required":["message"]}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["SUBMITTED","IN_REVIEW","INFO_REQUESTED","APPROVED","PROVISIONING","PROVISIONING_FAILED","AWAITING_ACTIVATION","AWAITING_CLAIM","WAITING_FOR_PLATFORM","ACTIVE","SUSPENDED","REJECTED","WITHDRAWN","TERMINATED","DISCONNECTED"]},"offeringId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"offeringName":{"type":"string"},"accountName":{"type":"string"},"applicantName":{"type":"string"},"applicantOrigin":{"type":["string","null"]},"snapshot":{"type":"object","properties":{"legalName":{"type":"string","minLength":1},"name":{"type":["string","null"]},"url":{"type":["string","null"]},"regNo":{"type":["string","null"]},"vat":{"anyOf":[{"type":"object","properties":{"number":{"description":"VAT number","type":"string"},"type":{"description":"VAT type","type":"string","enum":["SEVAT","SEREVERSEDVAT","EUREVERSEDVAT","EUVAT","EXPORT"]}},"additionalProperties":false},{"type":"null"}]},"address1":{"type":["string","null"]},"address2":{"type":["string","null"]},"zipCode":{"type":["string","null"]},"city":{"type":["string","null"]},"state":{"type":["string","null"]},"countryCode":{"anyOf":[{"type":"string","enum":["AFG","ALA","ALB","DZA","ASM","AND","AGO","AIA","ATA","ATG","ARG","ARM","ABW","AUS","AUT","AZE","BHS","BHR","BGD","BRB","BLR","BEL","BLZ","BEN","BMU","BTN","BOL","BES","BIH","BWA","BVT","BRA","IOT","VGB","BRN","BGR","BFA","BDI","KHM","CMR","CAN","CPV","CYM","CAF","TCD","CHL","CHN","CXR","CCK","COL","COM","COG","COD","COK","CRI","CIV","HRV","CUB","CUW","CYP","CZE","DNK","DJI","DMA","DOM","ECU","EGY","SLV","GNQ","ERI","EST","SWZ","ETH","FLK","FRO","FJI","FIN","FRA","GUF","PYF","ATF","GAB","GMB","GEO","DEU","GHA","GIB","GRC","GRL","GRD","GLP","GUM","GTM","GGY","GIN","GNB","GUY","HTI","HMD","HND","HKG","HUN","ISL","IND","IDN","IRN","IRQ","IRL","IMN","ISR","ITA","JAM","JPN","JEY","JOR","KAZ","KEN","KIR","PRK","KOR","KWT","KGZ","LAO","LVA","LBN","LSO","LBR","LBY","LIE","LTU","LUX","MAC","MKD","MDG","MWI","MYS","MDV","MLI","MLT","MHL","MTQ","MRT","MUS","MYT","MEX","FSM","MDA","MCO","MNG","MNE","MSR","MAR","MOZ","MMR","NAM","NRU","NPL","NLD","NCL","NZL","NIC","NER","NGA","NIU","NFK","MNP","NOR","OMN","PAK","PLW","PSE","PAN","PNG","PRY","PER","PHL","PCN","POL","PRT","PRI","QAT","REU","ROU","RUS","RWA","BLM","SHN","KNA","LCA","MAF","SPM","VCT","WSM","SMR","STP","SAU","SEN","SRB","SYC","SLE","SGP","SXM","SVK","SVN","SLB","SOM","ZAF","SGS","SSD","ESP","LKA","SDN","SUR","SJM","SWE","CHE","SYR","TWN","TJK","TZA","THA","TLS","TGO","TKL","TON","TTO","TUN","TUR","TKM","TCA","TUV","UGA","UKR","ARE","GBR","USA","UMI","VIR","URY","UZB","VUT","VAT","VEN","VNM","WLF","ESH","YEM","ZMB","ZWE","ZZZ"]},{"type":"null"}]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"financeEmail":{"type":["string","null"]},"contact":{"type":["string","null"]},"contactEmail":{"type":["string","null"]}},"required":["legalName"],"additionalProperties":false},"answers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"termsVersion":{"type":["string","null"]},"termsAcceptedAt":{"type":["string","null"]},"provisioned":{"type":"object","properties":{"attachToCustomerId":{"type":"string"},"customerId":{"type":"string"},"applicationId":{"type":"string"},"appSlugId":{"type":"string"},"apiKeyId":{"type":"string"},"connectionId":{"type":"string"},"becameDefaultRoute":{"type":"boolean"},"steps":{"default":[],"type":"array","items":{"type":"object","properties":{"step":{"type":"string"},"ok":{"type":"boolean"},"detail":{"type":"string"},"at":{"type":"string"}},"required":["step","ok","at"],"additionalProperties":false}}},"required":["steps"],"additionalProperties":false},"possibleDuplicates":{"type":"array","items":{"type":"object","properties":{"customerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"legalName":{"type":"string"},"regNo":{"type":["string","null"]},"vatNo":{"type":["string","null"]},"matchedOn":{"type":"array","items":{"type":"string","enum":["regNo","vatNo","legalName"]}}},"required":["customerId","legalName","matchedOn"],"additionalProperties":false}},"existingCustomerId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"decidedBy":{"type":["string","null"]},"decidedAt":{"type":["string","null"]},"decisionNote":{"type":["string","null"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["STATUS","MESSAGE","PROVISIONING_STEP"]},"side":{"type":"string","enum":["applicant","provider","system"]},"actorName":{"type":["string","null"]},"status":{"anyOf":[{"type":"string","enum":["SUBMITTED","IN_REVIEW","INFO_REQUESTED","APPROVED","PROVISIONING","PROVISIONING_FAILED","AWAITING_ACTIVATION","AWAITING_CLAIM","WAITING_FOR_PLATFORM","ACTIVE","SUSPENDED","REJECTED","WITHDRAWN","TERMINATED","DISCONNECTED"]},{"type":"null"}]},"message":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","kind","side","createdAt"],"additionalProperties":false}},"submittedAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","status","offeringId","offeringName","accountName","applicantName","snapshot","answers","provisioned","possibleDuplicates","events","submittedAt","updatedAt"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/account-applications/{id}/rotate":{"post":{"summary":"Replace the link's credentials","tags":["accountApplications"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["SUBMITTED","IN_REVIEW","INFO_REQUESTED","APPROVED","PROVISIONING","PROVISIONING_FAILED","AWAITING_ACTIVATION","AWAITING_CLAIM","WAITING_FOR_PLATFORM","ACTIVE","SUSPENDED","REJECTED","WITHDRAWN","TERMINATED","DISCONNECTED"]},"offeringId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"offeringName":{"type":"string"},"accountName":{"type":"string"},"applicantName":{"type":"string"},"applicantOrigin":{"type":["string","null"]},"snapshot":{"type":"object","properties":{"legalName":{"type":"string","minLength":1},"name":{"type":["string","null"]},"url":{"type":["string","null"]},"regNo":{"type":["string","null"]},"vat":{"anyOf":[{"type":"object","properties":{"number":{"description":"VAT number","type":"string"},"type":{"description":"VAT type","type":"string","enum":["SEVAT","SEREVERSEDVAT","EUREVERSEDVAT","EUVAT","EXPORT"]}},"additionalProperties":false},{"type":"null"}]},"address1":{"type":["string","null"]},"address2":{"type":["string","null"]},"zipCode":{"type":["string","null"]},"city":{"type":["string","null"]},"state":{"type":["string","null"]},"countryCode":{"anyOf":[{"type":"string","enum":["AFG","ALA","ALB","DZA","ASM","AND","AGO","AIA","ATA","ATG","ARG","ARM","ABW","AUS","AUT","AZE","BHS","BHR","BGD","BRB","BLR","BEL","BLZ","BEN","BMU","BTN","BOL","BES","BIH","BWA","BVT","BRA","IOT","VGB","BRN","BGR","BFA","BDI","KHM","CMR","CAN","CPV","CYM","CAF","TCD","CHL","CHN","CXR","CCK","COL","COM","COG","COD","COK","CRI","CIV","HRV","CUB","CUW","CYP","CZE","DNK","DJI","DMA","DOM","ECU","EGY","SLV","GNQ","ERI","EST","SWZ","ETH","FLK","FRO","FJI","FIN","FRA","GUF","PYF","ATF","GAB","GMB","GEO","DEU","GHA","GIB","GRC","GRL","GRD","GLP","GUM","GTM","GGY","GIN","GNB","GUY","HTI","HMD","HND","HKG","HUN","ISL","IND","IDN","IRN","IRQ","IRL","IMN","ISR","ITA","JAM","JPN","JEY","JOR","KAZ","KEN","KIR","PRK","KOR","KWT","KGZ","LAO","LVA","LBN","LSO","LBR","LBY","LIE","LTU","LUX","MAC","MKD","MDG","MWI","MYS","MDV","MLI","MLT","MHL","MTQ","MRT","MUS","MYT","MEX","FSM","MDA","MCO","MNG","MNE","MSR","MAR","MOZ","MMR","NAM","NRU","NPL","NLD","NCL","NZL","NIC","NER","NGA","NIU","NFK","MNP","NOR","OMN","PAK","PLW","PSE","PAN","PNG","PRY","PER","PHL","PCN","POL","PRT","PRI","QAT","REU","ROU","RUS","RWA","BLM","SHN","KNA","LCA","MAF","SPM","VCT","WSM","SMR","STP","SAU","SEN","SRB","SYC","SLE","SGP","SXM","SVK","SVN","SLB","SOM","ZAF","SGS","SSD","ESP","LKA","SDN","SUR","SJM","SWE","CHE","SYR","TWN","TJK","TZA","THA","TLS","TGO","TKL","TON","TTO","TUN","TUR","TKM","TCA","TUV","UGA","UKR","ARE","GBR","USA","UMI","VIR","URY","UZB","VUT","VAT","VEN","VNM","WLF","ESH","YEM","ZMB","ZWE","ZZZ"]},{"type":"null"}]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"financeEmail":{"type":["string","null"]},"contact":{"type":["string","null"]},"contactEmail":{"type":["string","null"]}},"required":["legalName"],"additionalProperties":false},"answers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"termsVersion":{"type":["string","null"]},"termsAcceptedAt":{"type":["string","null"]},"provisioned":{"type":"object","properties":{"attachToCustomerId":{"type":"string"},"customerId":{"type":"string"},"applicationId":{"type":"string"},"appSlugId":{"type":"string"},"apiKeyId":{"type":"string"},"connectionId":{"type":"string"},"becameDefaultRoute":{"type":"boolean"},"steps":{"default":[],"type":"array","items":{"type":"object","properties":{"step":{"type":"string"},"ok":{"type":"boolean"},"detail":{"type":"string"},"at":{"type":"string"}},"required":["step","ok","at"],"additionalProperties":false}}},"required":["steps"],"additionalProperties":false},"possibleDuplicates":{"type":"array","items":{"type":"object","properties":{"customerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"legalName":{"type":"string"},"regNo":{"type":["string","null"]},"vatNo":{"type":["string","null"]},"matchedOn":{"type":"array","items":{"type":"string","enum":["regNo","vatNo","legalName"]}}},"required":["customerId","legalName","matchedOn"],"additionalProperties":false}},"existingCustomerId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"decidedBy":{"type":["string","null"]},"decidedAt":{"type":["string","null"]},"decisionNote":{"type":["string","null"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["STATUS","MESSAGE","PROVISIONING_STEP"]},"side":{"type":"string","enum":["applicant","provider","system"]},"actorName":{"type":["string","null"]},"status":{"anyOf":[{"type":"string","enum":["SUBMITTED","IN_REVIEW","INFO_REQUESTED","APPROVED","PROVISIONING","PROVISIONING_FAILED","AWAITING_ACTIVATION","AWAITING_CLAIM","WAITING_FOR_PLATFORM","ACTIVE","SUSPENDED","REJECTED","WITHDRAWN","TERMINATED","DISCONNECTED"]},{"type":"null"}]},"message":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","kind","side","createdAt"],"additionalProperties":false}},"submittedAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","status","offeringId","offeringName","accountName","applicantName","snapshot","answers","provisioned","possibleDuplicates","events","submittedAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/settings/groups":{"get":{"summary":"Get all registered settings group definitions","tags":["settings"],"parameters":[{"name":"contextType","in":"query","schema":{"type":"string","enum":["organization","partner","customer","application"]}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"group":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"},"icon":{"type":"string"},"contexts":{"type":"array","items":{"type":"string","enum":["organization","partner","customer","application"]}},"multiple":{"type":"boolean"},"jsonSchema":{}},"required":["group","label","description","contexts","jsonSchema"],"additionalProperties":false}}}}}}}},"/api/v1/settings/{group}":{"get":{"summary":"Get settings for a group in a context","tags":["settings"],"parameters":[{"name":"group","in":"path","required":true,"schema":{"type":"string"}},{"name":"contextType","in":"query","required":true,"schema":{"type":"string","enum":["organization","partner","customer","application"]}},{"name":"contextId","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"group":{"type":"string"},"contextType":{"type":"string","enum":["organization","partner","customer","application"]},"contextId":{"type":"string"},"data":{},"updatedAt":{"type":"string"}},"required":["group","contextType","contextId","data"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}},"put":{"summary":"Update settings for a group in a context","tags":["settings"],"parameters":[{"name":"group","in":"path","required":true,"schema":{"type":"string"}},{"name":"contextType","in":"query","required":true,"schema":{"type":"string","enum":["organization","partner","customer","application"]}},{"name":"contextId","in":"query","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}},"required":["data"]}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"group":{"type":"string"},"contextType":{"type":"string","enum":["organization","partner","customer","application"]},"contextId":{"type":"string"},"data":{},"updatedAt":{"type":"string"}},"required":["group","contextType","contextId","data"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}},"delete":{"summary":"Delete (reset) settings for a group in a context","tags":["settings"],"parameters":[{"name":"group","in":"path","required":true,"schema":{"type":"string"}},{"name":"contextType","in":"query","required":true,"schema":{"type":"string","enum":["organization","partner","customer","application"]}},{"name":"contextId","in":"query","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/notifications/inbox":{"get":{"summary":"Search the caller's notification inbox","tags":["notifications"],"parameters":[{"name":"page","in":"query","schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991}},{"name":"limit","in":"query","schema":{"default":25,"type":"integer","minimum":1,"maximum":200}},{"name":"q","in":"query","schema":{"type":"string"}},{"name":"status","in":"query","schema":{"type":"string","enum":["unread","read","archived"]}},{"name":"allContexts","in":"query","schema":{"type":"boolean"}},{"name":"filters","in":"query","description":"Filters to apply, as `{ field, op, values }` entries","schema":{"type":"array","items":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"field":{"type":"string","enum":["status","severity","category","notificationType","triggerSource"]},"op":{"type":"string","enum":["eq","ne","in","nin","contains","notContains","startsWith","notStartsWith","gt","gte","lt","lte","isEmpty","isNotEmpty"]},"values":{"type":"array"}},"required":["field"],"description":"A single search filter"},"maxItems":25}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"notificationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"notificationType":{"type":"string"},"subjectId":{"type":"string"},"contextType":{"type":"string","enum":["organization","partner","customer"]},"contextId":{"type":"string"},"severity":{"type":"string","enum":["info","warning","critical"]},"category":{"type":"string","enum":["transactional","action_required","operational"]},"status":{"type":"string","enum":["unread","read","archived"]},"muted":{"type":"boolean"},"title":{"type":"string"},"body":{"type":"string"},"actions":{"default":[],"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"labelKey":{"type":"string","minLength":1},"url":{"type":"string","format":"uri"},"style":{"default":"secondary","type":"string","enum":["primary","secondary"]}},"required":["key","labelKey","url","style"],"additionalProperties":false}},"subjectRefType":{"type":["string","null"]},"subjectRefId":{"type":["string","null"]},"triggerSource":{"type":"string","enum":["domain_event","monitor","rule","schedule","manual"]},"triggerRef":{"type":["string","null"]},"actorSubjectId":{"type":["string","null"]},"actor":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":["string","null"]}},"required":["id"],"additionalProperties":false},{"type":"null"}]},"readAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","notificationId","notificationType","subjectId","contextType","contextId","severity","category","status","muted","title","body","actions","triggerSource","createdAt"],"additionalProperties":false}},"page":{"type":"number"},"pageSize":{"type":"number"},"hasMore":{"type":"boolean"}},"required":["items","page","pageSize","hasMore"],"additionalProperties":false}}}}}}},"/api/v1/notifications/inbox/unread-count":{"get":{"summary":"Unread inbox count for the badge","tags":["notifications"],"parameters":[{"name":"allContexts","in":"query","schema":{"type":"boolean"}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"number"},"topSeverity":{"anyOf":[{"type":"string","enum":["info","warning","critical"]},{"type":"null"}]}},"required":["count"],"additionalProperties":false}}}}}}},"/api/v1/notifications/inbox/{id}":{"get":{"summary":"Get one inbox item","tags":["notifications"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"notificationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"notificationType":{"type":"string"},"subjectId":{"type":"string"},"contextType":{"type":"string","enum":["organization","partner","customer"]},"contextId":{"type":"string"},"severity":{"type":"string","enum":["info","warning","critical"]},"category":{"type":"string","enum":["transactional","action_required","operational"]},"status":{"type":"string","enum":["unread","read","archived"]},"muted":{"type":"boolean"},"title":{"type":"string"},"body":{"type":"string"},"actions":{"default":[],"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"labelKey":{"type":"string","minLength":1},"url":{"type":"string","format":"uri"},"style":{"default":"secondary","type":"string","enum":["primary","secondary"]}},"required":["key","labelKey","url","style"],"additionalProperties":false}},"subjectRefType":{"type":["string","null"]},"subjectRefId":{"type":["string","null"]},"triggerSource":{"type":"string","enum":["domain_event","monitor","rule","schedule","manual"]},"triggerRef":{"type":["string","null"]},"actorSubjectId":{"type":["string","null"]},"actor":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":["string","null"]}},"required":["id"],"additionalProperties":false},{"type":"null"}]},"readAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","notificationId","notificationType","subjectId","contextType","contextId","severity","category","status","muted","title","body","actions","triggerSource","createdAt"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/notifications/inbox/{id}/read":{"post":{"summary":"Mark an inbox item read or unread","tags":["notifications"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"read":{"default":true,"type":"boolean"}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"notificationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"notificationType":{"type":"string"},"subjectId":{"type":"string"},"contextType":{"type":"string","enum":["organization","partner","customer"]},"contextId":{"type":"string"},"severity":{"type":"string","enum":["info","warning","critical"]},"category":{"type":"string","enum":["transactional","action_required","operational"]},"status":{"type":"string","enum":["unread","read","archived"]},"muted":{"type":"boolean"},"title":{"type":"string"},"body":{"type":"string"},"actions":{"default":[],"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"labelKey":{"type":"string","minLength":1},"url":{"type":"string","format":"uri"},"style":{"default":"secondary","type":"string","enum":["primary","secondary"]}},"required":["key","labelKey","url","style"],"additionalProperties":false}},"subjectRefType":{"type":["string","null"]},"subjectRefId":{"type":["string","null"]},"triggerSource":{"type":"string","enum":["domain_event","monitor","rule","schedule","manual"]},"triggerRef":{"type":["string","null"]},"actorSubjectId":{"type":["string","null"]},"actor":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":["string","null"]}},"required":["id"],"additionalProperties":false},{"type":"null"}]},"readAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","notificationId","notificationType","subjectId","contextType","contextId","severity","category","status","muted","title","body","actions","triggerSource","createdAt"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/notifications/inbox/{id}/archive":{"post":{"summary":"Archive an inbox item","tags":["notifications"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"notificationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"notificationType":{"type":"string"},"subjectId":{"type":"string"},"contextType":{"type":"string","enum":["organization","partner","customer"]},"contextId":{"type":"string"},"severity":{"type":"string","enum":["info","warning","critical"]},"category":{"type":"string","enum":["transactional","action_required","operational"]},"status":{"type":"string","enum":["unread","read","archived"]},"muted":{"type":"boolean"},"title":{"type":"string"},"body":{"type":"string"},"actions":{"default":[],"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"labelKey":{"type":"string","minLength":1},"url":{"type":"string","format":"uri"},"style":{"default":"secondary","type":"string","enum":["primary","secondary"]}},"required":["key","labelKey","url","style"],"additionalProperties":false}},"subjectRefType":{"type":["string","null"]},"subjectRefId":{"type":["string","null"]},"triggerSource":{"type":"string","enum":["domain_event","monitor","rule","schedule","manual"]},"triggerRef":{"type":["string","null"]},"actorSubjectId":{"type":["string","null"]},"actor":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":["string","null"]}},"required":["id"],"additionalProperties":false},{"type":"null"}]},"readAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","notificationId","notificationType","subjectId","contextType","contextId","severity","category","status","muted","title","body","actions","triggerSource","createdAt"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/notifications/inbox/read-all":{"post":{"summary":"Mark every unread item in scope as read","tags":["notifications"],"parameters":[],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"allContexts":{"type":"boolean"}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"updated":{"type":"number"}},"required":["updated"],"additionalProperties":false}}}}}}},"/api/v1/notifications/types":{"get":{"summary":"The notification catalog with effective activation","tags":["notifications"],"parameters":[],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"group":{"type":"string"},"category":{"type":"string","enum":["transactional","action_required","operational"]},"severity":{"type":"string","enum":["info","warning","critical"]},"audiences":{"type":"array","items":{"type":"string","enum":["organization","partner","customer"]}},"mandatory":{"type":"boolean"},"active":{"type":"boolean"},"audience":{"type":"array","items":{"type":"string"}},"defaultAudience":{"type":"array","items":{"type":"string"}},"audienceInherited":{"type":"boolean"},"inherited":{"type":"boolean"}},"required":["type","name","group","category","severity","audiences","mandatory","active","audience","defaultAudience","audienceInherited","inherited"],"additionalProperties":false}}}}}}}},"/api/v1/notifications/settings":{"get":{"summary":"Activation rows stored on the current context","tags":["notifications"],"parameters":[],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"contextType":{"type":"string","enum":["organization","partner","customer"]},"contextId":{"type":"string"},"notificationType":{"type":"string"},"active":{"type":"boolean"},"audience":{"anyOf":[{"type":"array","items":{"type":"string","minLength":3,"pattern":"^(role|permission|subject|context|contact|email|sms|telegram):\\S(?:.*\\S)?$"}},{"type":"null"}]},"minSeverity":{"anyOf":[{"type":"string","enum":["info","warning","critical"]},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","contextType","contextId","notificationType","active","createdAt","updatedAt"],"additionalProperties":false}}}}}}}},"/api/v1/notifications/settings/{notificationType}":{"put":{"summary":"Activate/deactivate a type or override its audience","tags":["notifications"],"parameters":[{"name":"notificationType","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"active":{"type":"boolean"},"audience":{"anyOf":[{"type":"array","items":{"type":"string","minLength":3,"pattern":"^(role|permission|subject|context|contact|email|sms|telegram):\\S(?:.*\\S)?$"}},{"type":"null"}]},"minSeverity":{"anyOf":[{"type":"string","enum":["info","warning","critical"]},{"type":"null"}]}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"contextType":{"type":"string","enum":["organization","partner","customer"]},"contextId":{"type":"string"},"notificationType":{"type":"string"},"active":{"type":"boolean"},"audience":{"anyOf":[{"type":"array","items":{"type":"string","minLength":3,"pattern":"^(role|permission|subject|context|contact|email|sms|telegram):\\S(?:.*\\S)?$"}},{"type":"null"}]},"minSeverity":{"anyOf":[{"type":"string","enum":["info","warning","critical"]},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","contextType","contextId","notificationType","active","createdAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/notifications/preferences":{"get":{"summary":"The caller's effective preference matrix","tags":["notifications"],"parameters":[],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"notificationType":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"group":{"type":"string"},"category":{"type":"string","enum":["transactional","action_required","operational"]},"severity":{"type":"string","enum":["info","warning","critical"]},"mandatory":{"type":"boolean"},"audiences":{"type":"array","items":{"type":"string","enum":["organization","partner","customer"]}},"channels":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"relay":{"type":"string","enum":["immediate","if_unread_after_15m","digest_hourly","digest_daily","off"]},"inherited":{"type":"boolean"},"available":{"type":"boolean"}},"required":["relay","inherited","available"],"additionalProperties":false}}},"required":["notificationType","name","group","category","severity","mandatory","audiences","channels"],"additionalProperties":false}}}}}}},"put":{"summary":"Set one cell of the caller's preference matrix","tags":["notifications"],"parameters":[],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"notificationType":{"type":"string","minLength":1},"channel":{"type":"string","enum":["inbox","email","webhook","sms","telegram","pagerduty"]},"relay":{"type":"string","enum":["immediate","if_unread_after_15m","digest_hourly","digest_daily","off"]},"contextType":{"anyOf":[{"type":"string","enum":["organization","partner","customer"]},{"type":"null"}]},"contextId":{"type":["string","null"]}},"required":["notificationType","channel","relay"]}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"notificationType":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"group":{"type":"string"},"category":{"type":"string","enum":["transactional","action_required","operational"]},"severity":{"type":"string","enum":["info","warning","critical"]},"mandatory":{"type":"boolean"},"audiences":{"type":"array","items":{"type":"string","enum":["organization","partner","customer"]}},"channels":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"relay":{"type":"string","enum":["immediate","if_unread_after_15m","digest_hourly","digest_daily","off"]},"inherited":{"type":"boolean"},"available":{"type":"boolean"}},"required":["relay","inherited","available"],"additionalProperties":false}}},"required":["notificationType","name","group","category","severity","mandatory","audiences","channels"],"additionalProperties":false}}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/notifications/identities":{"get":{"summary":"The caller's registered channel destinations","tags":["notifications"],"parameters":[],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"channel":{"type":"string","enum":["sms","telegram"]},"address":{"type":"string"},"verified":{"type":"boolean"},"verifiedAt":{"type":["string","null"]},"codeSentAt":{"type":["string","null"]}},"required":["channel","address","verified"],"additionalProperties":false}}}}}}}},"/api/v1/notifications/identities/{channel}":{"put":{"summary":"Register a destination for a channel and send a verification code to it","tags":["notifications"],"parameters":[{"name":"channel","in":"path","required":true,"schema":{"type":"string","enum":["sms","telegram"]}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"address":{"type":"string","pattern":"^\\+[1-9]\\d{7,14}$"}},"required":["address"]}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"channel":{"type":"string","enum":["sms","telegram"]},"address":{"type":"string"},"verified":{"type":"boolean"},"verifiedAt":{"type":["string","null"]},"codeSentAt":{"type":["string","null"]}},"required":["channel","address","verified"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"429":{"description":"429","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}},"delete":{"summary":"Remove a channel destination","tags":["notifications"],"parameters":[{"name":"channel","in":"path","required":true,"schema":{"type":"string","enum":["sms","telegram"]}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean"}},"required":["deleted"],"additionalProperties":false}}}}}}},"/api/v1/notifications/identities/{channel}/verify":{"post":{"summary":"Confirm a destination with the code that was sent to it","tags":["notifications"],"parameters":[{"name":"channel","in":"path","required":true,"schema":{"type":"string","enum":["sms","telegram"]}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","pattern":"^\\d{6}$"}},"required":["code"]}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"channel":{"type":"string","enum":["sms","telegram"]},"address":{"type":"string"},"verified":{"type":"boolean"},"verifiedAt":{"type":["string","null"]},"codeSentAt":{"type":["string","null"]}},"required":["channel","address","verified"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/notifications":{"get":{"summary":"Search notifications raised in this context","tags":["notifications"],"parameters":[{"name":"page","in":"query","schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991}},{"name":"limit","in":"query","schema":{"default":25,"type":"integer","minimum":1,"maximum":200}},{"name":"q","in":"query","schema":{"type":"string"}},{"name":"filters","in":"query","description":"Filters to apply, as `{ field, op, values }` entries","schema":{"type":"array","items":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"field":{"type":"string","enum":["severity","category","notificationType","triggerSource"]},"op":{"type":"string","enum":["eq","ne","in","nin","contains","notContains","startsWith","notStartsWith","gt","gte","lt","lte","isEmpty","isNotEmpty"]},"values":{"type":"array"}},"required":["field"],"description":"A single search filter"},"maxItems":25}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"notificationType":{"type":"string"},"contextType":{"type":"string","enum":["organization","partner","customer"]},"contextId":{"type":"string"},"severity":{"type":"string","enum":["info","warning","critical"]},"category":{"type":"string","enum":["transactional","action_required","operational"]},"subjectRefType":{"type":["string","null"]},"subjectRefId":{"type":["string","null"]},"payload":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"dedupKey":{"type":"string"},"triggerSource":{"type":"string","enum":["domain_event","monitor","rule","schedule","manual"]},"triggerRef":{"type":["string","null"]},"actorSubjectId":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","notificationType","contextType","contextId","severity","category","payload","dedupKey","triggerSource","createdAt"],"additionalProperties":false}},"page":{"type":"number"},"pageSize":{"type":"number"},"hasMore":{"type":"boolean"}},"required":["items","page","pageSize","hasMore"],"additionalProperties":false}}}}}}},"/api/v1/notifications/{id}":{"get":{"summary":"One notification with its delivery records","tags":["notifications"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"notification":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"notificationType":{"type":"string"},"contextType":{"type":"string","enum":["organization","partner","customer"]},"contextId":{"type":"string"},"severity":{"type":"string","enum":["info","warning","critical"]},"category":{"type":"string","enum":["transactional","action_required","operational"]},"subjectRefType":{"type":["string","null"]},"subjectRefId":{"type":["string","null"]},"payload":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"dedupKey":{"type":"string"},"triggerSource":{"type":"string","enum":["domain_event","monitor","rule","schedule","manual"]},"triggerRef":{"type":["string","null"]},"actorSubjectId":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","notificationType","contextType","contextId","severity","category","payload","dedupKey","triggerSource","createdAt"],"additionalProperties":false},"deliveries":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"notificationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"subjectId":{"type":["string","null"]},"channel":{"type":"string","enum":["inbox","email","webhook","sms","telegram","pagerduty"]},"target":{"type":"string"},"recipientRef":{"type":["string","null"]},"status":{"type":"string","enum":["sent","failed","skipped","scheduled","cancelled"]},"providerRef":{"type":["string","null"]},"error":{"type":["string","null"]},"locale":{"type":["string","null"]},"scheduledFor":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","notificationId","channel","target","status","createdAt"],"additionalProperties":false}},"recipients":{"type":"number"}},"required":["notification","deliveries","recipients"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/notifications/test":{"post":{"summary":"Raise a sample notification of a type to check the wiring","tags":["notifications"],"parameters":[],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"notificationType":{"type":"string","minLength":1},"payload":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["notificationType"]}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"notificationId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"inboxItems":{"type":"number"},"deliveries":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"notificationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"subjectId":{"type":["string","null"]},"channel":{"type":"string","enum":["inbox","email","webhook","sms","telegram","pagerduty"]},"target":{"type":"string"},"recipientRef":{"type":["string","null"]},"status":{"type":"string","enum":["sent","failed","skipped","scheduled","cancelled"]},"providerRef":{"type":["string","null"]},"error":{"type":["string","null"]},"locale":{"type":["string","null"]},"scheduledFor":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","notificationId","channel","target","status","createdAt"],"additionalProperties":false}},"skippedReason":{"type":["string","null"]}},"required":["inboxItems","deliveries"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/my-account/settings":{"get":{"summary":"The caller's account settings","tags":["myAccount"],"parameters":[],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"locale":{"type":"string","minLength":2,"maxLength":10},"timezone":{"type":"string","minLength":1,"maxLength":64}},"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}},"patch":{"summary":"Merge a patch into the caller's account settings","tags":["myAccount"],"parameters":[],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"locale":{"anyOf":[{"type":"string","minLength":2,"maxLength":10},{"type":"null"}]},"timezone":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]}},"additionalProperties":false}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"locale":{"type":"string","minLength":2,"maxLength":10},"timezone":{"type":"string","minLength":1,"maxLength":64}},"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/velocity/config":{"get":{"summary":"Get velocity metric definitions","tags":["velocity"],"parameters":[],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"metrics":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"aggregate":{"type":"string","enum":["count","sum","countDistinct"]},"aggregateField":{"type":"string"},"groupBy":{"minItems":1,"type":"array","items":{"type":"string","enum":["userId","cardFingerprint","cardBin","ip","ipCountry","deviceId","browserFingerprint","email","mobile"]}},"customerId":{"type":"string","minLength":1},"excludeSelf":{"default":false,"type":"boolean"},"includeCurrent":{"default":false,"type":"boolean"},"filters":{"default":[],"type":"array","items":{"type":"object","properties":{"field":{"type":"string","minLength":1},"op":{"type":"string","enum":["eq","neq","in"]},"values":{"minItems":1,"type":"array","items":{"type":"string"}}},"required":["field","op","values"],"additionalProperties":false}},"window":{"type":"object","properties":{"value":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"unit":{"type":"string","enum":["minutes","hours","days","months","all"]}},"required":["value","unit"],"additionalProperties":false},"outputField":{"type":"string","minLength":1}},"required":["id","name","aggregate","groupBy","excludeSelf","includeCurrent","filters","window","outputField"],"additionalProperties":false}},"updatedAt":{"type":"string"}},"required":["metrics"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}},"put":{"summary":"Save velocity metric definitions","tags":["velocity"],"parameters":[],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"metrics":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"aggregate":{"type":"string","enum":["count","sum","countDistinct"]},"aggregateField":{"type":"string"},"groupBy":{"minItems":1,"type":"array","items":{"type":"string","enum":["userId","cardFingerprint","cardBin","ip","ipCountry","deviceId","browserFingerprint","email","mobile"]}},"customerId":{"type":"string","minLength":1},"excludeSelf":{"default":false,"type":"boolean"},"includeCurrent":{"default":false,"type":"boolean"},"filters":{"default":[],"type":"array","items":{"type":"object","properties":{"field":{"type":"string","minLength":1},"op":{"type":"string","enum":["eq","neq","in"]},"values":{"minItems":1,"type":"array","items":{"type":"string"}}},"required":["field","op","values"]}},"window":{"type":"object","properties":{"value":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"unit":{"type":"string","enum":["minutes","hours","days","months","all"]}},"required":["value","unit"]},"outputField":{"type":"string","minLength":1}},"required":["id","name","aggregate","groupBy","window","outputField"]}}},"required":["metrics"]}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"metrics":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"aggregate":{"type":"string","enum":["count","sum","countDistinct"]},"aggregateField":{"type":"string"},"groupBy":{"minItems":1,"type":"array","items":{"type":"string","enum":["userId","cardFingerprint","cardBin","ip","ipCountry","deviceId","browserFingerprint","email","mobile"]}},"customerId":{"type":"string","minLength":1},"excludeSelf":{"default":false,"type":"boolean"},"includeCurrent":{"default":false,"type":"boolean"},"filters":{"default":[],"type":"array","items":{"type":"object","properties":{"field":{"type":"string","minLength":1},"op":{"type":"string","enum":["eq","neq","in"]},"values":{"minItems":1,"type":"array","items":{"type":"string"}}},"required":["field","op","values"],"additionalProperties":false}},"window":{"type":"object","properties":{"value":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"unit":{"type":"string","enum":["minutes","hours","days","months","all"]}},"required":["value","unit"],"additionalProperties":false},"outputField":{"type":"string","minLength":1}},"required":["id","name","aggregate","groupBy","excludeSelf","includeCurrent","filters","window","outputField"],"additionalProperties":false}},"updatedAt":{"type":"string"}},"required":["metrics"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/velocity/purge":{"post":{"summary":"Purge old velocity events","tags":["velocity"],"parameters":[],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"maxAgeDays":{"default":90,"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"number"}},"required":["deleted"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/monitors":{"get":{"summary":"List monitors for the current context","tags":["monitors"],"parameters":[{"name":"q","in":"query","schema":{"type":"string"}},{"name":"dataset","in":"query","schema":{"type":"string"}},{"name":"enabled","in":"query","schema":{"type":"boolean"}},{"name":"page","in":"query","schema":{"type":"number"}},{"name":"limit","in":"query","schema":{"type":"number"}},{"name":"filters","in":"query","description":"Filters to apply, as `{ field, op, values }` entries","schema":{"type":"array","items":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"field":{"type":"string","enum":["type","dataset","severity","enabled","lastRunState"]},"op":{"type":"string","enum":["eq","ne","in","nin","contains","notContains","startsWith","notStartsWith","gt","gte","lt","lte","isEmpty","isNotEmpty"]},"values":{"type":"array"}},"required":["field"],"description":"A single search filter"},"maxItems":25}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"description":{"type":"string"},"dataset":{"type":"string","minLength":1},"type":{"type":"string","enum":["threshold","anomaly","match"]},"aplQuery":{"type":"string","minLength":1},"schedule":{"type":"object","properties":{"intervalMinutes":{"default":5,"type":"integer","minimum":1,"maximum":9007199254740991},"rangeMinutes":{"default":5,"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["intervalMinutes","rangeMinutes"],"additionalProperties":false},"severity":{"default":"warning","type":"string","enum":["info","warning","critical"]},"comparison":{"type":"string","enum":["above","aboveOrEqual","below","belowOrEqual","aboveOrBelow"]},"threshold":{"type":"number"},"tolerance":{"type":"number","minimum":0,"maximum":100},"compareDays":{"type":"integer","minimum":0,"maximum":7},"notifyByGroup":{"default":false,"type":"boolean"},"valueField":{"type":"string"},"enabled":{"default":true,"type":"boolean"},"emailRecipients":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"smsRecipients":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"contextType":{"type":"string","enum":["organization","customer"]},"contextId":{"type":"string"},"lastRunAt":{"type":["string","null"]},"nextRunAt":{"type":["string","null"]},"lastRunState":{"anyOf":[{"type":"string","enum":["ok","alert","error","no_data"]},{"type":"null"}]},"lastRunError":{"type":["string","null"]},"recentRuns":{"default":[],"type":"array","items":{"type":"object","properties":{"timestamp":{"type":"string"},"state":{"type":"string","enum":["ok","alert","error","no_data"]},"value":{"type":["number","null"]},"threshold":{"type":["number","null"]},"durationMs":{"type":["number","null"]},"error":{"type":["string","null"]},"groupValues":{"type":"array","items":{"type":"string"}},"alertId":{"type":["string","null"]}},"required":["timestamp","state"],"additionalProperties":false}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"createdBy":{"type":["string","null"]},"activeAlertCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastTriggeredAt":{"type":["string","null"]}},"required":["name","dataset","type","aplQuery","schedule","severity","notifyByGroup","enabled","emailRecipients","smsRecipients","id","contextType","contextId","recentRuns","createdAt","updatedAt","activeAlertCount"],"additionalProperties":false}},"meta":{"type":"object","properties":{"page":{"type":"number"},"pageSize":{"type":"number"},"hasMore":{"type":"boolean"},"total":{"type":"number"}},"required":["page","pageSize","hasMore"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}},"post":{"summary":"Create a monitor (and sync it to the detection engine)","tags":["monitors"],"parameters":[],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"description":{"type":"string"},"dataset":{"type":"string","minLength":1},"type":{"type":"string","enum":["threshold","anomaly","match"]},"aplQuery":{"type":"string","minLength":1},"schedule":{"type":"object","properties":{"intervalMinutes":{"default":5,"type":"integer","minimum":1,"maximum":9007199254740991},"rangeMinutes":{"default":5,"type":"integer","minimum":1,"maximum":9007199254740991}}},"severity":{"default":"warning","type":"string","enum":["info","warning","critical"]},"comparison":{"type":"string","enum":["above","aboveOrEqual","below","belowOrEqual","aboveOrBelow"]},"threshold":{"type":"number"},"tolerance":{"type":"number","minimum":0,"maximum":100},"compareDays":{"type":"integer","minimum":0,"maximum":7},"notifyByGroup":{"default":false,"type":"boolean"},"valueField":{"type":"string"},"enabled":{"default":true,"type":"boolean"},"emailRecipients":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"smsRecipients":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}}},"required":["name","dataset","type","aplQuery","schedule"]}}}},"responses":{"201":{"description":"201","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"description":{"type":"string"},"dataset":{"type":"string","minLength":1},"type":{"type":"string","enum":["threshold","anomaly","match"]},"aplQuery":{"type":"string","minLength":1},"schedule":{"type":"object","properties":{"intervalMinutes":{"default":5,"type":"integer","minimum":1,"maximum":9007199254740991},"rangeMinutes":{"default":5,"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["intervalMinutes","rangeMinutes"],"additionalProperties":false},"severity":{"default":"warning","type":"string","enum":["info","warning","critical"]},"comparison":{"type":"string","enum":["above","aboveOrEqual","below","belowOrEqual","aboveOrBelow"]},"threshold":{"type":"number"},"tolerance":{"type":"number","minimum":0,"maximum":100},"compareDays":{"type":"integer","minimum":0,"maximum":7},"notifyByGroup":{"default":false,"type":"boolean"},"valueField":{"type":"string"},"enabled":{"default":true,"type":"boolean"},"emailRecipients":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"smsRecipients":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"contextType":{"type":"string","enum":["organization","customer"]},"contextId":{"type":"string"},"lastRunAt":{"type":["string","null"]},"nextRunAt":{"type":["string","null"]},"lastRunState":{"anyOf":[{"type":"string","enum":["ok","alert","error","no_data"]},{"type":"null"}]},"lastRunError":{"type":["string","null"]},"recentRuns":{"default":[],"type":"array","items":{"type":"object","properties":{"timestamp":{"type":"string"},"state":{"type":"string","enum":["ok","alert","error","no_data"]},"value":{"type":["number","null"]},"threshold":{"type":["number","null"]},"durationMs":{"type":["number","null"]},"error":{"type":["string","null"]},"groupValues":{"type":"array","items":{"type":"string"}},"alertId":{"type":["string","null"]}},"required":["timestamp","state"],"additionalProperties":false}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"createdBy":{"type":["string","null"]},"activeAlertCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastTriggeredAt":{"type":["string","null"]}},"required":["name","dataset","type","aplQuery","schedule","severity","notifyByGroup","enabled","emailRecipients","smsRecipients","id","contextType","contextId","recentRuns","createdAt","updatedAt","activeAlertCount"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/monitors/runs":{"get":{"summary":"Recent engine checks for monitors in the current context","tags":["monitors"],"parameters":[{"name":"ids","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":1000}},{"name":"hours","in":"query","schema":{"type":"integer","minimum":1,"maximum":720}},{"name":"filters","in":"query","description":"Filters to apply, as `{ field, op, values }` entries","schema":{"type":"array","items":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"field":{"type":"string","enum":["state","value","durationMs"]},"op":{"type":"string","enum":["eq","ne","in","nin","contains","notContains","startsWith","notStartsWith","gt","gte","lt","lte","isEmpty","isNotEmpty"]},"values":{"type":"array"}},"required":["field"],"description":"A single search filter"},"maxItems":25}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"monitorId":{"type":"string"},"source":{"type":"string","enum":["history","cache","unavailable"]},"message":{"type":["string","null"]},"runs":{"type":"array","items":{"type":"object","properties":{"timestamp":{"type":"string"},"state":{"type":"string","enum":["ok","alert","error","no_data"]},"value":{"type":["number","null"]},"threshold":{"type":["number","null"]},"durationMs":{"type":["number","null"]},"error":{"type":["string","null"]},"groupValues":{"type":"array","items":{"type":"string"}},"alertId":{"type":["string","null"]}},"required":["timestamp","state"],"additionalProperties":false}}},"required":["monitorId","source","runs"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/monitors/{id}":{"get":{"summary":"Get a monitor by ID","tags":["monitors"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"description":{"type":"string"},"dataset":{"type":"string","minLength":1},"type":{"type":"string","enum":["threshold","anomaly","match"]},"aplQuery":{"type":"string","minLength":1},"schedule":{"type":"object","properties":{"intervalMinutes":{"default":5,"type":"integer","minimum":1,"maximum":9007199254740991},"rangeMinutes":{"default":5,"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["intervalMinutes","rangeMinutes"],"additionalProperties":false},"severity":{"default":"warning","type":"string","enum":["info","warning","critical"]},"comparison":{"type":"string","enum":["above","aboveOrEqual","below","belowOrEqual","aboveOrBelow"]},"threshold":{"type":"number"},"tolerance":{"type":"number","minimum":0,"maximum":100},"compareDays":{"type":"integer","minimum":0,"maximum":7},"notifyByGroup":{"default":false,"type":"boolean"},"valueField":{"type":"string"},"enabled":{"default":true,"type":"boolean"},"emailRecipients":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"smsRecipients":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"contextType":{"type":"string","enum":["organization","customer"]},"contextId":{"type":"string"},"lastRunAt":{"type":["string","null"]},"nextRunAt":{"type":["string","null"]},"lastRunState":{"anyOf":[{"type":"string","enum":["ok","alert","error","no_data"]},{"type":"null"}]},"lastRunError":{"type":["string","null"]},"recentRuns":{"default":[],"type":"array","items":{"type":"object","properties":{"timestamp":{"type":"string"},"state":{"type":"string","enum":["ok","alert","error","no_data"]},"value":{"type":["number","null"]},"threshold":{"type":["number","null"]},"durationMs":{"type":["number","null"]},"error":{"type":["string","null"]},"groupValues":{"type":"array","items":{"type":"string"}},"alertId":{"type":["string","null"]}},"required":["timestamp","state"],"additionalProperties":false}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"createdBy":{"type":["string","null"]},"activeAlertCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastTriggeredAt":{"type":["string","null"]}},"required":["name","dataset","type","aplQuery","schedule","severity","notifyByGroup","enabled","emailRecipients","smsRecipients","id","contextType","contextId","recentRuns","createdAt","updatedAt","activeAlertCount"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}},"patch":{"summary":"Update a monitor","tags":["monitors"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"description":{"type":"string"},"dataset":{"type":"string","minLength":1},"type":{"type":"string","enum":["threshold","anomaly","match"]},"aplQuery":{"type":"string","minLength":1},"schedule":{"type":"object","properties":{"intervalMinutes":{"default":5,"type":"integer","minimum":1,"maximum":9007199254740991},"rangeMinutes":{"default":5,"type":"integer","minimum":1,"maximum":9007199254740991}}},"severity":{"default":"warning","type":"string","enum":["info","warning","critical"]},"comparison":{"type":"string","enum":["above","aboveOrEqual","below","belowOrEqual","aboveOrBelow"]},"threshold":{"type":"number"},"tolerance":{"type":"number","minimum":0,"maximum":100},"compareDays":{"type":"integer","minimum":0,"maximum":7},"notifyByGroup":{"default":false,"type":"boolean"},"valueField":{"type":"string"},"enabled":{"default":true,"type":"boolean"},"emailRecipients":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"smsRecipients":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"description":{"type":"string"},"dataset":{"type":"string","minLength":1},"type":{"type":"string","enum":["threshold","anomaly","match"]},"aplQuery":{"type":"string","minLength":1},"schedule":{"type":"object","properties":{"intervalMinutes":{"default":5,"type":"integer","minimum":1,"maximum":9007199254740991},"rangeMinutes":{"default":5,"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["intervalMinutes","rangeMinutes"],"additionalProperties":false},"severity":{"default":"warning","type":"string","enum":["info","warning","critical"]},"comparison":{"type":"string","enum":["above","aboveOrEqual","below","belowOrEqual","aboveOrBelow"]},"threshold":{"type":"number"},"tolerance":{"type":"number","minimum":0,"maximum":100},"compareDays":{"type":"integer","minimum":0,"maximum":7},"notifyByGroup":{"default":false,"type":"boolean"},"valueField":{"type":"string"},"enabled":{"default":true,"type":"boolean"},"emailRecipients":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"smsRecipients":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"contextType":{"type":"string","enum":["organization","customer"]},"contextId":{"type":"string"},"lastRunAt":{"type":["string","null"]},"nextRunAt":{"type":["string","null"]},"lastRunState":{"anyOf":[{"type":"string","enum":["ok","alert","error","no_data"]},{"type":"null"}]},"lastRunError":{"type":["string","null"]},"recentRuns":{"default":[],"type":"array","items":{"type":"object","properties":{"timestamp":{"type":"string"},"state":{"type":"string","enum":["ok","alert","error","no_data"]},"value":{"type":["number","null"]},"threshold":{"type":["number","null"]},"durationMs":{"type":["number","null"]},"error":{"type":["string","null"]},"groupValues":{"type":"array","items":{"type":"string"}},"alertId":{"type":["string","null"]}},"required":["timestamp","state"],"additionalProperties":false}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"createdBy":{"type":["string","null"]},"activeAlertCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastTriggeredAt":{"type":["string","null"]}},"required":["name","dataset","type","aplQuery","schedule","severity","notifyByGroup","enabled","emailRecipients","smsRecipients","id","contextType","contextId","recentRuns","createdAt","updatedAt","activeAlertCount"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}},"delete":{"summary":"Delete a monitor (and remove it from the detection engine)","tags":["monitors"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"204":{"description":"204","content":{"application/json":{"schema":{}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/monitors/{id}/run":{"post":{"summary":"Evaluate the monitor now and apply what it finds","tags":["monitors"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"description":{"type":"string"},"dataset":{"type":"string","minLength":1},"type":{"type":"string","enum":["threshold","anomaly","match"]},"aplQuery":{"type":"string","minLength":1},"schedule":{"type":"object","properties":{"intervalMinutes":{"default":5,"type":"integer","minimum":1,"maximum":9007199254740991},"rangeMinutes":{"default":5,"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["intervalMinutes","rangeMinutes"],"additionalProperties":false},"severity":{"default":"warning","type":"string","enum":["info","warning","critical"]},"comparison":{"type":"string","enum":["above","aboveOrEqual","below","belowOrEqual","aboveOrBelow"]},"threshold":{"type":"number"},"tolerance":{"type":"number","minimum":0,"maximum":100},"compareDays":{"type":"integer","minimum":0,"maximum":7},"notifyByGroup":{"default":false,"type":"boolean"},"valueField":{"type":"string"},"enabled":{"default":true,"type":"boolean"},"emailRecipients":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"smsRecipients":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"contextType":{"type":"string","enum":["organization","customer"]},"contextId":{"type":"string"},"lastRunAt":{"type":["string","null"]},"nextRunAt":{"type":["string","null"]},"lastRunState":{"anyOf":[{"type":"string","enum":["ok","alert","error","no_data"]},{"type":"null"}]},"lastRunError":{"type":["string","null"]},"recentRuns":{"default":[],"type":"array","items":{"type":"object","properties":{"timestamp":{"type":"string"},"state":{"type":"string","enum":["ok","alert","error","no_data"]},"value":{"type":["number","null"]},"threshold":{"type":["number","null"]},"durationMs":{"type":["number","null"]},"error":{"type":["string","null"]},"groupValues":{"type":"array","items":{"type":"string"}},"alertId":{"type":["string","null"]}},"required":["timestamp","state"],"additionalProperties":false}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"createdBy":{"type":["string","null"]},"activeAlertCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastTriggeredAt":{"type":["string","null"]}},"required":["name","dataset","type","aplQuery","schedule","severity","notifyByGroup","enabled","emailRecipients","smsRecipients","id","contextType","contextId","recentRuns","createdAt","updatedAt","activeAlertCount"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/monitors/{id}/test":{"post":{"summary":"Run the monitor query once and report whether it would trigger","tags":["monitors"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"wouldTrigger":{"type":"boolean"},"value":{"type":"number"},"rows":{}},"required":["message","wouldTrigger"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/monitors/{id}/simulate":{"post":{"summary":"Simulate an engine trigger for this monitor (testing)","tags":["monitors"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"action":{"default":"Open","type":"string","enum":["Open","Closed"]},"title":{"type":"string","maxLength":200},"description":{"type":"string","maxLength":1000},"value":{"type":"number"},"groupValues":{"maxItems":10,"type":"array","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"alertId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"status":{"type":"string"},"message":{"type":"string"}},"required":["status","message"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/monitor-alerts":{"get":{"summary":"List triggered alerts for the current context","tags":["monitorAlerts"],"parameters":[{"name":"q","in":"query","schema":{"type":"string"}},{"name":"status","in":"query","schema":{"type":"string","enum":["open","acknowledged","resolved","snoozed"]}},{"name":"severity","in":"query","schema":{"type":"string","enum":["info","warning","critical"]}},{"name":"monitorId","in":"query","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"assignedTo","in":"query","schema":{"type":"string"}},{"name":"active","in":"query","schema":{"type":"boolean"}},{"name":"page","in":"query","schema":{"type":"number"}},{"name":"limit","in":"query","schema":{"type":"number"}},{"name":"filters","in":"query","description":"Filters to apply, as `{ field, op, values }` entries","schema":{"type":"array","items":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"field":{"type":"string","enum":["status","severity","monitorName","assignedTo","triggerCount"]},"op":{"type":"string","enum":["eq","ne","in","nin","contains","notContains","startsWith","notStartsWith","gt","gte","lt","lte","isEmpty","isNotEmpty"]},"values":{"type":"array"}},"required":["field"],"description":"A single search filter"},"maxItems":25}},{"name":"count","in":"query","schema":{"type":"boolean"}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"monitorId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"monitorName":{"type":"string"},"contextType":{"type":"string","enum":["organization","customer"]},"contextId":{"type":"string"},"dedupKey":{"type":"string"},"status":{"type":"string","enum":["open","acknowledged","resolved","snoozed"]},"severity":{"type":"string","enum":["info","warning","critical"]},"title":{"type":"string"},"description":{"type":["string","null"]},"value":{"type":["number","null"]},"threshold":{"type":["number","null"]},"groupKeys":{"default":[],"type":"array","items":{"type":"string"}},"groupValues":{"default":[],"type":"array","items":{"type":"string"}},"matchedEvent":{"anyOf":[{},{"type":"null"}]},"firstSeenAt":{"type":"string"},"lastSeenAt":{"type":"string"},"triggerCount":{"default":1,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"acknowledgedAt":{"type":["string","null"]},"acknowledgedBy":{"type":["string","null"]},"resolvedAt":{"type":["string","null"]},"resolvedBy":{"type":["string","null"]},"assignedTo":{"type":["string","null"]},"assignedToName":{"type":["string","null"]},"assignedToEmail":{"type":["string","null"]},"snoozedUntil":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","monitorId","monitorName","contextType","contextId","dedupKey","status","severity","title","groupKeys","groupValues","firstSeenAt","lastSeenAt","triggerCount","createdAt","updatedAt"],"additionalProperties":false}},"meta":{"type":"object","properties":{"page":{"type":"number"},"pageSize":{"type":"number"},"hasMore":{"type":"boolean"},"total":{"type":"number"}},"required":["page","pageSize","hasMore"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/monitor-alerts/{id}":{"get":{"summary":"Get a triggered alert by ID","tags":["monitorAlerts"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"monitorId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"monitorName":{"type":"string"},"contextType":{"type":"string","enum":["organization","customer"]},"contextId":{"type":"string"},"dedupKey":{"type":"string"},"status":{"type":"string","enum":["open","acknowledged","resolved","snoozed"]},"severity":{"type":"string","enum":["info","warning","critical"]},"title":{"type":"string"},"description":{"type":["string","null"]},"value":{"type":["number","null"]},"threshold":{"type":["number","null"]},"groupKeys":{"default":[],"type":"array","items":{"type":"string"}},"groupValues":{"default":[],"type":"array","items":{"type":"string"}},"matchedEvent":{"anyOf":[{},{"type":"null"}]},"firstSeenAt":{"type":"string"},"lastSeenAt":{"type":"string"},"triggerCount":{"default":1,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"acknowledgedAt":{"type":["string","null"]},"acknowledgedBy":{"type":["string","null"]},"resolvedAt":{"type":["string","null"]},"resolvedBy":{"type":["string","null"]},"assignedTo":{"type":["string","null"]},"assignedToName":{"type":["string","null"]},"assignedToEmail":{"type":["string","null"]},"snoozedUntil":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","monitorId","monitorName","contextType","contextId","dedupKey","status","severity","title","groupKeys","groupValues","firstSeenAt","lastSeenAt","triggerCount","createdAt","updatedAt"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/monitor-alerts/{id}/acknowledge":{"post":{"summary":"Acknowledge an alert","tags":["monitorAlerts"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"note":{"type":"string"}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"monitorId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"monitorName":{"type":"string"},"contextType":{"type":"string","enum":["organization","customer"]},"contextId":{"type":"string"},"dedupKey":{"type":"string"},"status":{"type":"string","enum":["open","acknowledged","resolved","snoozed"]},"severity":{"type":"string","enum":["info","warning","critical"]},"title":{"type":"string"},"description":{"type":["string","null"]},"value":{"type":["number","null"]},"threshold":{"type":["number","null"]},"groupKeys":{"default":[],"type":"array","items":{"type":"string"}},"groupValues":{"default":[],"type":"array","items":{"type":"string"}},"matchedEvent":{"anyOf":[{},{"type":"null"}]},"firstSeenAt":{"type":"string"},"lastSeenAt":{"type":"string"},"triggerCount":{"default":1,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"acknowledgedAt":{"type":["string","null"]},"acknowledgedBy":{"type":["string","null"]},"resolvedAt":{"type":["string","null"]},"resolvedBy":{"type":["string","null"]},"assignedTo":{"type":["string","null"]},"assignedToName":{"type":["string","null"]},"assignedToEmail":{"type":["string","null"]},"snoozedUntil":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","monitorId","monitorName","contextType","contextId","dedupKey","status","severity","title","groupKeys","groupValues","firstSeenAt","lastSeenAt","triggerCount","createdAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/monitor-alerts/{id}/resolve":{"post":{"summary":"Resolve an alert","tags":["monitorAlerts"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"note":{"type":"string"}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"monitorId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"monitorName":{"type":"string"},"contextType":{"type":"string","enum":["organization","customer"]},"contextId":{"type":"string"},"dedupKey":{"type":"string"},"status":{"type":"string","enum":["open","acknowledged","resolved","snoozed"]},"severity":{"type":"string","enum":["info","warning","critical"]},"title":{"type":"string"},"description":{"type":["string","null"]},"value":{"type":["number","null"]},"threshold":{"type":["number","null"]},"groupKeys":{"default":[],"type":"array","items":{"type":"string"}},"groupValues":{"default":[],"type":"array","items":{"type":"string"}},"matchedEvent":{"anyOf":[{},{"type":"null"}]},"firstSeenAt":{"type":"string"},"lastSeenAt":{"type":"string"},"triggerCount":{"default":1,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"acknowledgedAt":{"type":["string","null"]},"acknowledgedBy":{"type":["string","null"]},"resolvedAt":{"type":["string","null"]},"resolvedBy":{"type":["string","null"]},"assignedTo":{"type":["string","null"]},"assignedToName":{"type":["string","null"]},"assignedToEmail":{"type":["string","null"]},"snoozedUntil":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","monitorId","monitorName","contextType","contextId","dedupKey","status","severity","title","groupKeys","groupValues","firstSeenAt","lastSeenAt","triggerCount","createdAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/monitor-alerts/{id}/reopen":{"post":{"summary":"Reopen a resolved alert","tags":["monitorAlerts"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"note":{"type":"string"}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"monitorId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"monitorName":{"type":"string"},"contextType":{"type":"string","enum":["organization","customer"]},"contextId":{"type":"string"},"dedupKey":{"type":"string"},"status":{"type":"string","enum":["open","acknowledged","resolved","snoozed"]},"severity":{"type":"string","enum":["info","warning","critical"]},"title":{"type":"string"},"description":{"type":["string","null"]},"value":{"type":["number","null"]},"threshold":{"type":["number","null"]},"groupKeys":{"default":[],"type":"array","items":{"type":"string"}},"groupValues":{"default":[],"type":"array","items":{"type":"string"}},"matchedEvent":{"anyOf":[{},{"type":"null"}]},"firstSeenAt":{"type":"string"},"lastSeenAt":{"type":"string"},"triggerCount":{"default":1,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"acknowledgedAt":{"type":["string","null"]},"acknowledgedBy":{"type":["string","null"]},"resolvedAt":{"type":["string","null"]},"resolvedBy":{"type":["string","null"]},"assignedTo":{"type":["string","null"]},"assignedToName":{"type":["string","null"]},"assignedToEmail":{"type":["string","null"]},"snoozedUntil":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","monitorId","monitorName","contextType","contextId","dedupKey","status","severity","title","groupKeys","groupValues","firstSeenAt","lastSeenAt","triggerCount","createdAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/monitor-alerts/{id}/snooze":{"post":{"summary":"Snooze an alert until a given time","tags":["monitorAlerts"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"until":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"note":{"type":"string"}},"required":["until"]}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"monitorId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"monitorName":{"type":"string"},"contextType":{"type":"string","enum":["organization","customer"]},"contextId":{"type":"string"},"dedupKey":{"type":"string"},"status":{"type":"string","enum":["open","acknowledged","resolved","snoozed"]},"severity":{"type":"string","enum":["info","warning","critical"]},"title":{"type":"string"},"description":{"type":["string","null"]},"value":{"type":["number","null"]},"threshold":{"type":["number","null"]},"groupKeys":{"default":[],"type":"array","items":{"type":"string"}},"groupValues":{"default":[],"type":"array","items":{"type":"string"}},"matchedEvent":{"anyOf":[{},{"type":"null"}]},"firstSeenAt":{"type":"string"},"lastSeenAt":{"type":"string"},"triggerCount":{"default":1,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"acknowledgedAt":{"type":["string","null"]},"acknowledgedBy":{"type":["string","null"]},"resolvedAt":{"type":["string","null"]},"resolvedBy":{"type":["string","null"]},"assignedTo":{"type":["string","null"]},"assignedToName":{"type":["string","null"]},"assignedToEmail":{"type":["string","null"]},"snoozedUntil":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","monitorId","monitorName","contextType","contextId","dedupKey","status","severity","title","groupKeys","groupValues","firstSeenAt","lastSeenAt","triggerCount","createdAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/monitor-alerts/{id}/assign":{"post":{"summary":"Assign or unassign an alert","tags":["monitorAlerts"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"assignedTo":{"type":["string","null"]}},"required":["assignedTo"]}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"monitorId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"monitorName":{"type":"string"},"contextType":{"type":"string","enum":["organization","customer"]},"contextId":{"type":"string"},"dedupKey":{"type":"string"},"status":{"type":"string","enum":["open","acknowledged","resolved","snoozed"]},"severity":{"type":"string","enum":["info","warning","critical"]},"title":{"type":"string"},"description":{"type":["string","null"]},"value":{"type":["number","null"]},"threshold":{"type":["number","null"]},"groupKeys":{"default":[],"type":"array","items":{"type":"string"}},"groupValues":{"default":[],"type":"array","items":{"type":"string"}},"matchedEvent":{"anyOf":[{},{"type":"null"}]},"firstSeenAt":{"type":"string"},"lastSeenAt":{"type":"string"},"triggerCount":{"default":1,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"acknowledgedAt":{"type":["string","null"]},"acknowledgedBy":{"type":["string","null"]},"resolvedAt":{"type":["string","null"]},"resolvedBy":{"type":["string","null"]},"assignedTo":{"type":["string","null"]},"assignedToName":{"type":["string","null"]},"assignedToEmail":{"type":["string","null"]},"snoozedUntil":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","monitorId","monitorName","contextType","contextId","dedupKey","status","severity","title","groupKeys","groupValues","firstSeenAt","lastSeenAt","triggerCount","createdAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/monitor-alerts/{id}/audit-trail":{"get":{"summary":"Get the full audit trail for an alert","tags":["monitorAlerts"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"timestamp":{"type":"string"},"kind":{"type":"string"},"actorId":{"type":["string","null"]},"actorName":{"type":["string","null"]},"actorEmail":{"type":["string","null"]},"note":{"type":["string","null"]},"fromStatus":{"type":["string","null"]},"toStatus":{"type":["string","null"]},"channel":{"type":["string","null"]},"target":{"type":["string","null"]},"deliveryStatus":{"type":["string","null"]}},"required":["timestamp","kind"],"additionalProperties":false}}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/monitor-alerts/{id}/comments":{"get":{"summary":"List comments on an alert","tags":["monitorAlerts"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"alertId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"contextType":{"type":"string","enum":["organization","customer"]},"contextId":{"type":"string"},"authorId":{"type":"string"},"authorName":{"type":["string","null"]},"authorEmail":{"type":["string","null"]},"body":{"type":"string","minLength":1},"createdAt":{"type":"string"}},"required":["id","alertId","contextType","contextId","authorId","body","createdAt"],"additionalProperties":false}}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}},"post":{"summary":"Add a comment to an alert","tags":["monitorAlerts"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":10000}},"required":["body"]}}}},"responses":{"201":{"description":"201","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"alertId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"contextType":{"type":"string","enum":["organization","customer"]},"contextId":{"type":"string"},"authorId":{"type":"string"},"authorName":{"type":["string","null"]},"authorEmail":{"type":["string","null"]},"body":{"type":"string","minLength":1},"createdAt":{"type":"string"}},"required":["id","alertId","contextType","contextId","authorId","body","createdAt"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/analytics/query":{"post":{"description":"Structured query interface for Analytics Engine","summary":"Execute a query against the Analytics Engine","tags":["analytics"],"parameters":[],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"dataset":{"type":"string","minLength":1},"query":{"type":"string","minLength":1},"startDate":{"type":"string"},"endDate":{"type":"string"},"f":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"operator":{"type":"string"},"value":{}},"required":["field","operator","value"]}}},"required":["dataset","query"]}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"datasetNames":{"type":"array","items":{"type":"string"}},"status":{"type":"object","properties":{"elapsedTime":{"type":"number"},"blocksExamined":{"type":"number"},"rowsExamined":{"type":"number"},"rowsMatched":{"type":"number"},"numGroups":{"type":"number"},"isPartial":{"type":"boolean"},"cacheStatus":{"type":"number"},"minBlockTime":{"type":"string"},"maxBlockTime":{"type":"string"}},"required":["elapsedTime","blocksExamined","rowsExamined","rowsMatched","numGroups","isPartial","cacheStatus","minBlockTime","maxBlockTime"],"additionalProperties":false},"buckets":{"type":"object","properties":{"series":{"type":"array","items":{"type":"object","properties":{"interval":{"type":"string"},"groups":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"group":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"aggregations":{"type":"array","items":{"type":"object","properties":{"alias":{"type":"string"},"value":{"type":"number"}},"required":["alias","value"],"additionalProperties":false}}},"required":["id","group","aggregations"],"additionalProperties":false}}},"required":["interval","groups"],"additionalProperties":false}},"totals":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"group":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"aggregations":{"type":"array","items":{"type":"object","properties":{"alias":{"type":"string"},"value":{"type":"number"}},"required":["alias","value"],"additionalProperties":false}}},"required":["id","group","aggregations"],"additionalProperties":false}}},"required":["series","totals"],"additionalProperties":false},"fieldsMetaMap":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"type":{"type":"string"},"unit":{"type":"string"},"description":{"type":"string"}},"required":["type"],"additionalProperties":false}},"request":{"type":"object","properties":{"endTime":{"type":"string"},"resolution":{"type":"string"},"startTime":{"type":"string"},"aggregations":{"type":"array","items":{"type":"object","properties":{"alias":{"type":"string"},"argument":{"type":"string"},"field":{"type":"string"},"op":{"type":"string"}},"required":["alias","field","op"],"additionalProperties":false}},"filter":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"groupBy":{"type":"array","items":{"type":"string"}},"limit":{"type":"number"},"order":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"desc":{"type":"boolean"}},"required":["field","desc"],"additionalProperties":false}},"project":{"type":"array","items":{"type":"string"}},"virtualFields":{"type":"array","items":{"type":"object","properties":{"alias":{"type":"string"},"expr":{"type":"string"}},"required":["alias","expr"],"additionalProperties":false}}},"required":["endTime","resolution","startTime"],"additionalProperties":false},"tables":{"type":"array","items":{"type":"object","properties":{"fields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"},"agg":{"anyOf":[{"type":"boolean"},{"type":"object","properties":{"name":{"type":"string"}},"required":["name"],"additionalProperties":false}]}},"required":["name","type"],"additionalProperties":false}},"groups":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"group":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","group"],"additionalProperties":false}},"name":{"type":"string"},"order":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"desc":{"type":"boolean"}},"required":["field","desc"],"additionalProperties":false}},"sources":{"type":"array","items":{"type":"string"}},"columns":{"type":"array","items":{"type":"array","items":{}}},"range":{"type":"object","properties":{"field":{"type":"string"},"start":{"type":"string"},"end":{"type":"string"}},"required":["field","start","end"],"additionalProperties":false}},"required":["fields","groups","name","order","sources","columns","range"],"additionalProperties":false}}},"required":["datasetNames","status","buckets","fieldsMetaMap","request","tables"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"401":{"description":"401","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"500":{"description":"500","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/analytics/schema":{"get":{"description":"Returns column metadata (name, type, ordinal, column type) for the specified datasets","summary":"Get schema for one or more datasets","tags":["analytics"],"parameters":[{"name":"datasets","in":"query","description":"Comma-separated list of dataset names","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"columnName":{"type":"string"},"dataType":{"type":"string"},"columnOrdinal":{"type":"number"},"columnType":{"type":"string"}},"required":["columnName","dataType","columnOrdinal","columnType"],"additionalProperties":false}}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"401":{"description":"401","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"500":{"description":"500","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/analytics/datasets":{"get":{"description":"Retrieve a list of available datasets with their IDs and names","summary":"List available datasets","tags":["analytics"],"parameters":[],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}}}}},"401":{"description":"401","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"500":{"description":"500","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/authz/permissions":{"get":{"description":"Returns all resources and permissions available to the current user across all contexts","summary":"Get current user permissions for UI control","tags":["authorization"],"parameters":[],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"contextType":{"type":"string","enum":["organization","partner","customer"]},"contextId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"permissions":{"type":"array","items":{"type":"object","properties":{"resourceId":{"type":"string"},"conditions":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"isRegex":{"type":"boolean"}},"required":["resourceId"],"additionalProperties":false}}},"required":["contextType","contextId","permissions"],"additionalProperties":false}}}}},"401":{"description":"401","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"500":{"description":"500","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/authz/contexts":{"get":{"description":"Returns all contexts (organizations, customers, etc.) that the current user has access to, with their names","summary":"Get current user contexts","tags":["authorization"],"parameters":[],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"contexts":{"type":"array","items":{"type":"object","properties":{"context":{"type":"object","properties":{"type":{"type":"string","enum":["organization","partner","customer"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"organizationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["type","id"],"additionalProperties":false},"name":{"type":"string"},"description":{"type":"string"},"providerDataVisible":{"type":"boolean"}},"required":["context","name"],"additionalProperties":false}},"isRootUser":{"type":"boolean"}},"required":["contexts"],"additionalProperties":false}}}},"401":{"description":"401","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"500":{"description":"500","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/authz/contexts/{type}/{id}/roles":{"get":{"description":"Returns paginated list of roles available in the specified context","summary":"Get all roles for a context","tags":["authorization"],"parameters":[{"name":"type","in":"path","required":true,"schema":{"type":"string","enum":["organization","partner","customer"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"organizationId","in":"path","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"page","in":"query","schema":{"default":1,"type":"number"}},{"name":"limit","in":"query","schema":{"default":50,"type":"number","minimum":1,"maximum":100}},{"name":"search","in":"query","schema":{"type":"string"}},{"name":"includeDefaults","in":"query","schema":{"type":"boolean"}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"roles":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","minLength":1},"description":{"type":"string"},"contextType":{"type":"string","enum":["organization","partner","customer"]},"contextId":{"type":"string"},"organizationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"permissions":{"default":[],"type":"array","items":{"type":"object","properties":{"resourceId":{"type":"string"},"conditions":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"isRegex":{"type":"boolean"}},"required":["resourceId"],"additionalProperties":false}},"isSystemRole":{"type":"boolean"},"parentRoleId":{"type":"string"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","contextType","permissions","isSystemRole","createdAt","updatedAt"],"additionalProperties":false}},"total":{"type":"number"},"page":{"type":"number"},"pageSize":{"type":"number"},"totalPages":{"type":"number"}},"required":["roles","total","page","pageSize","totalPages"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}},"post":{"description":"Creates a new custom role with specified permissions in the context","summary":"Create a custom role","tags":["authorization"],"parameters":[{"name":"type","in":"path","required":true,"schema":{"type":"string","enum":["organization","partner","customer"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"organizationId","in":"path","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"description":{"type":"string"},"permissions":{"type":"array","items":{"type":"object","properties":{"resourceId":{"type":"string"},"conditions":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"isRegex":{"type":"boolean"}},"required":["resourceId"]}},"parentRoleId":{"type":"string"},"targetContextType":{"type":"string","enum":["organization","partner","customer"]},"isSystemRole":{"type":"boolean"}},"required":["name"]}}}},"responses":{"201":{"description":"201","content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","minLength":1},"description":{"type":"string"},"contextType":{"type":"string","enum":["organization","partner","customer"]},"contextId":{"type":"string"},"organizationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"permissions":{"default":[],"type":"array","items":{"type":"object","properties":{"resourceId":{"type":"string"},"conditions":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"isRegex":{"type":"boolean"}},"required":["resourceId"],"additionalProperties":false}},"isSystemRole":{"type":"boolean"},"parentRoleId":{"type":"string"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","contextType","permissions","isSystemRole","createdAt","updatedAt"],"additionalProperties":false},"message":{"type":"string"}},"required":["role"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"409":{"description":"409","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/authz/contexts/{type}/{id}/subjects":{"get":{"description":"Returns paginated list of users and API keys with their assigned roles in the specified context","summary":"Get all subjects with roles in a context","tags":["authorization"],"parameters":[{"name":"type","in":"path","required":true,"schema":{"type":"string","enum":["organization","partner","customer"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"organizationId","in":"path","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"page","in":"query","schema":{"default":1,"type":"number"}},{"name":"limit","in":"query","schema":{"default":50,"type":"number","minimum":1,"maximum":100}},{"name":"search","in":"query","schema":{"type":"string"}},{"name":"subjectType","in":"query","schema":{"type":"string","enum":["user","api_key"]}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"subjects":{"type":"array","items":{"type":"object","properties":{"subjectType":{"type":"string","enum":["user","api_key"]},"subjectId":{"type":"string"},"email":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"status":{"type":"string"},"disabledAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"notes":{"type":["string","null"]},"roles":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"assignedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"assignedBy":{"type":"string"}},"required":["subjectType","subjectId","roles","assignedAt","assignedBy"],"additionalProperties":false}},"page":{"type":"number"},"pageSize":{"type":"number"},"hasMore":{"type":"boolean"}},"required":["subjects","page","pageSize","hasMore"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/authz/contexts/{type}/{id}/roles/assign":{"post":{"description":"Assigns a predefined role to a user or API key in the specified context","summary":"Assign a role to a subject","tags":["authorization"],"parameters":[{"name":"type","in":"path","required":true,"schema":{"type":"string","enum":["organization","partner","customer"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"organizationId","in":"path","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"subjectType":{"type":"string","enum":["user","api_key"]},"subjectId":{"type":"string"},"roleIds":{"type":"array","items":{"type":"string"}}},"required":["subjectType","subjectId","roleIds"]}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"assignment":{"type":"object","properties":{"id":{"type":"string"},"subjectType":{"type":"string","enum":["user","api_key"]},"subjectId":{"type":"string"},"roleId":{"type":"string"},"contextType":{"type":"string","enum":["organization","partner","customer"]},"contextId":{"type":"string"},"assignedBy":{"type":"string"},"assignedByType":{"anyOf":[{"type":"string","enum":["user","api_key"]},{"type":"string","const":"system"}]},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","subjectType","subjectId","roleId","contextType","contextId","assignedBy","assignedByType","createdAt","updatedAt"],"additionalProperties":false}},"required":["success","message"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/authz/contexts/{type}/{id}/users/add":{"post":{"description":"Adds users from Clerk by email and assigns specified roles to them in the context","summary":"Add users and assign roles","tags":["authorization"],"parameters":[{"name":"type","in":"path","required":true,"schema":{"type":"string","enum":["organization","partner","customer"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"organizationId","in":"path","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"emails":{"type":"array","items":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"roleIds":{"type":"array","items":{"type":"string"}}},"required":["emails","roleIds"]}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"results":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string"},"success":{"type":"boolean"},"error":{"type":"string"},"subjectId":{"type":"string"},"roleAssignments":{"type":"array","items":{"type":"object","properties":{"roleId":{"type":"string"},"success":{"type":"boolean"},"error":{"type":"string"}},"required":["roleId","success"],"additionalProperties":false}}},"required":["email","success"],"additionalProperties":false}}},"required":["success","message","results"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/authz/contexts/{type}/{id}/roles/revoke":{"post":{"description":"Revokes a role assignment from a user or API key in the specified context","summary":"Revoke a role from a subject","tags":["authorization"],"parameters":[{"name":"type","in":"path","required":true,"schema":{"type":"string","enum":["organization","partner","customer"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"organizationId","in":"path","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"subjectType":{"type":"string","enum":["user","api_key"]},"subjectId":{"type":"string"},"roleIds":{"type":"array","items":{"type":"string"}}},"required":["subjectType","subjectId","roleIds"]}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success","message"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/authz/contexts/{type}/{id}/roles/bulk-assign":{"post":{"description":"Assigns roles to multiple users or API keys in a single operation","summary":"Bulk assign roles to multiple subjects","tags":["authorization"],"parameters":[{"name":"type","in":"path","required":true,"schema":{"type":"string","enum":["organization","partner","customer"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"organizationId","in":"path","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"assignments":{"type":"array","items":{"type":"object","properties":{"subjectType":{"type":"string","enum":["user","api_key"]},"subjectId":{"type":"string"},"roleId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["subjectType","subjectId","roleId"]}}},"required":["assignments"]}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"results":{"type":"array","items":{"type":"object","properties":{"subjectType":{"type":"string","enum":["user","api_key"]},"subjectId":{"type":"string"},"roleId":{"type":"string"},"success":{"type":"boolean"},"error":{"type":"string"},"assignment":{"type":"object","properties":{"id":{"type":"string"},"subjectType":{"type":"string","enum":["user","api_key"]},"subjectId":{"type":"string"},"roleId":{"type":"string"},"contextType":{"type":"string","enum":["organization","partner","customer"]},"contextId":{"type":"string"},"assignedBy":{"type":"string"},"assignedByType":{"anyOf":[{"type":"string","enum":["user","api_key"]},{"type":"string","const":"system"}]},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","subjectType","subjectId","roleId","contextType","contextId","assignedBy","assignedByType","createdAt","updatedAt"],"additionalProperties":false}},"required":["subjectType","subjectId","roleId","success"],"additionalProperties":false}}},"required":["success","message","results"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/authz/contexts/{type}/{id}/roles/{roleId}":{"patch":{"description":"Updates an existing role's name, description, or permissions","summary":"Update a role","tags":["authorization"],"parameters":[{"name":"type","in":"path","required":true,"schema":{"type":"string","enum":["organization","partner","customer"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"roleId","in":"path","required":true,"schema":{"type":"string"}},{"name":"organizationId","in":"path","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"description":{"type":"string"},"permissions":{"type":"array","items":{"type":"object","properties":{"resourceId":{"type":"string"},"conditions":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"isRegex":{"type":"boolean"}},"required":["resourceId"]}},"parentRoleId":{"type":"string"}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","minLength":1},"description":{"type":"string"},"contextType":{"type":"string","enum":["organization","partner","customer"]},"contextId":{"type":"string"},"organizationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"permissions":{"default":[],"type":"array","items":{"type":"object","properties":{"resourceId":{"type":"string"},"conditions":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"isRegex":{"type":"boolean"}},"required":["resourceId"],"additionalProperties":false}},"isSystemRole":{"type":"boolean"},"parentRoleId":{"type":"string"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","contextType","permissions","isSystemRole","createdAt","updatedAt"],"additionalProperties":false},"message":{"type":"string"}},"required":["role"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"409":{"description":"409","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}},"delete":{"description":"Deletes a custom role (system roles cannot be deleted)","summary":"Delete a role","tags":["authorization"],"parameters":[{"name":"type","in":"path","required":true,"schema":{"type":"string","enum":["organization","partner","customer"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"roleId","in":"path","required":true,"schema":{"type":"string"}},{"name":"organizationId","in":"path","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success","message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"409":{"description":"409","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/authz/permissions/check":{"post":{"description":"Checks if a specific subject has permission to perform an action on a resource in a context","summary":"Check if a subject has permission for an action","tags":["authorization"],"parameters":[],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"resourceId":{"type":"string"},"contextType":{"type":"string","enum":["organization","partner","customer"]},"contextId":{"type":"string"}},"required":["resourceId","contextType","contextId"]}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"allowed":{"type":"boolean"}},"required":["allowed"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/authz/audit":{"get":{"description":"Returns paginated audit log of all permission-related changes","summary":"Get audit log for permission changes","tags":["authorization"],"parameters":[{"name":"page","in":"query","schema":{"default":1,"type":"number"}},{"name":"limit","in":"query","schema":{"default":50,"type":"number","minimum":1,"maximum":100}},{"name":"ctx","in":"query","style":"deepObject","schema":{"type":"object","properties":{"type":{"type":"string","enum":["organization","partner","customer"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"organizationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["type","id"]}},{"name":"subjectType","in":"query","schema":{"type":"string","enum":["user","api_key"]}},{"name":"subjectId","in":"query","schema":{"type":"string"}},{"name":"action","in":"query","schema":{"type":"string","enum":["assigned","revoked","role_created","role_deleted","permission_granted","permission_revoked"]}},{"name":"performedBy","in":"query","schema":{"type":"string"}},{"name":"startDate","in":"query","schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},{"name":"endDate","in":"query","schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"entries":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"action":{"type":"string","enum":["assigned","revoked","role_created","role_deleted","permission_granted","permission_revoked"]},"subjectType":{"type":"string","enum":["user","api_key"]},"subjectId":{"type":"string"},"roleId":{"type":"string"},"contextType":{"type":"string","enum":["organization","partner","customer"]},"contextId":{"type":"string"},"performedBy":{"type":"string"},"performedByType":{"anyOf":[{"type":"string","enum":["user","api_key"]},{"type":"string","const":"system"}]},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","action","performedBy","performedByType","createdAt"],"additionalProperties":false}},"page":{"type":"number"},"pageSize":{"type":"number"},"hasMore":{"type":"boolean"}},"required":["entries","page","pageSize","hasMore"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/authz/resources":{"get":{"description":"Returns paginated list of all resources stored in the authorization system","summary":"Get all stored resources","tags":["authorization"],"parameters":[{"name":"page","in":"query","schema":{"default":1,"type":"number"}},{"name":"limit","in":"query","schema":{"default":100,"type":"number","minimum":1,"maximum":1000}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"resources":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"method":{"type":"string"},"path":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"contextType":{"type":"string","enum":["organization","partner","customer"]},"parameters":{"type":"array","items":{"type":"string"}},"group":{"type":"string"}},"required":["id","method","path","contextType"],"additionalProperties":false}},"total":{"type":"number"},"page":{"type":"number"},"pageSize":{"type":"number"},"totalPages":{"type":"number"}},"required":["resources","total","page","pageSize","totalPages"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"500":{"description":"500","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/authz/subjects/{subjectType}/{subjectId}/assignments":{"get":{"description":"Returns all role assignments for a specific user or API key","summary":"Get all role assignments for a subject","tags":["authorization"],"parameters":[{"name":"subjectType","in":"path","required":true,"schema":{"type":"string","enum":["user","api_key"]}},{"name":"subjectId","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"type","in":"query","required":true,"schema":{"type":"string","enum":["organization","partner","customer"]}},{"name":"id","in":"query","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"organizationId","in":"query","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"assignments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"subjectType":{"type":"string","enum":["user","api_key"]},"subjectId":{"type":"string"},"roleId":{"type":"string"},"contextType":{"type":"string","enum":["organization","partner","customer"]},"contextId":{"type":"string"},"assignedBy":{"type":"string"},"assignedByType":{"anyOf":[{"type":"string","enum":["user","api_key"]},{"type":"string","const":"system"}]},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","subjectType","subjectId","roleId","contextType","contextId","assignedBy","assignedByType","createdAt","updatedAt"],"additionalProperties":false}},"subject":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"type":{"default":"user","type":"string","enum":["user","api_key"]},"externalUserId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Clerk user ID - null for invited users"},"firstName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"primaryEmail":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$","description":"Required for invitations"},"status":{"default":"active","type":"string","enum":["invited","active","disabled","revoked","expired"]},"clerkInvitationId":{"description":"Clerk invitation ID for tracking","type":["string","null"]},"invitedBy":{"description":"Subject ID of the inviter","type":["string","null"]},"invitedAt":{"description":"When invitation was sent","anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"expiresAt":{"description":"Invitation expiration","anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"disabledAt":{"description":"When user was disabled","anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"disabledBy":{"description":"Subject ID of admin who disabled","type":["string","null"]},"notes":{"description":"Notes such as disable reason","type":["string","null"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","type","externalUserId","firstName","lastName","primaryEmail","status","createdAt","updatedAt"],"additionalProperties":false}},"required":["assignments","subject"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/authz/subjects/{id}":{"get":{"description":"Returns subject metadata by internal subject ID","summary":"Get subject by ID","tags":["authorization"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"subject":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"type":{"default":"user","type":"string","enum":["user","api_key"]},"externalUserId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Clerk user ID - null for invited users"},"firstName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"primaryEmail":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$","description":"Required for invitations"},"status":{"default":"active","type":"string","enum":["invited","active","disabled","revoked","expired"]},"clerkInvitationId":{"description":"Clerk invitation ID for tracking","type":["string","null"]},"invitedBy":{"description":"Subject ID of the inviter","type":["string","null"]},"invitedAt":{"description":"When invitation was sent","anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"expiresAt":{"description":"Invitation expiration","anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"disabledAt":{"description":"When user was disabled","anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"disabledBy":{"description":"Subject ID of admin who disabled","type":["string","null"]},"notes":{"description":"Notes such as disable reason","type":["string","null"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","type","externalUserId","firstName","lastName","primaryEmail","status","createdAt","updatedAt"],"additionalProperties":false}},"required":["subject"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"500":{"description":"500","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}},"patch":{"description":"Updates subject metadata fields","summary":"Update subject metadata","tags":["authorization"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"externalUserId":{"type":"string","minLength":1},"firstName":{"type":"string","minLength":1},"lastName":{"type":"string","minLength":1},"primaryEmail":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"subject":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"type":{"default":"user","type":"string","enum":["user","api_key"]},"externalUserId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Clerk user ID - null for invited users"},"firstName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"primaryEmail":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$","description":"Required for invitations"},"status":{"default":"active","type":"string","enum":["invited","active","disabled","revoked","expired"]},"clerkInvitationId":{"description":"Clerk invitation ID for tracking","type":["string","null"]},"invitedBy":{"description":"Subject ID of the inviter","type":["string","null"]},"invitedAt":{"description":"When invitation was sent","anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"expiresAt":{"description":"Invitation expiration","anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"disabledAt":{"description":"When user was disabled","anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"disabledBy":{"description":"Subject ID of admin who disabled","type":["string","null"]},"notes":{"description":"Notes such as disable reason","type":["string","null"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","type","externalUserId","firstName","lastName","primaryEmail","status","createdAt","updatedAt"],"additionalProperties":false},"message":{"type":"string"}},"required":["subject","message"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"409":{"description":"409","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"500":{"description":"500","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}},"delete":{"description":"Deletes a subject record (only if no assignments exist)","summary":"Delete a subject","tags":["authorization"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success","message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"409":{"description":"409","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/authz/subjects/external/{externalUserId}":{"get":{"description":"Returns subject metadata by Clerk user ID","summary":"Get subject by external user ID","tags":["authorization"],"parameters":[{"name":"externalUserId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"subject":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"type":{"default":"user","type":"string","enum":["user","api_key"]},"externalUserId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Clerk user ID - null for invited users"},"firstName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"primaryEmail":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$","description":"Required for invitations"},"status":{"default":"active","type":"string","enum":["invited","active","disabled","revoked","expired"]},"clerkInvitationId":{"description":"Clerk invitation ID for tracking","type":["string","null"]},"invitedBy":{"description":"Subject ID of the inviter","type":["string","null"]},"invitedAt":{"description":"When invitation was sent","anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"expiresAt":{"description":"Invitation expiration","anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"disabledAt":{"description":"When user was disabled","anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"disabledBy":{"description":"Subject ID of admin who disabled","type":["string","null"]},"notes":{"description":"Notes such as disable reason","type":["string","null"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","type","externalUserId","firstName","lastName","primaryEmail","status","createdAt","updatedAt"],"additionalProperties":false}},"required":["subject"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"500":{"description":"500","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/authz/subjects/search":{"get":{"description":"Search subjects by name, email, or external user ID","summary":"Search subjects","tags":["authorization"],"parameters":[{"name":"q","in":"query","schema":{"type":"string"}},{"name":"page","in":"query","schema":{"default":1,"type":"number"}},{"name":"limit","in":"query","schema":{"default":50,"type":"number","minimum":1,"maximum":100}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"subjects":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"type":{"default":"user","type":"string","enum":["user","api_key"]},"externalUserId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Clerk user ID - null for invited users"},"firstName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"primaryEmail":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$","description":"Required for invitations"},"status":{"default":"active","type":"string","enum":["invited","active","disabled","revoked","expired"]},"clerkInvitationId":{"description":"Clerk invitation ID for tracking","type":["string","null"]},"invitedBy":{"description":"Subject ID of the inviter","type":["string","null"]},"invitedAt":{"description":"When invitation was sent","anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"expiresAt":{"description":"Invitation expiration","anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"disabledAt":{"description":"When user was disabled","anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"disabledBy":{"description":"Subject ID of admin who disabled","type":["string","null"]},"notes":{"description":"Notes such as disable reason","type":["string","null"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","type","externalUserId","firstName","lastName","primaryEmail","status","createdAt","updatedAt"],"additionalProperties":false}},"page":{"type":"number"},"pageSize":{"type":"number"},"hasMore":{"type":"boolean"}},"required":["subjects","page","pageSize","hasMore"],"additionalProperties":false}}}},"500":{"description":"500","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/authz/subjects/sync/clerk-user":{"post":{"description":"Sync user data from Clerk to the subjects table","summary":"Sync a single Clerk user","tags":["authorization"],"parameters":[],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"clerkUserId":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"primaryEmail":{"type":"string"}},"required":["clerkUserId"]}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"subject":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"type":{"default":"user","type":"string","enum":["user","api_key"]},"externalUserId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Clerk user ID - null for invited users"},"firstName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"primaryEmail":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$","description":"Required for invitations"},"status":{"default":"active","type":"string","enum":["invited","active","disabled","revoked","expired"]},"clerkInvitationId":{"description":"Clerk invitation ID for tracking","type":["string","null"]},"invitedBy":{"description":"Subject ID of the inviter","type":["string","null"]},"invitedAt":{"description":"When invitation was sent","anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"expiresAt":{"description":"Invitation expiration","anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"disabledAt":{"description":"When user was disabled","anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"disabledBy":{"description":"Subject ID of admin who disabled","type":["string","null"]},"notes":{"description":"Notes such as disable reason","type":["string","null"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","type","externalUserId","firstName","lastName","primaryEmail","status","createdAt","updatedAt"],"additionalProperties":false},"message":{"type":"string"}},"required":["success","message"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"500":{"description":"500","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/authz/subjects/sync/all-clerk-users":{"post":{"description":"Trigger a full sync of all users from Clerk (placeholder implementation)","summary":"Sync all Clerk users","tags":["authorization"],"parameters":[],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"stats":{"type":"object","properties":{"totalSubjects":{"type":"number"},"subjectsWithEmail":{"type":"number"},"subjectsWithNames":{"type":"number"}},"required":["totalSubjects","subjectsWithEmail","subjectsWithNames"],"additionalProperties":false}},"required":["success","message","stats"],"additionalProperties":false}}}}}}},"/api/v1/authz/subjects/sync/stats":{"get":{"description":"Get statistics about subject data synchronization","summary":"Get sync statistics","tags":["authorization"],"parameters":[],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"totalSubjects":{"type":"number"},"subjectsWithEmail":{"type":"number"},"subjectsWithNames":{"type":"number"},"lastSyncDate":{"type":"string"}},"required":["totalSubjects","subjectsWithEmail","subjectsWithNames"],"additionalProperties":false}}}}}}},"/api/v1/authz/contexts/{type}/{id}/invitations":{"get":{"description":"Returns paginated list of pending user invitations for the specified context","summary":"List pending invitations","tags":["authorization"],"parameters":[{"name":"type","in":"path","required":true,"schema":{"type":"string","enum":["organization","partner","customer"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"organizationId","in":"path","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"page","in":"query","schema":{"default":1,"type":"number"}},{"name":"limit","in":"query","schema":{"default":50,"type":"number","minimum":1,"maximum":100}},{"name":"status","in":"query","schema":{"default":"pending","type":"string","enum":["pending","expired","all"]}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"invitations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"email":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"status":{"type":"string"},"roles":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"invitedBySubjectId":{"type":["string","null"]},"invitedAt":{"type":["string","null"]},"expiresAt":{"type":["string","null"]}},"required":["id","email","status","roles"],"additionalProperties":false}},"total":{"type":"number"},"page":{"type":"number"},"pageSize":{"type":"number"},"totalPages":{"type":"number"}},"required":["invitations","total","page","pageSize","totalPages"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/authz/contexts/{type}/{id}/invitations/{subjectId}/resend":{"post":{"description":"Resends an invitation email to a user with a pending invitation","summary":"Resend invitation","tags":["authorization"],"parameters":[{"name":"type","in":"path","required":true,"schema":{"type":"string","enum":["organization","partner","customer"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"subjectId","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"organizationId","in":"path","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"newExpiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["success","message"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/authz/contexts/{type}/{id}/invitations/{subjectId}":{"delete":{"description":"Revokes a pending invitation and removes the subject from the context","summary":"Revoke invitation","tags":["authorization"],"parameters":[{"name":"type","in":"path","required":true,"schema":{"type":"string","enum":["organization","partner","customer"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"subjectId","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"organizationId","in":"path","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success","message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/authz/contexts/{type}/{id}/users/{subjectId}/disable":{"post":{"description":"Disables a user, preventing them from logging in","summary":"Disable user","tags":["authorization"],"parameters":[{"name":"type","in":"path","required":true,"schema":{"type":"string","enum":["organization","partner","customer"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"subjectId","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"organizationId","in":"path","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string"}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"disabledAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["success","message"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/authz/contexts/{type}/{id}/users/{subjectId}/enable":{"post":{"description":"Re-enables a previously disabled user, allowing them to log in again","summary":"Enable user","tags":["authorization"],"parameters":[{"name":"type","in":"path","required":true,"schema":{"type":"string","enum":["organization","partner","customer"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"subjectId","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"organizationId","in":"path","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success","message"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/transactions":{"get":{"description":"Search and retrieve transactions with pagination and filtering.","summary":"Search transactions","tags":["transactions"],"parameters":[{"name":"q","in":"query","schema":{"type":"string"}},{"name":"customerId","in":"query","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"sort","in":"query","schema":{"type":"string","enum":["asc","desc"]}},{"name":"page","in":"query","schema":{"default":1,"type":"number","minimum":1}},{"name":"limit","in":"query","schema":{"default":100,"type":"number","minimum":1}},{"name":"dateRange","in":"query","style":"deepObject","schema":{"type":"object","properties":{"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}}}},{"name":"refresh","in":"query","schema":{"type":"boolean"}},{"name":"manual","in":"query","schema":{"type":"boolean"}},{"name":"reconciliation","in":"query","description":"Filter transactions by their reconciliation outcome","schema":{"type":"string","enum":["open","mismatch","unresolved","matched"]}},{"name":"filters","in":"query","description":"Filters to apply, as `{ field, op, values }` entries","schema":{"type":"array","items":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"field":{"type":"string","enum":["state","statusCode","extStatusCode","statusMessage","paymentType","paymentOption","transactionType","rail","custodian","deviceType","appSlugId","customerName","txRefId","user.email","user.maskedAccount","user.countryCode","user.customerRefId","amount.amt","amount.cy","txAmount.amt","baseAmount.amt","txFee.amt","provider","providerAccount","providerTxId","providerFee.amt"]},"op":{"type":"string","enum":["eq","ne","in","nin","contains","notContains","startsWith","notStartsWith","gt","gte","lt","lte","isEmpty","isNotEmpty"]},"values":{"type":"array"}},"required":["field"],"description":"A single search filter"},"maxItems":25}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"organizationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"customerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"customerName":{"type":"string"},"applicationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"appSlugId":{"type":"string","minLength":3,"maxLength":256,"pattern":"^[a-z0-9-]+$"},"txRefId":{"type":"string","maxLength":255},"originTxId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"paymentType":{"type":"string","enum":["card","bank","ewallet","crypto","invoice","other"]},"paymentOption":{"type":"string","enum":["card","ideal","bancontact","paypal","klarna","pay-by-bank","apple-pay","google-pay","crypto-onramp","crypto-accept"]},"transactionType":{"type":"string","enum":["debit","credit","refund","auth","capture","void","cancel","chargeback","3ds"]},"state":{"type":"string","enum":["success","processing","waiting","approval","declined","unknown","error","cancelled"],"description":"Payment transaction state"},"statusCode":{"type":"string","enum":["approved","manually_approved","do_not_honor","suspected_fraud","invalid_trx","invalid_amt","invalid_account","invalid_response","no_transaction","restricted_card","insufficient_funds","expired_card","trx_not_permitted","exceeds_limit","exceeds_frequency","invalid_cvv","issuer_err","dest_not_found","psp_malfunction","psp_routing_error","unable_to_authorize","3ds_auth_failure","psp_limits_reached","psp_timeout","user_aborted_trx","avs_response","no_auth_corresponding","already_captured","already_cancelled","already_refunded","unknown_card","currency_not_supported","amt_over_max","amt_under_min","mobile_block","email_block","ip_block","bin_block","device_block","user_block","account_block","risk_block","duplicate_trx","already_chargedback","too_old_to_refund","no_partial_refund","partial_refund_over","redirect","redirect_timeout","blocked","processing","routing_error","system_error","psp_error","bad_request","other"],"description":"Harmonized response codes"},"extStatusCode":{"type":"string"},"statusMessage":{"type":"string"},"amount":{"type":"object","properties":{"amt":{"type":"string","pattern":"^-?(?:0|[1-9][0-9]{0,17})(?:\\.[0-9]{0,17}[1-9])?$","description":"Decimal amount as a canonical string"},"cy":{"type":"string","enum":["USD","EUR","GBP","JPY","CHF","CAD","AUD","SEK","NOK","DKK","PLN","CZK","HUF","RUB","CNY","INR","KRW","SGD","HKD","NZD","MXN","BRL","ZAR","TRY","ILS","THB","MYR","IDR","PHP","VND","JOD","KWD","BHD","OMR","TND","LYD","CLP","COP","PEN","ARS","UYU","EGP","MAD","NGN","KES","GHS","BWP","ZMW","UGX","TZS","ETB","RWF","MUR","SCR","BTC","ETH","LTC","BCH","XRP","ADA","DOT","LINK","XLM","DOGE","BNB","SOL","MATIC","AVAX","ATOM","ALGO","TRX","USDT","USDC","DAI"]}},"required":["amt","cy"],"additionalProperties":false,"description":"Monetary amount with currency, amount as a canonical decimal string"},"txAmount":{"type":"object","properties":{"amt":{"type":"string","pattern":"^-?(?:0|[1-9][0-9]{0,17})(?:\\.[0-9]{0,17}[1-9])?$","description":"Decimal amount as a canonical string"},"cy":{"type":"string","enum":["USD","EUR","GBP","JPY","CHF","CAD","AUD","SEK","NOK","DKK","PLN","CZK","HUF","RUB","CNY","INR","KRW","SGD","HKD","NZD","MXN","BRL","ZAR","TRY","ILS","THB","MYR","IDR","PHP","VND","JOD","KWD","BHD","OMR","TND","LYD","CLP","COP","PEN","ARS","UYU","EGP","MAD","NGN","KES","GHS","BWP","ZMW","UGX","TZS","ETB","RWF","MUR","SCR","BTC","ETH","LTC","BCH","XRP","ADA","DOT","LINK","XLM","DOGE","BNB","SOL","MATIC","AVAX","ATOM","ALGO","TRX","USDT","USDC","DAI"]}},"required":["amt","cy"],"additionalProperties":false,"description":"Monetary amount with currency, amount as a canonical decimal string"},"txFee":{"type":"object","properties":{"amt":{"type":"string","pattern":"^-?(?:0|[1-9][0-9]{0,17})(?:\\.[0-9]{0,17}[1-9])?$","description":"Decimal amount as a canonical string"},"cy":{"type":"string","enum":["USD","EUR","GBP","JPY","CHF","CAD","AUD","SEK","NOK","DKK","PLN","CZK","HUF","RUB","CNY","INR","KRW","SGD","HKD","NZD","MXN","BRL","ZAR","TRY","ILS","THB","MYR","IDR","PHP","VND","JOD","KWD","BHD","OMR","TND","LYD","CLP","COP","PEN","ARS","UYU","EGP","MAD","NGN","KES","GHS","BWP","ZMW","UGX","TZS","ETB","RWF","MUR","SCR","BTC","ETH","LTC","BCH","XRP","ADA","DOT","LINK","XLM","DOGE","BNB","SOL","MATIC","AVAX","ATOM","ALGO","TRX","USDT","USDC","DAI"]}},"required":["amt","cy"],"additionalProperties":false,"description":"Monetary amount with currency, amount as a canonical decimal string"},"providerFee":{"type":"object","properties":{"amt":{"type":"string","pattern":"^-?(?:0|[1-9][0-9]{0,17})(?:\\.[0-9]{0,17}[1-9])?$","description":"Decimal amount as a canonical string"},"cy":{"type":"string","enum":["USD","EUR","GBP","JPY","CHF","CAD","AUD","SEK","NOK","DKK","PLN","CZK","HUF","RUB","CNY","INR","KRW","SGD","HKD","NZD","MXN","BRL","ZAR","TRY","ILS","THB","MYR","IDR","PHP","VND","JOD","KWD","BHD","OMR","TND","LYD","CLP","COP","PEN","ARS","UYU","EGP","MAD","NGN","KES","GHS","BWP","ZMW","UGX","TZS","ETB","RWF","MUR","SCR","BTC","ETH","LTC","BCH","XRP","ADA","DOT","LINK","XLM","DOGE","BNB","SOL","MATIC","AVAX","ATOM","ALGO","TRX","USDT","USDC","DAI"]}},"required":["amt","cy"],"additionalProperties":false,"description":"Monetary amount with currency, amount as a canonical decimal string"},"baseAmount":{"type":"object","properties":{"amt":{"type":"string","pattern":"^-?(?:0|[1-9][0-9]{0,17})(?:\\.[0-9]{0,17}[1-9])?$","description":"Decimal amount as a canonical string"},"cy":{"type":"string","enum":["USD","EUR","GBP","JPY","CHF","CAD","AUD","SEK","NOK","DKK","PLN","CZK","HUF","RUB","CNY","INR","KRW","SGD","HKD","NZD","MXN","BRL","ZAR","TRY","ILS","THB","MYR","IDR","PHP","VND","JOD","KWD","BHD","OMR","TND","LYD","CLP","COP","PEN","ARS","UYU","EGP","MAD","NGN","KES","GHS","BWP","ZMW","UGX","TZS","ETB","RWF","MUR","SCR","BTC","ETH","LTC","BCH","XRP","ADA","DOT","LINK","XLM","DOGE","BNB","SOL","MATIC","AVAX","ATOM","ALGO","TRX","USDT","USDC","DAI"]}},"required":["amt","cy"],"additionalProperties":false,"description":"Monetary amount with currency, amount as a canonical decimal string"},"user":{"type":"object","properties":{"userId":{"type":"string"},"email":{"type":"string"},"maskedAccount":{"type":"string"},"countryCode":{"type":"string"},"customerRefId":{"type":"string"}},"additionalProperties":false},"provider":{"type":"string","minLength":3,"maxLength":256,"pattern":"^[a-z0-9-]+$"},"providerAccount":{"type":"string","minLength":3,"maxLength":256,"pattern":"^[a-z0-9-]+$"},"providerTxId":{"type":"string"},"providerUserId":{"type":"string"},"card":{"type":"object","properties":{"cardNumber":{"type":"string"},"cvv":{"type":"string"},"expiryMonth":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"expiryYear":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cardHolderName":{"type":"string"}},"required":["cardNumber"],"additionalProperties":false},"callbackUrl":{"type":"string","format":"uri"},"deviceType":{"type":"string","enum":["desktop","mobile","tablet","unknown"]},"rail":{"type":"string","enum":["visa","mastercard","amex","diners","discover","jcb","unionpay","maestro","elo","mir","hipercard","hiper","dankort","rupay","electron","sepa-ct","sepa-dd","sepa-inst","iban","swift","ideal","bancontact","faster-payments","bacs","ach","fedwire","paypal","klarna","apple-pay","google-pay","bitcoin","bitcoin-cash","litecoin","dogecoin","ethereum","arbitrum","base","polygon","optimism","bnb-smart-chain","avalanche","solana","tron","xrp-ledger","stellar","cardano","unknown"]},"custodian":{"type":"string","maxLength":100},"subjectId":{"type":"string"},"workflowId":{"type":"string"},"pendingRedirectUrl":{"type":"string"},"routingAttempts":{"type":"array","items":{"type":"object","properties":{"service":{"type":"string"},"slugId":{"type":"string"},"provider":{"type":"string"},"state":{"type":"string"},"statusCode":{"type":"string"},"statusMessage":{"type":"string"},"failedOver":{"type":"boolean"},"skipped":{"type":"boolean"},"providerTxId":{"type":"string"}},"required":["service","slugId"],"additionalProperties":false}},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["organizationId","customerId","id","createdAt","updatedAt"],"additionalProperties":false,"description":"Transaction data"}},"meta":{"type":"object","properties":{"page":{"type":"number"},"pageSize":{"type":"number"},"hasMore":{"type":"boolean"},"total":{"type":"number"}},"required":["page","pageSize","hasMore"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"401":{"description":"401","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"500":{"description":"500","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/transactions/{id}":{"get":{"description":"Retrieve a single transaction by its ID.","summary":"Get transaction by ID","tags":["transactions"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Transaction data","content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"customerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"customerName":{"type":"string"},"applicationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"appSlugId":{"type":"string","minLength":3,"maxLength":256,"pattern":"^[a-z0-9-]+$"},"txRefId":{"type":"string","maxLength":255},"originTxId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"paymentType":{"type":"string","enum":["card","bank","ewallet","crypto","invoice","other"]},"paymentOption":{"type":"string","enum":["card","ideal","bancontact","paypal","klarna","pay-by-bank","apple-pay","google-pay","crypto-onramp","crypto-accept"]},"transactionType":{"type":"string","enum":["debit","credit","refund","auth","capture","void","cancel","chargeback","3ds"]},"state":{"type":"string","enum":["success","processing","waiting","approval","declined","unknown","error","cancelled"],"description":"Payment transaction state"},"statusCode":{"type":"string","enum":["approved","manually_approved","do_not_honor","suspected_fraud","invalid_trx","invalid_amt","invalid_account","invalid_response","no_transaction","restricted_card","insufficient_funds","expired_card","trx_not_permitted","exceeds_limit","exceeds_frequency","invalid_cvv","issuer_err","dest_not_found","psp_malfunction","psp_routing_error","unable_to_authorize","3ds_auth_failure","psp_limits_reached","psp_timeout","user_aborted_trx","avs_response","no_auth_corresponding","already_captured","already_cancelled","already_refunded","unknown_card","currency_not_supported","amt_over_max","amt_under_min","mobile_block","email_block","ip_block","bin_block","device_block","user_block","account_block","risk_block","duplicate_trx","already_chargedback","too_old_to_refund","no_partial_refund","partial_refund_over","redirect","redirect_timeout","blocked","processing","routing_error","system_error","psp_error","bad_request","other"],"description":"Harmonized response codes"},"extStatusCode":{"type":"string"},"statusMessage":{"type":"string"},"amount":{"type":"object","properties":{"amt":{"type":"string","pattern":"^-?(?:0|[1-9][0-9]{0,17})(?:\\.[0-9]{0,17}[1-9])?$","description":"Decimal amount as a canonical string"},"cy":{"type":"string","enum":["USD","EUR","GBP","JPY","CHF","CAD","AUD","SEK","NOK","DKK","PLN","CZK","HUF","RUB","CNY","INR","KRW","SGD","HKD","NZD","MXN","BRL","ZAR","TRY","ILS","THB","MYR","IDR","PHP","VND","JOD","KWD","BHD","OMR","TND","LYD","CLP","COP","PEN","ARS","UYU","EGP","MAD","NGN","KES","GHS","BWP","ZMW","UGX","TZS","ETB","RWF","MUR","SCR","BTC","ETH","LTC","BCH","XRP","ADA","DOT","LINK","XLM","DOGE","BNB","SOL","MATIC","AVAX","ATOM","ALGO","TRX","USDT","USDC","DAI"]}},"required":["amt","cy"],"additionalProperties":false,"description":"Monetary amount with currency, amount as a canonical decimal string"},"txAmount":{"type":"object","properties":{"amt":{"type":"string","pattern":"^-?(?:0|[1-9][0-9]{0,17})(?:\\.[0-9]{0,17}[1-9])?$","description":"Decimal amount as a canonical string"},"cy":{"type":"string","enum":["USD","EUR","GBP","JPY","CHF","CAD","AUD","SEK","NOK","DKK","PLN","CZK","HUF","RUB","CNY","INR","KRW","SGD","HKD","NZD","MXN","BRL","ZAR","TRY","ILS","THB","MYR","IDR","PHP","VND","JOD","KWD","BHD","OMR","TND","LYD","CLP","COP","PEN","ARS","UYU","EGP","MAD","NGN","KES","GHS","BWP","ZMW","UGX","TZS","ETB","RWF","MUR","SCR","BTC","ETH","LTC","BCH","XRP","ADA","DOT","LINK","XLM","DOGE","BNB","SOL","MATIC","AVAX","ATOM","ALGO","TRX","USDT","USDC","DAI"]}},"required":["amt","cy"],"additionalProperties":false,"description":"Monetary amount with currency, amount as a canonical decimal string"},"txFee":{"type":"object","properties":{"amt":{"type":"string","pattern":"^-?(?:0|[1-9][0-9]{0,17})(?:\\.[0-9]{0,17}[1-9])?$","description":"Decimal amount as a canonical string"},"cy":{"type":"string","enum":["USD","EUR","GBP","JPY","CHF","CAD","AUD","SEK","NOK","DKK","PLN","CZK","HUF","RUB","CNY","INR","KRW","SGD","HKD","NZD","MXN","BRL","ZAR","TRY","ILS","THB","MYR","IDR","PHP","VND","JOD","KWD","BHD","OMR","TND","LYD","CLP","COP","PEN","ARS","UYU","EGP","MAD","NGN","KES","GHS","BWP","ZMW","UGX","TZS","ETB","RWF","MUR","SCR","BTC","ETH","LTC","BCH","XRP","ADA","DOT","LINK","XLM","DOGE","BNB","SOL","MATIC","AVAX","ATOM","ALGO","TRX","USDT","USDC","DAI"]}},"required":["amt","cy"],"additionalProperties":false,"description":"Monetary amount with currency, amount as a canonical decimal string"},"providerFee":{"type":"object","properties":{"amt":{"type":"string","pattern":"^-?(?:0|[1-9][0-9]{0,17})(?:\\.[0-9]{0,17}[1-9])?$","description":"Decimal amount as a canonical string"},"cy":{"type":"string","enum":["USD","EUR","GBP","JPY","CHF","CAD","AUD","SEK","NOK","DKK","PLN","CZK","HUF","RUB","CNY","INR","KRW","SGD","HKD","NZD","MXN","BRL","ZAR","TRY","ILS","THB","MYR","IDR","PHP","VND","JOD","KWD","BHD","OMR","TND","LYD","CLP","COP","PEN","ARS","UYU","EGP","MAD","NGN","KES","GHS","BWP","ZMW","UGX","TZS","ETB","RWF","MUR","SCR","BTC","ETH","LTC","BCH","XRP","ADA","DOT","LINK","XLM","DOGE","BNB","SOL","MATIC","AVAX","ATOM","ALGO","TRX","USDT","USDC","DAI"]}},"required":["amt","cy"],"additionalProperties":false,"description":"Monetary amount with currency, amount as a canonical decimal string"},"baseAmount":{"type":"object","properties":{"amt":{"type":"string","pattern":"^-?(?:0|[1-9][0-9]{0,17})(?:\\.[0-9]{0,17}[1-9])?$","description":"Decimal amount as a canonical string"},"cy":{"type":"string","enum":["USD","EUR","GBP","JPY","CHF","CAD","AUD","SEK","NOK","DKK","PLN","CZK","HUF","RUB","CNY","INR","KRW","SGD","HKD","NZD","MXN","BRL","ZAR","TRY","ILS","THB","MYR","IDR","PHP","VND","JOD","KWD","BHD","OMR","TND","LYD","CLP","COP","PEN","ARS","UYU","EGP","MAD","NGN","KES","GHS","BWP","ZMW","UGX","TZS","ETB","RWF","MUR","SCR","BTC","ETH","LTC","BCH","XRP","ADA","DOT","LINK","XLM","DOGE","BNB","SOL","MATIC","AVAX","ATOM","ALGO","TRX","USDT","USDC","DAI"]}},"required":["amt","cy"],"additionalProperties":false,"description":"Monetary amount with currency, amount as a canonical decimal string"},"user":{"type":"object","properties":{"userId":{"type":"string"},"email":{"type":"string"},"maskedAccount":{"type":"string"},"countryCode":{"type":"string"},"customerRefId":{"type":"string"}},"additionalProperties":false},"provider":{"type":"string","minLength":3,"maxLength":256,"pattern":"^[a-z0-9-]+$"},"providerAccount":{"type":"string","minLength":3,"maxLength":256,"pattern":"^[a-z0-9-]+$"},"providerTxId":{"type":"string"},"providerUserId":{"type":"string"},"card":{"type":"object","properties":{"cardNumber":{"type":"string"},"cvv":{"type":"string"},"expiryMonth":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"expiryYear":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cardHolderName":{"type":"string"}},"required":["cardNumber"],"additionalProperties":false},"callbackUrl":{"type":"string","format":"uri"},"deviceType":{"type":"string","enum":["desktop","mobile","tablet","unknown"]},"rail":{"type":"string","enum":["visa","mastercard","amex","diners","discover","jcb","unionpay","maestro","elo","mir","hipercard","hiper","dankort","rupay","electron","sepa-ct","sepa-dd","sepa-inst","iban","swift","ideal","bancontact","faster-payments","bacs","ach","fedwire","paypal","klarna","apple-pay","google-pay","bitcoin","bitcoin-cash","litecoin","dogecoin","ethereum","arbitrum","base","polygon","optimism","bnb-smart-chain","avalanche","solana","tron","xrp-ledger","stellar","cardano","unknown"]},"custodian":{"type":"string","maxLength":100},"subjectId":{"type":"string"},"workflowId":{"type":"string"},"pendingRedirectUrl":{"type":"string"},"routingAttempts":{"type":"array","items":{"type":"object","properties":{"service":{"type":"string"},"slugId":{"type":"string"},"provider":{"type":"string"},"state":{"type":"string"},"statusCode":{"type":"string"},"statusMessage":{"type":"string"},"failedOver":{"type":"boolean"},"skipped":{"type":"boolean"},"providerTxId":{"type":"string"}},"required":["service","slugId"],"additionalProperties":false}},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["organizationId","customerId","id","createdAt","updatedAt"],"additionalProperties":false,"description":"Transaction data"}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"401":{"description":"401","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"500":{"description":"500","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/transactions/{id}/workflow-steps":{"get":{"description":"Retrieve workflow step events for a specific transaction. Withheld in a customer context unless the organization runs as a gateway: the trace is the platform's internal processing record and names every provider it touched.","summary":"Get workflow steps for a transaction","tags":["transactions"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"timestamp":{"type":"string"},"workflowId":{"type":"string"},"workflowName":{"type":"string"},"stepName":{"type":"string"},"status":{"type":"string"},"data":{},"error":{"type":"string"},"completedAt":{"type":"string"},"durationMs":{"type":"number"},"order":{"type":"number"}},"required":["timestamp","workflowId","workflowName","stepName","status"],"additionalProperties":{},"description":"Workflow step event"}}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"401":{"description":"401","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"500":{"description":"500","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/transactions/export/csv":{"get":{"description":"Stream a CSV export of transactions matching the given filters.","summary":"Export transactions as CSV","tags":["transactions"],"parameters":[{"name":"q","in":"query","schema":{"type":"string"}},{"name":"customerId","in":"query","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"manual","in":"query","schema":{"type":"boolean"}},{"name":"dateRange","in":"query","style":"deepObject","schema":{"type":"object","properties":{"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}}}},{"name":"filters","in":"query","description":"Filters to apply, as `{ field, op, values }` entries","schema":{"type":"array","items":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"field":{"type":"string","enum":["state","statusCode","extStatusCode","statusMessage","paymentType","paymentOption","transactionType","rail","custodian","deviceType","appSlugId","customerName","txRefId","user.email","user.maskedAccount","user.countryCode","user.customerRefId","amount.amt","amount.cy","txAmount.amt","baseAmount.amt","txFee.amt","provider","providerAccount","providerTxId","providerFee.amt"]},"op":{"type":"string","enum":["eq","ne","in","nin","contains","notContains","startsWith","notStartsWith","gt","gte","lt","lte","isEmpty","isNotEmpty"]},"values":{"type":"array"}},"required":["field"],"description":"A single search filter"},"maxItems":25}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"401":{"description":"401","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"500":{"description":"500","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/api-adaptor-definitions":{"get":{"description":"List all available API Adaptor definitions that can be configured.","summary":"List API Adaptor Definitions","tags":["apiAdaptors"],"parameters":[],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"definitions":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"slugId":{"type":"string"},"providerApiUrl":{"type":"string","format":"uri"},"subdomain":{"type":"string"},"uiMetadata":{"type":"object","properties":{"icon":{"type":"string"},"category":{"type":"string"},"description":{"type":"string"},"providerKeyLabel":{"type":"string"}},"additionalProperties":false}},"required":["name","slugId","providerApiUrl","subdomain"],"additionalProperties":false}},"apiAdaptorDomain":{"type":"string"}},"required":["definitions","apiAdaptorDomain"],"additionalProperties":false}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"401":{"description":"401","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"500":{"description":"500","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/customers/{customerId}/api-adaptors":{"get":{"description":"List all API Adaptors for a customer.","summary":"List API Adaptors","tags":["apiAdaptors"],"parameters":[{"name":"customerId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"adaptorId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"ownerId":{"type":"string"},"name":{"type":"string","minLength":1},"definitionSlugId":{"type":"string","minLength":1},"providerApiKey":{"type":"string","minLength":1},"applicationId":{"type":"string","minLength":1},"babelpayApiKey":{"type":"string","minLength":1},"babelpayApiUrl":{"type":"string","format":"uri"},"trafficPercentage":{"type":"integer","minimum":0,"maximum":100},"routePatterns":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"disabledFallback":{"type":"string","enum":["decline","proxy"]},"fallbackOnBabelpayFailure":{"type":"string","enum":["none","proxy","babelpay"]},"fallbackOnBabelpayDecline":{"type":"string","enum":["none","proxy","babelpay"]},"fallbackOnProxyFailure":{"type":"string","enum":["none","proxy","babelpay"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["adaptorId","ownerId","name","definitionSlugId","providerApiKey","applicationId","babelpayApiKey","babelpayApiUrl","trafficPercentage","enabled","createdAt","updatedAt"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"401":{"description":"401","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"500":{"description":"500","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}},"post":{"description":"Create a new API Adaptor for a customer.","summary":"Create API Adaptor","tags":["apiAdaptors"],"parameters":[{"name":"customerId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"definitionSlugId":{"type":"string","minLength":1},"providerApiKey":{"type":"string","minLength":1},"applicationId":{"type":"string","minLength":1},"trafficPercentage":{"type":"integer","minimum":0,"maximum":100},"routePatterns":{"type":"array","items":{"type":"string"}},"disabledFallback":{"type":"string","enum":["decline","proxy"]},"fallbackOnBabelpayFailure":{"type":"string","enum":["none","proxy","babelpay"]},"fallbackOnBabelpayDecline":{"type":"string","enum":["none","proxy","babelpay"]},"fallbackOnProxyFailure":{"type":"string","enum":["none","proxy","babelpay"]}},"required":["name","definitionSlugId","providerApiKey","applicationId","trafficPercentage"]}}}},"responses":{"201":{"description":"201","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"adaptorId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"ownerId":{"type":"string"},"name":{"type":"string","minLength":1},"definitionSlugId":{"type":"string","minLength":1},"providerApiKey":{"type":"string","minLength":1},"applicationId":{"type":"string","minLength":1},"babelpayApiKey":{"type":"string","minLength":1},"babelpayApiUrl":{"type":"string","format":"uri"},"trafficPercentage":{"type":"integer","minimum":0,"maximum":100},"routePatterns":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"disabledFallback":{"type":"string","enum":["decline","proxy"]},"fallbackOnBabelpayFailure":{"type":"string","enum":["none","proxy","babelpay"]},"fallbackOnBabelpayDecline":{"type":"string","enum":["none","proxy","babelpay"]},"fallbackOnProxyFailure":{"type":"string","enum":["none","proxy","babelpay"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["adaptorId","ownerId","name","definitionSlugId","providerApiKey","applicationId","babelpayApiKey","babelpayApiUrl","trafficPercentage","enabled","createdAt","updatedAt"],"additionalProperties":false}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"401":{"description":"401","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"500":{"description":"500","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/customers/{customerId}/api-adaptors/{adaptorId}":{"get":{"description":"Get a single API Adaptor by ID.","summary":"Get API Adaptor","tags":["apiAdaptors"],"parameters":[{"name":"customerId","in":"path","required":true,"schema":{"type":"string"}},{"name":"adaptorId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"adaptorId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"ownerId":{"type":"string"},"name":{"type":"string","minLength":1},"definitionSlugId":{"type":"string","minLength":1},"providerApiKey":{"type":"string","minLength":1},"applicationId":{"type":"string","minLength":1},"babelpayApiKey":{"type":"string","minLength":1},"babelpayApiUrl":{"type":"string","format":"uri"},"trafficPercentage":{"type":"integer","minimum":0,"maximum":100},"routePatterns":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"disabledFallback":{"type":"string","enum":["decline","proxy"]},"fallbackOnBabelpayFailure":{"type":"string","enum":["none","proxy","babelpay"]},"fallbackOnBabelpayDecline":{"type":"string","enum":["none","proxy","babelpay"]},"fallbackOnProxyFailure":{"type":"string","enum":["none","proxy","babelpay"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["adaptorId","ownerId","name","definitionSlugId","providerApiKey","applicationId","babelpayApiKey","babelpayApiUrl","trafficPercentage","enabled","createdAt","updatedAt"],"additionalProperties":false}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"401":{"description":"401","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"500":{"description":"500","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}},"patch":{"description":"Update an existing API Adaptor.","summary":"Update API Adaptor","tags":["apiAdaptors"],"parameters":[{"name":"customerId","in":"path","required":true,"schema":{"type":"string"}},{"name":"adaptorId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"definitionSlugId":{"type":"string","minLength":1},"providerApiKey":{"type":"string","minLength":1},"applicationId":{"type":"string","minLength":1},"trafficPercentage":{"type":"integer","minimum":0,"maximum":100},"routePatterns":{"type":"array","items":{"type":"string"}},"disabledFallback":{"type":"string","enum":["decline","proxy"]},"fallbackOnBabelpayFailure":{"type":"string","enum":["none","proxy","babelpay"]},"fallbackOnBabelpayDecline":{"type":"string","enum":["none","proxy","babelpay"]},"fallbackOnProxyFailure":{"type":"string","enum":["none","proxy","babelpay"]}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"adaptorId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"ownerId":{"type":"string"},"name":{"type":"string","minLength":1},"definitionSlugId":{"type":"string","minLength":1},"providerApiKey":{"type":"string","minLength":1},"applicationId":{"type":"string","minLength":1},"babelpayApiKey":{"type":"string","minLength":1},"babelpayApiUrl":{"type":"string","format":"uri"},"trafficPercentage":{"type":"integer","minimum":0,"maximum":100},"routePatterns":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"disabledFallback":{"type":"string","enum":["decline","proxy"]},"fallbackOnBabelpayFailure":{"type":"string","enum":["none","proxy","babelpay"]},"fallbackOnBabelpayDecline":{"type":"string","enum":["none","proxy","babelpay"]},"fallbackOnProxyFailure":{"type":"string","enum":["none","proxy","babelpay"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["adaptorId","ownerId","name","definitionSlugId","providerApiKey","applicationId","babelpayApiKey","babelpayApiUrl","trafficPercentage","enabled","createdAt","updatedAt"],"additionalProperties":false}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"401":{"description":"401","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"500":{"description":"500","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}},"delete":{"description":"Delete an API Adaptor.","summary":"Delete API Adaptor","tags":["apiAdaptors"],"parameters":[{"name":"customerId","in":"path","required":true,"schema":{"type":"string"}},{"name":"adaptorId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"deleted":{"type":"boolean"}},"required":["deleted"],"additionalProperties":false}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"401":{"description":"401","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"500":{"description":"500","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/customers/{customerId}/api-adaptors/{adaptorId}/enable":{"post":{"description":"Enable an API Adaptor.","summary":"Enable API Adaptor","tags":["apiAdaptors"],"parameters":[{"name":"customerId","in":"path","required":true,"schema":{"type":"string"}},{"name":"adaptorId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"adaptorId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"ownerId":{"type":"string"},"name":{"type":"string","minLength":1},"definitionSlugId":{"type":"string","minLength":1},"providerApiKey":{"type":"string","minLength":1},"applicationId":{"type":"string","minLength":1},"babelpayApiKey":{"type":"string","minLength":1},"babelpayApiUrl":{"type":"string","format":"uri"},"trafficPercentage":{"type":"integer","minimum":0,"maximum":100},"routePatterns":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"disabledFallback":{"type":"string","enum":["decline","proxy"]},"fallbackOnBabelpayFailure":{"type":"string","enum":["none","proxy","babelpay"]},"fallbackOnBabelpayDecline":{"type":"string","enum":["none","proxy","babelpay"]},"fallbackOnProxyFailure":{"type":"string","enum":["none","proxy","babelpay"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["adaptorId","ownerId","name","definitionSlugId","providerApiKey","applicationId","babelpayApiKey","babelpayApiUrl","trafficPercentage","enabled","createdAt","updatedAt"],"additionalProperties":false}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"401":{"description":"401","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"500":{"description":"500","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/customers/{customerId}/api-adaptors/{adaptorId}/disable":{"post":{"description":"Disable an API Adaptor.","summary":"Disable API Adaptor","tags":["apiAdaptors"],"parameters":[{"name":"customerId","in":"path","required":true,"schema":{"type":"string"}},{"name":"adaptorId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"adaptorId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"ownerId":{"type":"string"},"name":{"type":"string","minLength":1},"definitionSlugId":{"type":"string","minLength":1},"providerApiKey":{"type":"string","minLength":1},"applicationId":{"type":"string","minLength":1},"babelpayApiKey":{"type":"string","minLength":1},"babelpayApiUrl":{"type":"string","format":"uri"},"trafficPercentage":{"type":"integer","minimum":0,"maximum":100},"routePatterns":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"disabledFallback":{"type":"string","enum":["decline","proxy"]},"fallbackOnBabelpayFailure":{"type":"string","enum":["none","proxy","babelpay"]},"fallbackOnBabelpayDecline":{"type":"string","enum":["none","proxy","babelpay"]},"fallbackOnProxyFailure":{"type":"string","enum":["none","proxy","babelpay"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["adaptorId","ownerId","name","definitionSlugId","providerApiKey","applicationId","babelpayApiKey","babelpayApiUrl","trafficPercentage","enabled","createdAt","updatedAt"],"additionalProperties":false}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"401":{"description":"401","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"500":{"description":"500","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/reconciliations":{"get":{"description":"Search transaction reconciliation records. Defaults to open findings (mismatch/unresolved with no resolution) when `openOnly` is set.","summary":"Search reconciliation records","tags":["reconciliations"],"parameters":[{"name":"q","in":"query","schema":{"type":"string"}},{"name":"customerId","in":"query","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"sort","in":"query","schema":{"type":"string","enum":["asc","desc"]}},{"name":"page","in":"query","schema":{"default":1,"type":"number","minimum":1}},{"name":"limit","in":"query","schema":{"default":100,"type":"number","minimum":1}},{"name":"dateRange","in":"query","style":"deepObject","schema":{"type":"object","properties":{"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}}}},{"name":"refresh","in":"query","schema":{"type":"boolean"}},{"name":"openOnly","in":"query","schema":{"type":"boolean"}},{"name":"filters","in":"query","description":"Filters to apply, as `{ field, op, values }` entries","schema":{"type":"array","items":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"field":{"type":"string","enum":["status","severity","mismatchKind","resolution","transactionType","provider","providerAccount","providerTxId","transactionId","appSlugId","customerName","localState","localStatusCode","providerState","providerStatusCode","providerExtStatusCode","duplicateGroup","lastError","attempts","amount.amt","amount.cy"]},"op":{"type":"string","enum":["eq","ne","in","nin","contains","notContains","startsWith","notStartsWith","gt","gte","lt","lte","isEmpty","isNotEmpty"]},"values":{"type":"array"}},"required":["field"],"description":"A single search filter"},"maxItems":25}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"transactionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"attemptNo":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"organizationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"customerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"appSlugId":{"type":"string","minLength":3,"maxLength":256,"pattern":"^[a-z0-9-]+$"},"provider":{"type":"string","minLength":3,"maxLength":256,"pattern":"^[a-z0-9-]+$"},"providerAccount":{"type":"string","minLength":3,"maxLength":256,"pattern":"^[a-z0-9-]+$"},"providerTxId":{"type":"string"},"localState":{"type":"string","enum":["success","processing","waiting","approval","declined","unknown","error","cancelled"],"description":"Payment transaction state"},"localStatusCode":{"type":"string","enum":["approved","manually_approved","do_not_honor","suspected_fraud","invalid_trx","invalid_amt","invalid_account","invalid_response","no_transaction","restricted_card","insufficient_funds","expired_card","trx_not_permitted","exceeds_limit","exceeds_frequency","invalid_cvv","issuer_err","dest_not_found","psp_malfunction","psp_routing_error","unable_to_authorize","3ds_auth_failure","psp_limits_reached","psp_timeout","user_aborted_trx","avs_response","no_auth_corresponding","already_captured","already_cancelled","already_refunded","unknown_card","currency_not_supported","amt_over_max","amt_under_min","mobile_block","email_block","ip_block","bin_block","device_block","user_block","account_block","risk_block","duplicate_trx","already_chargedback","too_old_to_refund","no_partial_refund","partial_refund_over","redirect","redirect_timeout","blocked","processing","routing_error","system_error","psp_error","bad_request","other"],"description":"Harmonized response codes"},"providerState":{"type":"string","enum":["success","processing","waiting","approval","declined","unknown","error","cancelled"],"description":"Payment transaction state"},"providerStatusCode":{"type":"string","enum":["approved","manually_approved","do_not_honor","suspected_fraud","invalid_trx","invalid_amt","invalid_account","invalid_response","no_transaction","restricted_card","insufficient_funds","expired_card","trx_not_permitted","exceeds_limit","exceeds_frequency","invalid_cvv","issuer_err","dest_not_found","psp_malfunction","psp_routing_error","unable_to_authorize","3ds_auth_failure","psp_limits_reached","psp_timeout","user_aborted_trx","avs_response","no_auth_corresponding","already_captured","already_cancelled","already_refunded","unknown_card","currency_not_supported","amt_over_max","amt_under_min","mobile_block","email_block","ip_block","bin_block","device_block","user_block","account_block","risk_block","duplicate_trx","already_chargedback","too_old_to_refund","no_partial_refund","partial_refund_over","redirect","redirect_timeout","blocked","processing","routing_error","system_error","psp_error","bad_request","other"],"description":"Harmonized response codes"},"providerExtStatusCode":{"type":"string"},"providerResponse":{},"providerTimestamp":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"providerOrderId":{"type":"string"},"duplicateGroup":{"type":"string"},"localRecordCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"providerRecordCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amount":{"type":"object","properties":{"amt":{"type":"string","pattern":"^-?(?:0|[1-9][0-9]{0,17})(?:\\.[0-9]{0,17}[1-9])?$","description":"Decimal amount as a canonical string"},"cy":{"type":"string","enum":["USD","EUR","GBP","JPY","CHF","CAD","AUD","SEK","NOK","DKK","PLN","CZK","HUF","RUB","CNY","INR","KRW","SGD","HKD","NZD","MXN","BRL","ZAR","TRY","ILS","THB","MYR","IDR","PHP","VND","JOD","KWD","BHD","OMR","TND","LYD","CLP","COP","PEN","ARS","UYU","EGP","MAD","NGN","KES","GHS","BWP","ZMW","UGX","TZS","ETB","RWF","MUR","SCR","BTC","ETH","LTC","BCH","XRP","ADA","DOT","LINK","XLM","DOGE","BNB","SOL","MATIC","AVAX","ATOM","ALGO","TRX","USDT","USDC","DAI"]}},"required":["amt","cy"],"additionalProperties":false,"description":"Monetary amount with currency, amount as a canonical decimal string"},"transactionCreatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"transactionType":{"type":"string","enum":["debit","credit","refund","auth","capture","void","cancel","chargeback","3ds"]},"customerName":{"type":"string"},"status":{"type":"string","enum":["pending","matched","repaired","mismatch","unresolved","skipped","error"],"description":"Reconciliation record status"},"mismatchKind":{"type":"string","enum":["local_success_provider_failed","local_success_provider_stuck","local_failed_provider_success","local_pending_provider_final","state_drift","duplicate_local","duplicate_provider","abandoned_attempt_double_charge","abandoned_attempt_stranded"],"description":"Kind of disagreement between our record and the provider's"},"severity":{"type":"string","enum":["critical","high","low"],"description":"Operational severity of a mismatch"},"attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"nextCheckAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"lastCheckedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"lastError":{"type":"string"},"resolution":{"type":"string","enum":["auto_repaired","corrected","dismissed"],"description":"How a reconciliation finding was resolved"},"resolvedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"resolvedBy":{"type":"string"},"resolutionNote":{"type":"string"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","transactionId","attemptNo","status","attempts","createdAt","updatedAt"],"additionalProperties":false,"description":"Reconciliation record for a single transaction"}},"meta":{"type":"object","properties":{"page":{"type":"number"},"pageSize":{"type":"number"},"hasMore":{"type":"boolean"},"total":{"type":"number"}},"required":["page","pageSize","hasMore"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"401":{"description":"401","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"500":{"description":"500","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/reconciliations/summary":{"get":{"description":"Aggregate open-finding counts by severity for the caller's context.","summary":"Reconciliation summary counts","tags":["reconciliations"],"parameters":[],"responses":{"200":{"description":"Aggregate reconciliation counts for the caller's context","content":{"application/json":{"schema":{"type":"object","properties":{"critical":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"high":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"low":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"open":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastSweptAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["critical","high","low","open"],"additionalProperties":false,"description":"Aggregate reconciliation counts for the caller's context"}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"401":{"description":"401","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"500":{"description":"500","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/reconciliations/flags":{"post":{"description":"Return reconciliation flags for the given transaction ids, for decorating a transactions list page.","summary":"Batch reconciliation flags","tags":["reconciliations"],"parameters":[],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"transactionIds":{"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["transactionIds"]}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"transactionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["pending","matched","repaired","mismatch","unresolved","skipped","error"],"description":"Reconciliation record status"},"mismatchKind":{"type":"string","enum":["local_success_provider_failed","local_success_provider_stuck","local_failed_provider_success","local_pending_provider_final","state_drift","duplicate_local","duplicate_provider","abandoned_attempt_double_charge","abandoned_attempt_stranded"],"description":"Kind of disagreement between our record and the provider's"},"severity":{"type":"string","enum":["critical","high","low"],"description":"Operational severity of a mismatch"},"providerState":{"type":"string","enum":["success","processing","waiting","approval","declined","unknown","error","cancelled"],"description":"Payment transaction state"}},"required":["transactionId","status"],"additionalProperties":false}}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"401":{"description":"401","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"500":{"description":"500","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/reconciliations/transaction/{transactionId}":{"get":{"summary":"Get a transaction's reconciliation findings, one per attempt","tags":["reconciliations"],"parameters":[{"name":"transactionId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"transactionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"attemptNo":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"organizationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"customerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"appSlugId":{"type":"string","minLength":3,"maxLength":256,"pattern":"^[a-z0-9-]+$"},"provider":{"type":"string","minLength":3,"maxLength":256,"pattern":"^[a-z0-9-]+$"},"providerAccount":{"type":"string","minLength":3,"maxLength":256,"pattern":"^[a-z0-9-]+$"},"providerTxId":{"type":"string"},"localState":{"type":"string","enum":["success","processing","waiting","approval","declined","unknown","error","cancelled"],"description":"Payment transaction state"},"localStatusCode":{"type":"string","enum":["approved","manually_approved","do_not_honor","suspected_fraud","invalid_trx","invalid_amt","invalid_account","invalid_response","no_transaction","restricted_card","insufficient_funds","expired_card","trx_not_permitted","exceeds_limit","exceeds_frequency","invalid_cvv","issuer_err","dest_not_found","psp_malfunction","psp_routing_error","unable_to_authorize","3ds_auth_failure","psp_limits_reached","psp_timeout","user_aborted_trx","avs_response","no_auth_corresponding","already_captured","already_cancelled","already_refunded","unknown_card","currency_not_supported","amt_over_max","amt_under_min","mobile_block","email_block","ip_block","bin_block","device_block","user_block","account_block","risk_block","duplicate_trx","already_chargedback","too_old_to_refund","no_partial_refund","partial_refund_over","redirect","redirect_timeout","blocked","processing","routing_error","system_error","psp_error","bad_request","other"],"description":"Harmonized response codes"},"providerState":{"type":"string","enum":["success","processing","waiting","approval","declined","unknown","error","cancelled"],"description":"Payment transaction state"},"providerStatusCode":{"type":"string","enum":["approved","manually_approved","do_not_honor","suspected_fraud","invalid_trx","invalid_amt","invalid_account","invalid_response","no_transaction","restricted_card","insufficient_funds","expired_card","trx_not_permitted","exceeds_limit","exceeds_frequency","invalid_cvv","issuer_err","dest_not_found","psp_malfunction","psp_routing_error","unable_to_authorize","3ds_auth_failure","psp_limits_reached","psp_timeout","user_aborted_trx","avs_response","no_auth_corresponding","already_captured","already_cancelled","already_refunded","unknown_card","currency_not_supported","amt_over_max","amt_under_min","mobile_block","email_block","ip_block","bin_block","device_block","user_block","account_block","risk_block","duplicate_trx","already_chargedback","too_old_to_refund","no_partial_refund","partial_refund_over","redirect","redirect_timeout","blocked","processing","routing_error","system_error","psp_error","bad_request","other"],"description":"Harmonized response codes"},"providerExtStatusCode":{"type":"string"},"providerResponse":{},"providerTimestamp":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"providerOrderId":{"type":"string"},"duplicateGroup":{"type":"string"},"localRecordCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"providerRecordCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amount":{"type":"object","properties":{"amt":{"type":"string","pattern":"^-?(?:0|[1-9][0-9]{0,17})(?:\\.[0-9]{0,17}[1-9])?$","description":"Decimal amount as a canonical string"},"cy":{"type":"string","enum":["USD","EUR","GBP","JPY","CHF","CAD","AUD","SEK","NOK","DKK","PLN","CZK","HUF","RUB","CNY","INR","KRW","SGD","HKD","NZD","MXN","BRL","ZAR","TRY","ILS","THB","MYR","IDR","PHP","VND","JOD","KWD","BHD","OMR","TND","LYD","CLP","COP","PEN","ARS","UYU","EGP","MAD","NGN","KES","GHS","BWP","ZMW","UGX","TZS","ETB","RWF","MUR","SCR","BTC","ETH","LTC","BCH","XRP","ADA","DOT","LINK","XLM","DOGE","BNB","SOL","MATIC","AVAX","ATOM","ALGO","TRX","USDT","USDC","DAI"]}},"required":["amt","cy"],"additionalProperties":false,"description":"Monetary amount with currency, amount as a canonical decimal string"},"transactionCreatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"transactionType":{"type":"string","enum":["debit","credit","refund","auth","capture","void","cancel","chargeback","3ds"]},"customerName":{"type":"string"},"status":{"type":"string","enum":["pending","matched","repaired","mismatch","unresolved","skipped","error"],"description":"Reconciliation record status"},"mismatchKind":{"type":"string","enum":["local_success_provider_failed","local_success_provider_stuck","local_failed_provider_success","local_pending_provider_final","state_drift","duplicate_local","duplicate_provider","abandoned_attempt_double_charge","abandoned_attempt_stranded"],"description":"Kind of disagreement between our record and the provider's"},"severity":{"type":"string","enum":["critical","high","low"],"description":"Operational severity of a mismatch"},"attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"nextCheckAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"lastCheckedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"lastError":{"type":"string"},"resolution":{"type":"string","enum":["auto_repaired","corrected","dismissed"],"description":"How a reconciliation finding was resolved"},"resolvedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"resolvedBy":{"type":"string"},"resolutionNote":{"type":"string"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","transactionId","attemptNo","status","attempts","createdAt","updatedAt"],"additionalProperties":false,"description":"Reconciliation record for a single transaction"}}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"401":{"description":"401","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"500":{"description":"500","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/reconciliations/transaction/{transactionId}/check":{"post":{"description":"Performs an immediate provider status lookup for each of the transaction's routing attempts — the winning one and any the failover cascade walked away from — and records the outcomes. Returns one finding per attempt, winner first. Safe: never applies a final-state correction, and an abandoned attempt never writes to the transaction at all.","summary":"Check every attempt of a transaction against its provider now","tags":["reconciliations"],"parameters":[{"name":"transactionId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"transactionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"attemptNo":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"organizationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"customerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"appSlugId":{"type":"string","minLength":3,"maxLength":256,"pattern":"^[a-z0-9-]+$"},"provider":{"type":"string","minLength":3,"maxLength":256,"pattern":"^[a-z0-9-]+$"},"providerAccount":{"type":"string","minLength":3,"maxLength":256,"pattern":"^[a-z0-9-]+$"},"providerTxId":{"type":"string"},"localState":{"type":"string","enum":["success","processing","waiting","approval","declined","unknown","error","cancelled"],"description":"Payment transaction state"},"localStatusCode":{"type":"string","enum":["approved","manually_approved","do_not_honor","suspected_fraud","invalid_trx","invalid_amt","invalid_account","invalid_response","no_transaction","restricted_card","insufficient_funds","expired_card","trx_not_permitted","exceeds_limit","exceeds_frequency","invalid_cvv","issuer_err","dest_not_found","psp_malfunction","psp_routing_error","unable_to_authorize","3ds_auth_failure","psp_limits_reached","psp_timeout","user_aborted_trx","avs_response","no_auth_corresponding","already_captured","already_cancelled","already_refunded","unknown_card","currency_not_supported","amt_over_max","amt_under_min","mobile_block","email_block","ip_block","bin_block","device_block","user_block","account_block","risk_block","duplicate_trx","already_chargedback","too_old_to_refund","no_partial_refund","partial_refund_over","redirect","redirect_timeout","blocked","processing","routing_error","system_error","psp_error","bad_request","other"],"description":"Harmonized response codes"},"providerState":{"type":"string","enum":["success","processing","waiting","approval","declined","unknown","error","cancelled"],"description":"Payment transaction state"},"providerStatusCode":{"type":"string","enum":["approved","manually_approved","do_not_honor","suspected_fraud","invalid_trx","invalid_amt","invalid_account","invalid_response","no_transaction","restricted_card","insufficient_funds","expired_card","trx_not_permitted","exceeds_limit","exceeds_frequency","invalid_cvv","issuer_err","dest_not_found","psp_malfunction","psp_routing_error","unable_to_authorize","3ds_auth_failure","psp_limits_reached","psp_timeout","user_aborted_trx","avs_response","no_auth_corresponding","already_captured","already_cancelled","already_refunded","unknown_card","currency_not_supported","amt_over_max","amt_under_min","mobile_block","email_block","ip_block","bin_block","device_block","user_block","account_block","risk_block","duplicate_trx","already_chargedback","too_old_to_refund","no_partial_refund","partial_refund_over","redirect","redirect_timeout","blocked","processing","routing_error","system_error","psp_error","bad_request","other"],"description":"Harmonized response codes"},"providerExtStatusCode":{"type":"string"},"providerResponse":{},"providerTimestamp":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"providerOrderId":{"type":"string"},"duplicateGroup":{"type":"string"},"localRecordCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"providerRecordCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amount":{"type":"object","properties":{"amt":{"type":"string","pattern":"^-?(?:0|[1-9][0-9]{0,17})(?:\\.[0-9]{0,17}[1-9])?$","description":"Decimal amount as a canonical string"},"cy":{"type":"string","enum":["USD","EUR","GBP","JPY","CHF","CAD","AUD","SEK","NOK","DKK","PLN","CZK","HUF","RUB","CNY","INR","KRW","SGD","HKD","NZD","MXN","BRL","ZAR","TRY","ILS","THB","MYR","IDR","PHP","VND","JOD","KWD","BHD","OMR","TND","LYD","CLP","COP","PEN","ARS","UYU","EGP","MAD","NGN","KES","GHS","BWP","ZMW","UGX","TZS","ETB","RWF","MUR","SCR","BTC","ETH","LTC","BCH","XRP","ADA","DOT","LINK","XLM","DOGE","BNB","SOL","MATIC","AVAX","ATOM","ALGO","TRX","USDT","USDC","DAI"]}},"required":["amt","cy"],"additionalProperties":false,"description":"Monetary amount with currency, amount as a canonical decimal string"},"transactionCreatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"transactionType":{"type":"string","enum":["debit","credit","refund","auth","capture","void","cancel","chargeback","3ds"]},"customerName":{"type":"string"},"status":{"type":"string","enum":["pending","matched","repaired","mismatch","unresolved","skipped","error"],"description":"Reconciliation record status"},"mismatchKind":{"type":"string","enum":["local_success_provider_failed","local_success_provider_stuck","local_failed_provider_success","local_pending_provider_final","state_drift","duplicate_local","duplicate_provider","abandoned_attempt_double_charge","abandoned_attempt_stranded"],"description":"Kind of disagreement between our record and the provider's"},"severity":{"type":"string","enum":["critical","high","low"],"description":"Operational severity of a mismatch"},"attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"nextCheckAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"lastCheckedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"lastError":{"type":"string"},"resolution":{"type":"string","enum":["auto_repaired","corrected","dismissed"],"description":"How a reconciliation finding was resolved"},"resolvedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"resolvedBy":{"type":"string"},"resolutionNote":{"type":"string"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","transactionId","attemptNo","status","attempts","createdAt","updatedAt"],"additionalProperties":false,"description":"Reconciliation record for a single transaction"}}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"401":{"description":"401","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"500":{"description":"500","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/reconciliations/check":{"post":{"summary":"Check several transactions against their providers now","tags":["reconciliations"],"parameters":[],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"transactionIds":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["transactionIds"]}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"checked":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"records":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"transactionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"attemptNo":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"organizationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"customerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"appSlugId":{"type":"string","minLength":3,"maxLength":256,"pattern":"^[a-z0-9-]+$"},"provider":{"type":"string","minLength":3,"maxLength":256,"pattern":"^[a-z0-9-]+$"},"providerAccount":{"type":"string","minLength":3,"maxLength":256,"pattern":"^[a-z0-9-]+$"},"providerTxId":{"type":"string"},"localState":{"type":"string","enum":["success","processing","waiting","approval","declined","unknown","error","cancelled"],"description":"Payment transaction state"},"localStatusCode":{"type":"string","enum":["approved","manually_approved","do_not_honor","suspected_fraud","invalid_trx","invalid_amt","invalid_account","invalid_response","no_transaction","restricted_card","insufficient_funds","expired_card","trx_not_permitted","exceeds_limit","exceeds_frequency","invalid_cvv","issuer_err","dest_not_found","psp_malfunction","psp_routing_error","unable_to_authorize","3ds_auth_failure","psp_limits_reached","psp_timeout","user_aborted_trx","avs_response","no_auth_corresponding","already_captured","already_cancelled","already_refunded","unknown_card","currency_not_supported","amt_over_max","amt_under_min","mobile_block","email_block","ip_block","bin_block","device_block","user_block","account_block","risk_block","duplicate_trx","already_chargedback","too_old_to_refund","no_partial_refund","partial_refund_over","redirect","redirect_timeout","blocked","processing","routing_error","system_error","psp_error","bad_request","other"],"description":"Harmonized response codes"},"providerState":{"type":"string","enum":["success","processing","waiting","approval","declined","unknown","error","cancelled"],"description":"Payment transaction state"},"providerStatusCode":{"type":"string","enum":["approved","manually_approved","do_not_honor","suspected_fraud","invalid_trx","invalid_amt","invalid_account","invalid_response","no_transaction","restricted_card","insufficient_funds","expired_card","trx_not_permitted","exceeds_limit","exceeds_frequency","invalid_cvv","issuer_err","dest_not_found","psp_malfunction","psp_routing_error","unable_to_authorize","3ds_auth_failure","psp_limits_reached","psp_timeout","user_aborted_trx","avs_response","no_auth_corresponding","already_captured","already_cancelled","already_refunded","unknown_card","currency_not_supported","amt_over_max","amt_under_min","mobile_block","email_block","ip_block","bin_block","device_block","user_block","account_block","risk_block","duplicate_trx","already_chargedback","too_old_to_refund","no_partial_refund","partial_refund_over","redirect","redirect_timeout","blocked","processing","routing_error","system_error","psp_error","bad_request","other"],"description":"Harmonized response codes"},"providerExtStatusCode":{"type":"string"},"providerResponse":{},"providerTimestamp":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"providerOrderId":{"type":"string"},"duplicateGroup":{"type":"string"},"localRecordCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"providerRecordCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amount":{"type":"object","properties":{"amt":{"type":"string","pattern":"^-?(?:0|[1-9][0-9]{0,17})(?:\\.[0-9]{0,17}[1-9])?$","description":"Decimal amount as a canonical string"},"cy":{"type":"string","enum":["USD","EUR","GBP","JPY","CHF","CAD","AUD","SEK","NOK","DKK","PLN","CZK","HUF","RUB","CNY","INR","KRW","SGD","HKD","NZD","MXN","BRL","ZAR","TRY","ILS","THB","MYR","IDR","PHP","VND","JOD","KWD","BHD","OMR","TND","LYD","CLP","COP","PEN","ARS","UYU","EGP","MAD","NGN","KES","GHS","BWP","ZMW","UGX","TZS","ETB","RWF","MUR","SCR","BTC","ETH","LTC","BCH","XRP","ADA","DOT","LINK","XLM","DOGE","BNB","SOL","MATIC","AVAX","ATOM","ALGO","TRX","USDT","USDC","DAI"]}},"required":["amt","cy"],"additionalProperties":false,"description":"Monetary amount with currency, amount as a canonical decimal string"},"transactionCreatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"transactionType":{"type":"string","enum":["debit","credit","refund","auth","capture","void","cancel","chargeback","3ds"]},"customerName":{"type":"string"},"status":{"type":"string","enum":["pending","matched","repaired","mismatch","unresolved","skipped","error"],"description":"Reconciliation record status"},"mismatchKind":{"type":"string","enum":["local_success_provider_failed","local_success_provider_stuck","local_failed_provider_success","local_pending_provider_final","state_drift","duplicate_local","duplicate_provider","abandoned_attempt_double_charge","abandoned_attempt_stranded"],"description":"Kind of disagreement between our record and the provider's"},"severity":{"type":"string","enum":["critical","high","low"],"description":"Operational severity of a mismatch"},"attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"nextCheckAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"lastCheckedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"lastError":{"type":"string"},"resolution":{"type":"string","enum":["auto_repaired","corrected","dismissed"],"description":"How a reconciliation finding was resolved"},"resolvedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"resolvedBy":{"type":"string"},"resolutionNote":{"type":"string"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","transactionId","attemptNo","status","attempts","createdAt","updatedAt"],"additionalProperties":false,"description":"Reconciliation record for a single transaction"}}},"required":["checked","failed","records"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"401":{"description":"401","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"500":{"description":"500","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/reconciliations/resolve":{"post":{"summary":"Dismiss several reconciliation findings","tags":["reconciliations"],"parameters":[],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"action":{"type":"string","const":"dismiss"},"note":{"type":"string","minLength":1,"maxLength":1000}},"required":["ids","action","note"]}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"resolved":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["resolved"],"additionalProperties":false}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"401":{"description":"401","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"500":{"description":"500","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/api/v1/reconciliations/{id}/resolve":{"post":{"summary":"Resolve a reconciliation finding","tags":["reconciliations"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"action":{"type":"string","enum":["dismiss","apply"]},"note":{"type":"string","minLength":1,"maxLength":1000}},"required":["action","note"]}}}},"responses":{"200":{"description":"Reconciliation record for a single transaction","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"transactionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"attemptNo":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"organizationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"customerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"appSlugId":{"type":"string","minLength":3,"maxLength":256,"pattern":"^[a-z0-9-]+$"},"provider":{"type":"string","minLength":3,"maxLength":256,"pattern":"^[a-z0-9-]+$"},"providerAccount":{"type":"string","minLength":3,"maxLength":256,"pattern":"^[a-z0-9-]+$"},"providerTxId":{"type":"string"},"localState":{"type":"string","enum":["success","processing","waiting","approval","declined","unknown","error","cancelled"],"description":"Payment transaction state"},"localStatusCode":{"type":"string","enum":["approved","manually_approved","do_not_honor","suspected_fraud","invalid_trx","invalid_amt","invalid_account","invalid_response","no_transaction","restricted_card","insufficient_funds","expired_card","trx_not_permitted","exceeds_limit","exceeds_frequency","invalid_cvv","issuer_err","dest_not_found","psp_malfunction","psp_routing_error","unable_to_authorize","3ds_auth_failure","psp_limits_reached","psp_timeout","user_aborted_trx","avs_response","no_auth_corresponding","already_captured","already_cancelled","already_refunded","unknown_card","currency_not_supported","amt_over_max","amt_under_min","mobile_block","email_block","ip_block","bin_block","device_block","user_block","account_block","risk_block","duplicate_trx","already_chargedback","too_old_to_refund","no_partial_refund","partial_refund_over","redirect","redirect_timeout","blocked","processing","routing_error","system_error","psp_error","bad_request","other"],"description":"Harmonized response codes"},"providerState":{"type":"string","enum":["success","processing","waiting","approval","declined","unknown","error","cancelled"],"description":"Payment transaction state"},"providerStatusCode":{"type":"string","enum":["approved","manually_approved","do_not_honor","suspected_fraud","invalid_trx","invalid_amt","invalid_account","invalid_response","no_transaction","restricted_card","insufficient_funds","expired_card","trx_not_permitted","exceeds_limit","exceeds_frequency","invalid_cvv","issuer_err","dest_not_found","psp_malfunction","psp_routing_error","unable_to_authorize","3ds_auth_failure","psp_limits_reached","psp_timeout","user_aborted_trx","avs_response","no_auth_corresponding","already_captured","already_cancelled","already_refunded","unknown_card","currency_not_supported","amt_over_max","amt_under_min","mobile_block","email_block","ip_block","bin_block","device_block","user_block","account_block","risk_block","duplicate_trx","already_chargedback","too_old_to_refund","no_partial_refund","partial_refund_over","redirect","redirect_timeout","blocked","processing","routing_error","system_error","psp_error","bad_request","other"],"description":"Harmonized response codes"},"providerExtStatusCode":{"type":"string"},"providerResponse":{},"providerTimestamp":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"providerOrderId":{"type":"string"},"duplicateGroup":{"type":"string"},"localRecordCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"providerRecordCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amount":{"type":"object","properties":{"amt":{"type":"string","pattern":"^-?(?:0|[1-9][0-9]{0,17})(?:\\.[0-9]{0,17}[1-9])?$","description":"Decimal amount as a canonical string"},"cy":{"type":"string","enum":["USD","EUR","GBP","JPY","CHF","CAD","AUD","SEK","NOK","DKK","PLN","CZK","HUF","RUB","CNY","INR","KRW","SGD","HKD","NZD","MXN","BRL","ZAR","TRY","ILS","THB","MYR","IDR","PHP","VND","JOD","KWD","BHD","OMR","TND","LYD","CLP","COP","PEN","ARS","UYU","EGP","MAD","NGN","KES","GHS","BWP","ZMW","UGX","TZS","ETB","RWF","MUR","SCR","BTC","ETH","LTC","BCH","XRP","ADA","DOT","LINK","XLM","DOGE","BNB","SOL","MATIC","AVAX","ATOM","ALGO","TRX","USDT","USDC","DAI"]}},"required":["amt","cy"],"additionalProperties":false,"description":"Monetary amount with currency, amount as a canonical decimal string"},"transactionCreatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"transactionType":{"type":"string","enum":["debit","credit","refund","auth","capture","void","cancel","chargeback","3ds"]},"customerName":{"type":"string"},"status":{"type":"string","enum":["pending","matched","repaired","mismatch","unresolved","skipped","error"],"description":"Reconciliation record status"},"mismatchKind":{"type":"string","enum":["local_success_provider_failed","local_success_provider_stuck","local_failed_provider_success","local_pending_provider_final","state_drift","duplicate_local","duplicate_provider","abandoned_attempt_double_charge","abandoned_attempt_stranded"],"description":"Kind of disagreement between our record and the provider's"},"severity":{"type":"string","enum":["critical","high","low"],"description":"Operational severity of a mismatch"},"attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"nextCheckAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"lastCheckedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"lastError":{"type":"string"},"resolution":{"type":"string","enum":["auto_repaired","corrected","dismissed"],"description":"How a reconciliation finding was resolved"},"resolvedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"resolvedBy":{"type":"string"},"resolutionNote":{"type":"string"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","transactionId","attemptNo","status","attempts","createdAt","updatedAt"],"additionalProperties":false,"description":"Reconciliation record for a single transaction"}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"401":{"description":"401","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"403","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"500":{"description":"500","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}}},"info":{"title":"API – Customer","version":"1.0.0"},"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer"}}},"security":[{"BearerAuth":[]}],"servers":[{"url":"https://api-dev.babelpay.io","description":"Current environment"}],"webhooks":{"paymentCallback":{"post":{"summary":"Payment webhook callback","description":"**Note: Never trust the callback data without signature verification!** The callback is sent to the callbackUrl provided in the payment request when the transaction reaches a final state. Delivered with up to 3 retries.\n\n## Signature verification\n\nEvery webhook request includes two headers for signature verification:\n\n| Header | Description |\n| --- | --- |\n| `X-Webhook-Signature` | `sha256=<hex-encoded HMAC-SHA256>` |\n| `X-Webhook-Timestamp` | Unix epoch seconds when the request was signed |\n\nThe HMAC is computed over `{timestamp}.{raw JSON body}` using the `webhookSecret` (`whsec_…`) returned when the API key was created.\n\n### Verification steps\n\n1. Read `X-Webhook-Timestamp` and `X-Webhook-Signature` from the request headers.\n2. Reject the request if the timestamp is more than 5 minutes old (replay protection).\n3. Concatenate `{timestamp}.{raw request body}` (UTF-8).\n4. Compute `HMAC-SHA256(webhookSecret, concatenated string)` and hex-encode the result.\n5. Compare with the signature value after the `sha256=` prefix using a constant-time comparison.\n\n### Quick test — TypeScript Playground\n\nPaste the snippet below into [TypeScript Playground](https://www.typescriptlang.org/play), fill in the three values from an actual webhook request, and check the **Logs** tab.\n\n```typescript\n// ---- paste your values here ----\nconst webhookSecret    = \"whsec_...\";           // from API key creation\nconst signatureHeader  = \"sha256=...\";          // X-Webhook-Signature header\nconst timestampHeader  = \"1717344000\";          // X-Webhook-Timestamp header\nconst rawBody          = '{\"id\":\"...\"}';       // raw JSON body\n\n// ---- verify ----\n(async () => {\n  const enc = new TextEncoder();\n  const key = await crypto.subtle.importKey(\n    \"raw\", enc.encode(webhookSecret),\n    { name: \"HMAC\", hash: \"SHA-256\" }, false, [\"sign\"],\n  );\n  const sig = await crypto.subtle.sign(\n    \"HMAC\", key, enc.encode(`${timestampHeader}.${rawBody}`),\n  );\n  const expected = Array.from(new Uint8Array(sig))\n    .map(b => b.toString(16).padStart(2, \"0\")).join(\"\");\n  const received = signatureHeader.replace(/^sha256=/, \"\");\n\n  console.log(\"Expected:\", expected);\n  console.log(\"Received:\", received);\n  console.log(\"Valid:\", expected === received);\n})();\n```\n","requestBody":{"description":"The webhook callback payload containing the payment result.","required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"txRefId":{"type":"string","maxLength":255},"state":{"type":"string","enum":["success","processing","waiting","approval","declined","unknown","error","cancelled"],"description":"Payment transaction state"},"statusCode":{"type":"string","enum":["approved","manually_approved","do_not_honor","suspected_fraud","invalid_trx","invalid_amt","invalid_account","invalid_response","no_transaction","restricted_card","insufficient_funds","expired_card","trx_not_permitted","exceeds_limit","exceeds_frequency","invalid_cvv","issuer_err","dest_not_found","psp_malfunction","psp_routing_error","unable_to_authorize","3ds_auth_failure","psp_limits_reached","psp_timeout","user_aborted_trx","avs_response","no_auth_corresponding","already_captured","already_cancelled","already_refunded","unknown_card","currency_not_supported","amt_over_max","amt_under_min","mobile_block","email_block","ip_block","bin_block","device_block","user_block","account_block","risk_block","duplicate_trx","already_chargedback","too_old_to_refund","no_partial_refund","partial_refund_over","redirect","redirect_timeout","blocked","processing","routing_error","system_error","psp_error","bad_request","other"],"description":"Harmonized response codes"},"txAmount":{"type":"object","properties":{"amt":{"type":"string","pattern":"^-?(?:0|[1-9][0-9]{0,17})(?:\\.[0-9]{0,17}[1-9])?$","description":"Decimal amount as a canonical string"},"cy":{"type":"string","enum":["USD","EUR","GBP","JPY","CHF","CAD","AUD","SEK","NOK","DKK","PLN","CZK","HUF","RUB","CNY","INR","KRW","SGD","HKD","NZD","MXN","BRL","ZAR","TRY","ILS","THB","MYR","IDR","PHP","VND","JOD","KWD","BHD","OMR","TND","LYD","CLP","COP","PEN","ARS","UYU","EGP","MAD","NGN","KES","GHS","BWP","ZMW","UGX","TZS","ETB","RWF","MUR","SCR","BTC","ETH","LTC","BCH","XRP","ADA","DOT","LINK","XLM","DOGE","BNB","SOL","MATIC","AVAX","ATOM","ALGO","TRX","USDT","USDC","DAI"]}},"required":["amt","cy"],"additionalProperties":false,"description":"Monetary amount with currency, amount as a canonical decimal string"}},"required":["id"],"additionalProperties":false,"description":"Webhook callback payload sent to the customer callbackUrl"}}}},"parameters":[{"name":"X-Webhook-Signature","in":"header","required":false,"description":"HMAC-SHA256 signature: `sha256=<hex>`","schema":{"type":"string","example":"sha256=a1b2c3d4..."}},{"name":"X-Webhook-Timestamp","in":"header","required":false,"description":"Unix epoch seconds when the signature was computed","schema":{"type":"string","example":"1717344000"}}],"responses":{"200":{"description":"Callback received successfully. Any 2xx response is treated as success."}}}}}}