{"openapi":"3.1.0","info":{"title":"Click2Reply API","version":"v1","description":"The full public API: the same REST and realtime API the Click2Reply agent app uses. API calls are free and never metered."},"servers":[{"url":"https://api.click2reply.com"}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"A personal (`c2r_pat_`), bot (`c2r_bot_`) or OAuth (`c2r_oat_`) token."},"oauth2":{"type":"oauth2","flows":{"authorizationCode":{"authorizationUrl":"https://app.click2reply.com/oauth/authorize","tokenUrl":"https://api.click2reply.com/v1/oauth/token","refreshUrl":"https://api.click2reply.com/v1/oauth/token","scopes":{"chats.access":"Read and answer the chats of the groups the agent belongs to.","chats.all":"Read and answer every chat, in every group.","archives.read":"Search and read archived chats.","archives.write":"Change archived chats.","customers.read":"Read customer profiles.","customers.write":"Update customer profiles.","customers.ban":"Ban customers.","traffic.read":"See live website traffic.","campaigns.manage":"Manage greetings, campaigns and goals.","canned.manage":"Manage canned responses.","tags.manage":"Manage tags.","reports.read":"Read reports.","team.read":"Read agents, bots, groups and their status.","team.manage":"Invite, change and suspend agents; manage groups.","settings.manage":"Change routing, widget and chat settings.","channels.manage":"Connect and change messaging channels.","ai.manage":"Change the AI model settings.","developers.manage":"Manage webhooks, apps and bot tokens.","data.export":"Export chats, customers and reports."}}}}},"schemas":{"ErrorBody":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["validation","authentication","authorization","not_found","conflict","chat_inactive","agent_unavailable","entity_too_large","idempotency_key_reused","unsupported_version","too_many_requests","plan_limit","internal","not_implemented","service_unavailable"]},"message":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}},"paths":{"/v1/ai/capabilities":{"get":{"summary":"Whether a model is connected and which AI features are on","description":"Any valid token.","tags":["AI"],"security":[{"bearer":[]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"model_connected":{"type":"boolean"},"features":{"type":"object","propertyNames":{"type":"string","enum":["agent","suggestions","copilot","summaries","sentiment","text_edits","transcript_summary"]},"additionalProperties":{"type":"boolean"},"required":["agent","suggestions","copilot","summaries","sentiment","text_edits","transcript_summary"]},"health":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["ok","failing","unknown"]},"error_code":{"anyOf":[{"type":"string","enum":["timeout","bad_key","quota","rate_limited","model_not_found","bad_request","provider_down","bad_output","not_connected"]},{"type":"null"}]},"since":{"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{3}(?:Z))$"},{"type":"null"}]}},"required":["status","error_code","since"],"additionalProperties":false},{"type":"null"}]}},"required":["model_connected","features","health"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/ai/features":{"get":{"summary":"AI feature switches","description":"Needs the `ai.manage` permission.","tags":["AI"],"security":[{"bearer":[]},{"oauth2":["ai.manage"]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","propertyNames":{"type":"string","enum":["agent","suggestions","copilot","summaries","sentiment","text_edits","transcript_summary"]},"additionalProperties":{"type":"boolean"},"required":["agent","suggestions","copilot","summaries","sentiment","text_edits","transcript_summary"]}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"put":{"summary":"Switch AI features on or off","description":"Needs the `ai.manage` permission.","tags":["AI"],"security":[{"bearer":[]},{"oauth2":["ai.manage"]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","propertyNames":{"type":"string","enum":["suggestions","copilot","summaries","sentiment","text_edits","transcript_summary"]},"additionalProperties":{"type":"boolean"}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","propertyNames":{"type":"string","enum":["agent","suggestions","copilot","summaries","sentiment","text_edits","transcript_summary"]},"additionalProperties":{"type":"boolean"},"required":["agent","suggestions","copilot","summaries","sentiment","text_edits","transcript_summary"]}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/ai/models":{"get":{"summary":"Your connected models, keys masked","description":"Needs the `ai.manage` permission.","tags":["AI"],"security":[{"bearer":[]},{"oauth2":["ai.manage"]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"slot":{"type":"string","enum":["primary","backup"]},"provider":{"type":"string","enum":["openai_compatible","anthropic"]},"base_url":{"type":"string","format":"uri"},"model_id":{"type":"string","minLength":1,"maxLength":128},"api_key_hint":{"type":"string"},"timeout_ms":{"type":"integer","minimum":1000,"maximum":60000},"reasoning_enabled":{"type":"boolean"},"vision_enabled":{"type":"boolean"},"enabled":{"type":"boolean"},"last_test_at":{"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{3}(?:Z))$"},{"type":"null"}]},"last_test_ok":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"last_error_code":{"anyOf":[{"type":"string","enum":["timeout","bad_key","quota","rate_limited","model_not_found","bad_request","provider_down","bad_output","not_connected"]},{"type":"null"}]},"last_error_at":{"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{3}(?:Z))$"},{"type":"null"}]},"updated_at":{"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{3}(?:Z))$"}},"required":["slot","provider","base_url","model_id","api_key_hint","timeout_ms","reasoning_enabled","vision_enabled","enabled","last_test_at","last_test_ok","last_error_code","last_error_at","updated_at"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/ai/models/{slot}":{"put":{"summary":"Connect or change the primary or backup model","description":"Needs the `ai.manage` permission.","tags":["AI"],"security":[{"bearer":[]},{"oauth2":["ai.manage"]}],"parameters":[{"name":"slot","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"type":"string","enum":["openai_compatible","anthropic"]},"base_url":{"type":"string","maxLength":512,"format":"uri"},"model_id":{"type":"string","minLength":1,"maxLength":128},"api_key":{"type":"string","minLength":1,"maxLength":512},"timeout_ms":{"default":15000,"type":"integer","minimum":1000,"maximum":60000},"reasoning_enabled":{"default":false,"type":"boolean"},"vision_enabled":{"default":false,"type":"boolean"},"enabled":{"default":true,"type":"boolean"}},"required":["provider","base_url","model_id"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"slot":{"type":"string","enum":["primary","backup"]},"provider":{"type":"string","enum":["openai_compatible","anthropic"]},"base_url":{"type":"string","format":"uri"},"model_id":{"type":"string","minLength":1,"maxLength":128},"api_key_hint":{"type":"string"},"timeout_ms":{"type":"integer","minimum":1000,"maximum":60000},"reasoning_enabled":{"type":"boolean"},"vision_enabled":{"type":"boolean"},"enabled":{"type":"boolean"},"last_test_at":{"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{3}(?:Z))$"},{"type":"null"}]},"last_test_ok":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"last_error_code":{"anyOf":[{"type":"string","enum":["timeout","bad_key","quota","rate_limited","model_not_found","bad_request","provider_down","bad_output","not_connected"]},{"type":"null"}]},"last_error_at":{"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{3}(?:Z))$"},{"type":"null"}]},"updated_at":{"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{3}(?:Z))$"}},"required":["slot","provider","base_url","model_id","api_key_hint","timeout_ms","reasoning_enabled","vision_enabled","enabled","last_test_at","last_test_ok","last_error_code","last_error_at","updated_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"delete":{"summary":"Disconnect a model and delete its key","description":"Needs the `ai.manage` permission.","tags":["AI"],"security":[{"bearer":[]},{"oauth2":["ai.manage"]}],"parameters":[{"name":"slot","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done."},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/ai/models/{slot}:test":{"post":{"summary":"Test a saved model","description":"Needs the `ai.manage` permission.","tags":["AI"],"security":[{"bearer":[]},{"oauth2":["ai.manage"]}],"parameters":[{"name":"slot","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"latency_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"error_code":{"anyOf":[{"type":"string","enum":["timeout","bad_key","quota","rate_limited","model_not_found","bad_request","provider_down","bad_output","not_connected"]},{"type":"null"}]},"vision_ok":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["ok","latency_ms","error_code","vision_ok"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/ai/models:test":{"post":{"summary":"Test a model before saving it","description":"Needs the `ai.manage` permission.","tags":["AI"],"security":[{"bearer":[]},{"oauth2":["ai.manage"]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"type":"string","enum":["openai_compatible","anthropic"]},"base_url":{"type":"string","maxLength":512,"format":"uri"},"model_id":{"type":"string","minLength":1,"maxLength":128},"api_key":{"type":"string","minLength":1,"maxLength":512},"timeout_ms":{"default":15000,"type":"integer","minimum":1000,"maximum":60000},"reasoning_enabled":{"default":false,"type":"boolean"},"vision_enabled":{"default":false,"type":"boolean"},"enabled":{"default":true,"type":"boolean"},"slot":{"default":"primary","type":"string","enum":["primary","backup"]}},"required":["provider","base_url","model_id"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"latency_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"error_code":{"anyOf":[{"type":"string","enum":["timeout","bad_key","quota","rate_limited","model_not_found","bad_request","provider_down","bad_output","not_connected"]},{"type":"null"}]},"vision_ok":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["ok","latency_ms","error_code","vision_ok"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/ai/agent":{"get":{"summary":"The AI agent's settings and approved replies","description":"Needs the `ai.manage` permission.","tags":["AI"],"security":[{"bearer":[]},{"oauth2":["ai.manage"]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"default":false,"type":"boolean"},"bot_agent_id":{"default":null,"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"}]},"handover_group_ids":{"default":[],"maxItems":20,"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)$"}},"default_locale":{"default":"en","type":"string","pattern":"^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$"},"instructions":{"default":"","type":"string","maxLength":12000},"welcome":{"default":[],"maxItems":40,"type":"array","items":{"type":"object","properties":{"locale":{"type":"string","pattern":"^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$"},"variants":{"minItems":1,"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":2000}}},"required":["locale","variants"],"additionalProperties":false}},"handover":{"default":[],"maxItems":40,"type":"array","items":{"type":"object","properties":{"locale":{"type":"string","pattern":"^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$"},"variants":{"minItems":1,"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":2000}}},"required":["locale","variants"],"additionalProperties":false}},"comfort_per_visit":{"default":3,"type":"integer","minimum":0,"maximum":20},"holding_per_visit":{"default":5,"type":"integer","minimum":0,"maximum":20},"max_turns":{"default":20,"type":"integer","minimum":0,"maximum":100},"templates":{"default":[],"maxItems":200,"type":"array","items":{"type":"object","properties":{"code":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z0-9][a-z0-9_]*$"},"description":{"type":"string","minLength":1,"maxLength":500},"bodies":{"minItems":1,"maxItems":40,"type":"array","items":{"type":"object","properties":{"locale":{"type":"string","pattern":"^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$"},"variants":{"minItems":1,"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":2000}}},"required":["locale","variants"],"additionalProperties":false}},"requires":{"default":[],"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":48,"pattern":"^[a-z0-9][a-z0-9_]*$"}},"expects":{"default":[],"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":48,"pattern":"^[a-z0-9][a-z0-9_]*$"}},"max_per_visit":{"default":null,"anyOf":[{"type":"integer","minimum":0,"maximum":20},{"type":"null"}]},"comfort":{"default":false,"type":"boolean"},"holding":{"default":false,"type":"boolean"},"hands_over":{"default":false,"type":"boolean"},"enabled":{"default":true,"type":"boolean"}},"required":["code","description","bodies","requires","expects","max_per_visit","comfort","holding","hands_over","enabled"],"additionalProperties":false}}},"required":["enabled","bot_agent_id","handover_group_ids","default_locale","instructions","welcome","handover","comfort_per_visit","holding_per_visit","max_turns","templates"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"put":{"summary":"Save the AI agent's settings and approved replies","description":"Needs the `ai.manage` permission.","tags":["AI"],"security":[{"bearer":[]},{"oauth2":["ai.manage"]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"default":false,"type":"boolean"},"bot_agent_id":{"default":null,"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"}]},"handover_group_ids":{"default":[],"maxItems":20,"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)$"}},"default_locale":{"default":"en","type":"string","pattern":"^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$"},"instructions":{"default":"","type":"string","maxLength":12000},"welcome":{"default":[],"maxItems":40,"type":"array","items":{"type":"object","properties":{"locale":{"type":"string","pattern":"^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$"},"variants":{"minItems":1,"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":2000}}},"required":["locale","variants"]}},"handover":{"default":[],"maxItems":40,"type":"array","items":{"type":"object","properties":{"locale":{"type":"string","pattern":"^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$"},"variants":{"minItems":1,"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":2000}}},"required":["locale","variants"]}},"comfort_per_visit":{"default":3,"type":"integer","minimum":0,"maximum":20},"holding_per_visit":{"default":5,"type":"integer","minimum":0,"maximum":20},"max_turns":{"default":20,"type":"integer","minimum":0,"maximum":100},"templates":{"default":[],"maxItems":200,"type":"array","items":{"type":"object","properties":{"code":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z0-9][a-z0-9_]*$"},"description":{"type":"string","minLength":1,"maxLength":500},"bodies":{"minItems":1,"maxItems":40,"type":"array","items":{"type":"object","properties":{"locale":{"type":"string","pattern":"^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$"},"variants":{"minItems":1,"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":2000}}},"required":["locale","variants"]}},"requires":{"default":[],"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":48,"pattern":"^[a-z0-9][a-z0-9_]*$"}},"expects":{"default":[],"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":48,"pattern":"^[a-z0-9][a-z0-9_]*$"}},"max_per_visit":{"default":null,"anyOf":[{"type":"integer","minimum":0,"maximum":20},{"type":"null"}]},"comfort":{"default":false,"type":"boolean"},"holding":{"default":false,"type":"boolean"},"hands_over":{"default":false,"type":"boolean"},"enabled":{"default":true,"type":"boolean"}},"required":["code","description","bodies"]}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"default":false,"type":"boolean"},"bot_agent_id":{"default":null,"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"}]},"handover_group_ids":{"default":[],"maxItems":20,"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)$"}},"default_locale":{"default":"en","type":"string","pattern":"^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$"},"instructions":{"default":"","type":"string","maxLength":12000},"welcome":{"default":[],"maxItems":40,"type":"array","items":{"type":"object","properties":{"locale":{"type":"string","pattern":"^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$"},"variants":{"minItems":1,"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":2000}}},"required":["locale","variants"],"additionalProperties":false}},"handover":{"default":[],"maxItems":40,"type":"array","items":{"type":"object","properties":{"locale":{"type":"string","pattern":"^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$"},"variants":{"minItems":1,"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":2000}}},"required":["locale","variants"],"additionalProperties":false}},"comfort_per_visit":{"default":3,"type":"integer","minimum":0,"maximum":20},"holding_per_visit":{"default":5,"type":"integer","minimum":0,"maximum":20},"max_turns":{"default":20,"type":"integer","minimum":0,"maximum":100},"templates":{"default":[],"maxItems":200,"type":"array","items":{"type":"object","properties":{"code":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z0-9][a-z0-9_]*$"},"description":{"type":"string","minLength":1,"maxLength":500},"bodies":{"minItems":1,"maxItems":40,"type":"array","items":{"type":"object","properties":{"locale":{"type":"string","pattern":"^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$"},"variants":{"minItems":1,"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":2000}}},"required":["locale","variants"],"additionalProperties":false}},"requires":{"default":[],"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":48,"pattern":"^[a-z0-9][a-z0-9_]*$"}},"expects":{"default":[],"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":48,"pattern":"^[a-z0-9][a-z0-9_]*$"}},"max_per_visit":{"default":null,"anyOf":[{"type":"integer","minimum":0,"maximum":20},{"type":"null"}]},"comfort":{"default":false,"type":"boolean"},"holding":{"default":false,"type":"boolean"},"hands_over":{"default":false,"type":"boolean"},"enabled":{"default":true,"type":"boolean"}},"required":["code","description","bodies","requires","expects","max_per_visit","comfort","holding","hands_over","enabled"],"additionalProperties":false}}},"required":["enabled","bot_agent_id","handover_group_ids","default_locale","instructions","welcome","handover","comfort_per_visit","holding_per_visit","max_turns","templates"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/ai/agent:preview":{"post":{"summary":"Run one AI agent turn on a sample conversation, sending nothing","description":"Needs the `ai.manage` permission.","tags":["AI"],"security":[{"bearer":[]},{"oauth2":["ai.manage"]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"settings":{"type":"object","properties":{"enabled":{"default":false,"type":"boolean"},"bot_agent_id":{"default":null,"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"}]},"handover_group_ids":{"default":[],"maxItems":20,"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)$"}},"default_locale":{"default":"en","type":"string","pattern":"^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$"},"instructions":{"default":"","type":"string","maxLength":12000},"welcome":{"default":[],"maxItems":40,"type":"array","items":{"type":"object","properties":{"locale":{"type":"string","pattern":"^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$"},"variants":{"minItems":1,"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":2000}}},"required":["locale","variants"]}},"handover":{"default":[],"maxItems":40,"type":"array","items":{"type":"object","properties":{"locale":{"type":"string","pattern":"^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$"},"variants":{"minItems":1,"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":2000}}},"required":["locale","variants"]}},"comfort_per_visit":{"default":3,"type":"integer","minimum":0,"maximum":20},"holding_per_visit":{"default":5,"type":"integer","minimum":0,"maximum":20},"max_turns":{"default":20,"type":"integer","minimum":0,"maximum":100},"templates":{"default":[],"maxItems":200,"type":"array","items":{"type":"object","properties":{"code":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z0-9][a-z0-9_]*$"},"description":{"type":"string","minLength":1,"maxLength":500},"bodies":{"minItems":1,"maxItems":40,"type":"array","items":{"type":"object","properties":{"locale":{"type":"string","pattern":"^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$"},"variants":{"minItems":1,"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":2000}}},"required":["locale","variants"]}},"requires":{"default":[],"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":48,"pattern":"^[a-z0-9][a-z0-9_]*$"}},"expects":{"default":[],"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":48,"pattern":"^[a-z0-9][a-z0-9_]*$"}},"max_per_visit":{"default":null,"anyOf":[{"type":"integer","minimum":0,"maximum":20},{"type":"null"}]},"comfort":{"default":false,"type":"boolean"},"holding":{"default":false,"type":"boolean"},"hands_over":{"default":false,"type":"boolean"},"enabled":{"default":true,"type":"boolean"}},"required":["code","description","bodies"]}}}},"transcript":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["customer","agent","bot"]},"text":{"type":"string","minLength":1,"maxLength":4000}},"required":["role","text"]}}},"required":["transcript"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"outcome":{"type":"string","enum":["sent","welcomed","asked","quiet","handed_over","model_error","not_connected","off"]},"code":{"anyOf":[{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z0-9][a-z0-9_]*$"},{"type":"null"}]},"text":{"anyOf":[{"type":"string"},{"type":"null"}]},"language":{"anyOf":[{"type":"string"},{"type":"null"}]},"filled":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"error_code":{"anyOf":[{"type":"string","enum":["timeout","bad_key","quota","rate_limited","model_not_found","bad_request","provider_down","bad_output","not_connected"]},{"type":"null"}]}},"required":["outcome","code","text","language","filled","reason","error_code"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/ai/knowledge":{"get":{"summary":"Knowledge hub sources","description":"Needs the `ai.manage` permission.","tags":["AI"],"security":[{"bearer":[]},{"oauth2":["ai.manage"]}],"parameters":[],"responses":{"200":{"description":"OK","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)$"},"kind":{"type":"string","enum":["text","qa","website","file"]},"title":{"type":"string","maxLength":200},"url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"file_key":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["indexing","ready","failed"]},"error_code":{"anyOf":[{"type":"string"},{"type":"null"}]},"chars":{"type":"integer","minimum":0,"maximum":9007199254740991},"enabled":{"type":"boolean"},"updated_at":{"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{3}(?:Z))$"}},"required":["id","kind","title","url","file_key","status","error_code","chars","enabled","updated_at"],"additionalProperties":false}},"total_chars":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["items","total_chars"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"post":{"summary":"Add a knowledge source","description":"Needs the `ai.manage` permission.","tags":["AI"],"security":[{"bearer":[]},{"oauth2":["ai.manage"]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"text"},"title":{"type":"string","minLength":1,"maxLength":200},"body":{"type":"string","minLength":1,"maxLength":200000}},"required":["kind","title","body"]},{"type":"object","properties":{"kind":{"type":"string","const":"qa"},"title":{"type":"string","minLength":1,"maxLength":200},"body":{"type":"string","minLength":1,"maxLength":8000}},"required":["kind","title","body"]},{"type":"object","properties":{"kind":{"type":"string","const":"website"},"url":{"type":"string","maxLength":2048,"format":"uri"},"title":{"type":"string","maxLength":200}},"required":["kind","url"]},{"type":"object","properties":{"kind":{"type":"string","const":"file"},"file_key":{"type":"string","minLength":1,"maxLength":512},"title":{"type":"string","maxLength":200}},"required":["kind","file_key"]}]}}}},"responses":{"201":{"description":"Created","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)$"},"kind":{"type":"string","enum":["text","qa","website","file"]},"title":{"type":"string","maxLength":200},"url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"file_key":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["indexing","ready","failed"]},"error_code":{"anyOf":[{"type":"string"},{"type":"null"}]},"chars":{"type":"integer","minimum":0,"maximum":9007199254740991},"enabled":{"type":"boolean"},"updated_at":{"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{3}(?:Z))$"},"body":{"type":"string"}},"required":["id","kind","title","url","file_key","status","error_code","chars","enabled","updated_at","body"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/ai/knowledge/{id}":{"get":{"summary":"A knowledge source with its text","description":"Needs the `ai.manage` permission.","tags":["AI"],"security":[{"bearer":[]},{"oauth2":["ai.manage"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","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)$"},"kind":{"type":"string","enum":["text","qa","website","file"]},"title":{"type":"string","maxLength":200},"url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"file_key":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["indexing","ready","failed"]},"error_code":{"anyOf":[{"type":"string"},{"type":"null"}]},"chars":{"type":"integer","minimum":0,"maximum":9007199254740991},"enabled":{"type":"boolean"},"updated_at":{"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{3}(?:Z))$"},"body":{"type":"string"}},"required":["id","kind","title","url","file_key","status","error_code","chars","enabled","updated_at","body"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"patch":{"summary":"Change or refetch a knowledge source","description":"Needs the `ai.manage` permission.","tags":["AI"],"security":[{"bearer":[]},{"oauth2":["ai.manage"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"body":{"type":"string","minLength":1,"maxLength":200000},"enabled":{"type":"boolean"},"refetch":{"type":"boolean","const":true}}}}}},"responses":{"200":{"description":"OK","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)$"},"kind":{"type":"string","enum":["text","qa","website","file"]},"title":{"type":"string","maxLength":200},"url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"file_key":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["indexing","ready","failed"]},"error_code":{"anyOf":[{"type":"string"},{"type":"null"}]},"chars":{"type":"integer","minimum":0,"maximum":9007199254740991},"enabled":{"type":"boolean"},"updated_at":{"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{3}(?:Z))$"},"body":{"type":"string"}},"required":["id","kind","title","url","file_key","status","error_code","chars","enabled","updated_at","body"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"delete":{"summary":"Delete a knowledge source","description":"Needs the `ai.manage` permission.","tags":["AI"],"security":[{"bearer":[]},{"oauth2":["ai.manage"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done."},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/ai/chats/{chat_id}:suggest":{"post":{"summary":"Reply suggestions for a chat","description":"Needs the `chats.access` permission.","tags":["AI"],"security":[{"bearer":[]},{"oauth2":["chats.access"]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"thread_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"suggestions":{"maxItems":3,"type":"array","items":{"type":"object","properties":{"text":{"type":"string","maxLength":2000}},"required":["text"],"additionalProperties":false}}},"required":["suggestions"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/ai/chats/{chat_id}:summarize":{"post":{"summary":"Summarize a chat thread now","description":"Needs the `chats.access` permission.","tags":["AI"],"security":[{"bearer":[]},{"oauth2":["chats.access"]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"thread_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"language":{"type":"string","pattern":"^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"title":{"type":"string","maxLength":80},"summary":{"type":"string","maxLength":2000},"sentiment":{"anyOf":[{"type":"string","enum":["positive","neutral","negative"]},{"type":"null"}]},"sentiment_score":{"anyOf":[{"type":"number","minimum":-1,"maximum":1},{"type":"null"}]},"topics":{"maxItems":5,"type":"array","items":{"type":"string","maxLength":48}},"language":{"anyOf":[{"type":"string"},{"type":"null"}]},"updated_at":{"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{3}(?:Z))$"}},"required":["chat_id","thread_id","title","summary","sentiment","sentiment_score","topics","language","updated_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/ai/chats/{chat_id}/threads/{thread_id}/summary":{"get":{"summary":"A thread's stored summary","description":"Needs the `chats.access` permission.","tags":["AI"],"security":[{"bearer":[]},{"oauth2":["chats.access"]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"thread_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"title":{"type":"string","maxLength":80},"summary":{"type":"string","maxLength":2000},"sentiment":{"anyOf":[{"type":"string","enum":["positive","neutral","negative"]},{"type":"null"}]},"sentiment_score":{"anyOf":[{"type":"number","minimum":-1,"maximum":1},{"type":"null"}]},"topics":{"maxItems":5,"type":"array","items":{"type":"string","maxLength":48}},"language":{"anyOf":[{"type":"string"},{"type":"null"}]},"updated_at":{"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{3}(?:Z))$"}},"required":["chat_id","thread_id","title","summary","sentiment","sentiment_score","topics","language","updated_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/ai/copilot":{"post":{"summary":"Ask Copilot, optionally about one chat","description":"Needs the `chats.access` permission.","tags":["AI"],"security":[{"bearer":[]},{"oauth2":["chats.access"]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"question":{"type":"string","minLength":1,"maxLength":2000},"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"history":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["agent","copilot"]},"text":{"type":"string","maxLength":4000}},"required":["role","text"]}}},"required":["question"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"answer":{"type":"string"}},"required":["answer"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/ai/text:edit":{"post":{"summary":"Rephrase, shorten, fix or translate a draft","description":"Needs the `chats.access` permission.","tags":["AI"],"security":[{"bearer":[]},{"oauth2":["chats.access"]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":4000},"op":{"type":"string","enum":["rephrase","shorten","expand","fix_grammar","friendly","formal","translate"]},"language":{"type":"string","pattern":"^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$"}},"required":["text","op"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string"}},"required":["text"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/ai/usage":{"get":{"summary":"Your model calls and tokens per feature","description":"Needs the `ai.manage` permission.","tags":["AI"],"security":[{"bearer":[]},{"oauth2":["ai.manage"]}],"parameters":[{"name":"days","in":"query","required":false,"schema":{"default":30,"type":"integer","minimum":1,"maximum":400}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"items":{"type":"array","items":{"type":"object","properties":{"feature":{"type":"string"},"calls":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failures":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"input_tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"output_tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["feature","calls","failures","input_tokens","output_tokens"],"additionalProperties":false}}},"required":["days","items"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/auth/config":{"get":{"summary":"Public sign-in settings (Turnstile site key, password rules)","description":"No token.","tags":["Auth"],"security":[],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"turnstile_site_key":{"anyOf":[{"type":"string"},{"type":"null"}]},"password_min_length":{"type":"integer","minimum":1,"maximum":9007199254740991},"ads_consent_required":{"type":"boolean"}},"required":["turnstile_site_key","password_min_length","ads_consent_required"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/auth/signup":{"post":{"summary":"Create an account and its organization","description":"No token.","tags":["Auth"],"security":[],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","maxLength":254,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"password":{"type":"string","maxLength":256},"name":{"type":"string","minLength":1,"maxLength":120},"organization_name":{"type":"string","minLength":1,"maxLength":120},"region":{"type":"string","enum":["apac","eu","us"]},"timezone":{"type":"string","minLength":1,"maxLength":64},"turnstile_token":{"type":"string","maxLength":4096},"attribution":{"type":"object","properties":{"referrer":{"type":"string","maxLength":2048},"landing_page":{"type":"string","maxLength":2048},"utm_source":{"type":"string","maxLength":200},"utm_medium":{"type":"string","maxLength":200},"utm_campaign":{"type":"string","maxLength":200},"utm_term":{"type":"string","maxLength":200},"utm_content":{"type":"string","maxLength":200},"visitor_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{22,64}$"},"gclid":{"type":"string","pattern":"^[A-Za-z0-9_-]{8,512}$"},"gbraid":{"type":"string","pattern":"^[A-Za-z0-9_-]{8,512}$"},"wbraid":{"type":"string","pattern":"^[A-Za-z0-9_-]{8,512}$"},"msclkid":{"type":"string"}}},"ads_consent":{"type":"boolean"}},"required":["email","password","turnstile_token"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"access_token":{"type":"string"},"access_token_expires_at":{"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{3}(?:Z))$"},"refresh_token":{"type":"string"},"refresh_token_expires_at":{"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{3}(?:Z))$"},"session_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)$"},"organization_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)$"},"agent_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)$"},"restriction":{"anyOf":[{"type":"string","enum":["email_unverified","awaiting_approval","mfa_setup_required"]},{"type":"null"}]},"organizations":{"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)$"},"name":{"type":"string"},"license_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"role":{"type":"string","enum":["owner","viceowner","admin","agent"]}},"required":["id","name","license_id","role"],"additionalProperties":false}}},"required":["access_token","access_token_expires_at","refresh_token","refresh_token_expires_at","session_id","organization_id","agent_id","restriction","organizations"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/auth/email:verify":{"post":{"summary":"Confirm the email with the mailed 6-digit code; then refresh for unrestricted tokens","description":"A signed-in agent session only; API tokens are refused.","tags":["Auth"],"security":[{"bearer":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","pattern":"^\\d{6}$"}},"required":["code"]}}}},"responses":{"204":{"description":"Done."},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/auth/email:resend":{"post":{"summary":"Mail a new verification code","description":"A signed-in agent session only; API tokens are refused.","tags":["Auth"],"security":[{"bearer":[]}],"parameters":[],"responses":{"204":{"description":"Done."},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/auth/login":{"post":{"summary":"Sign in with email and password","description":"No token.","tags":["Auth"],"security":[],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","maxLength":254,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"password":{"type":"string","maxLength":256},"organization_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)$"},"totp_code":{"type":"string","pattern":"^\\d{6}$"},"recovery_code":{"type":"string","pattern":"^[A-Za-z0-9]{5}-?[A-Za-z0-9]{5}$"},"turnstile_token":{"type":"string","maxLength":4096}},"required":["email","password","turnstile_token"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"access_token":{"type":"string"},"access_token_expires_at":{"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{3}(?:Z))$"},"refresh_token":{"type":"string"},"refresh_token_expires_at":{"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{3}(?:Z))$"},"session_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)$"},"organization_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)$"},"agent_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)$"},"restriction":{"anyOf":[{"type":"string","enum":["email_unverified","awaiting_approval","mfa_setup_required"]},{"type":"null"}]},"organizations":{"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)$"},"name":{"type":"string"},"license_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"role":{"type":"string","enum":["owner","viceowner","admin","agent"]}},"required":["id","name","license_id","role"],"additionalProperties":false}},"mfa_required":{"type":"boolean","const":false}},"required":["access_token","access_token_expires_at","refresh_token","refresh_token_expires_at","session_id","organization_id","agent_id","restriction","organizations","mfa_required"],"additionalProperties":false},{"type":"object","properties":{"mfa_required":{"type":"boolean","const":true},"mfa_token":{"type":"string"},"mfa_token_expires_at":{"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{3}(?:Z))$"}},"required":["mfa_required","mfa_token","mfa_token_expires_at"],"additionalProperties":false}]}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/auth/login:mfa":{"post":{"summary":"Second sign-in step: TOTP or recovery code","description":"No token.","tags":["Auth"],"security":[],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"mfa_token":{"type":"string","maxLength":4096},"totp_code":{"type":"string","pattern":"^\\d{6}$"},"recovery_code":{"type":"string","pattern":"^[A-Za-z0-9]{5}-?[A-Za-z0-9]{5}$"}},"required":["mfa_token"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"access_token":{"type":"string"},"access_token_expires_at":{"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{3}(?:Z))$"},"refresh_token":{"type":"string"},"refresh_token_expires_at":{"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{3}(?:Z))$"},"session_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)$"},"organization_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)$"},"agent_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)$"},"restriction":{"anyOf":[{"type":"string","enum":["email_unverified","awaiting_approval","mfa_setup_required"]},{"type":"null"}]},"organizations":{"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)$"},"name":{"type":"string"},"license_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"role":{"type":"string","enum":["owner","viceowner","admin","agent"]}},"required":["id","name","license_id","role"],"additionalProperties":false}}},"required":["access_token","access_token_expires_at","refresh_token","refresh_token_expires_at","session_id","organization_id","agent_id","restriction","organizations"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/auth/token:refresh":{"post":{"summary":"Rotate the refresh token and get a new access token","description":"No token.","tags":["Auth"],"security":[],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"refresh_token":{"type":"string","maxLength":256}},"required":["refresh_token"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"access_token":{"type":"string"},"access_token_expires_at":{"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{3}(?:Z))$"},"refresh_token":{"type":"string"},"refresh_token_expires_at":{"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{3}(?:Z))$"},"session_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)$"},"organization_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)$"},"agent_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)$"},"restriction":{"anyOf":[{"type":"string","enum":["email_unverified","awaiting_approval","mfa_setup_required"]},{"type":"null"}]},"organizations":{"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)$"},"name":{"type":"string"},"license_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"role":{"type":"string","enum":["owner","viceowner","admin","agent"]}},"required":["id","name","license_id","role"],"additionalProperties":false}}},"required":["access_token","access_token_expires_at","refresh_token","refresh_token_expires_at","session_id","organization_id","agent_id","restriction","organizations"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/auth/logout":{"post":{"summary":"End this session","description":"A signed-in agent session only; API tokens are refused.","tags":["Auth"],"security":[{"bearer":[]}],"parameters":[],"responses":{"204":{"description":"Done."},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/auth/organization:switch":{"post":{"summary":"Sign in to another of the account's organizations","description":"A signed-in agent session only; API tokens are refused.","tags":["Auth"],"security":[{"bearer":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organization_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)$"},"refresh_token":{"type":"string","maxLength":256}},"required":["organization_id","refresh_token"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"access_token":{"type":"string"},"access_token_expires_at":{"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{3}(?:Z))$"},"refresh_token":{"type":"string"},"refresh_token_expires_at":{"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{3}(?:Z))$"},"session_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)$"},"organization_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)$"},"agent_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)$"},"restriction":{"anyOf":[{"type":"string","enum":["email_unverified","awaiting_approval","mfa_setup_required"]},{"type":"null"}]},"organizations":{"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)$"},"name":{"type":"string"},"license_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"role":{"type":"string","enum":["owner","viceowner","admin","agent"]}},"required":["id","name","license_id","role"],"additionalProperties":false}}},"required":["access_token","access_token_expires_at","refresh_token","refresh_token_expires_at","session_id","organization_id","agent_id","restriction","organizations"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/auth/password:forgot":{"post":{"summary":"Mail a password reset link","description":"No token.","tags":["Auth"],"security":[],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","maxLength":254,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"turnstile_token":{"type":"string","maxLength":4096}},"required":["email","turnstile_token"]}}}},"responses":{"204":{"description":"Done."},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/auth/password:reset":{"post":{"summary":"Set a new password with the mailed token","description":"No token.","tags":["Auth"],"security":[],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","maxLength":256},"password":{"type":"string","maxLength":256},"turnstile_token":{"type":"string","maxLength":4096}},"required":["token","password","turnstile_token"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"access_token":{"type":"string"},"access_token_expires_at":{"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{3}(?:Z))$"},"refresh_token":{"type":"string"},"refresh_token_expires_at":{"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{3}(?:Z))$"},"session_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)$"},"organization_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)$"},"agent_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)$"},"restriction":{"anyOf":[{"type":"string","enum":["email_unverified","awaiting_approval","mfa_setup_required"]},{"type":"null"}]},"organizations":{"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)$"},"name":{"type":"string"},"license_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"role":{"type":"string","enum":["owner","viceowner","admin","agent"]}},"required":["id","name","license_id","role"],"additionalProperties":false}},"mfa_required":{"type":"boolean","const":false}},"required":["access_token","access_token_expires_at","refresh_token","refresh_token_expires_at","session_id","organization_id","agent_id","restriction","organizations","mfa_required"],"additionalProperties":false},{"type":"object","properties":{"mfa_required":{"type":"boolean","const":true},"mfa_token":{"type":"string"},"mfa_token_expires_at":{"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{3}(?:Z))$"}},"required":["mfa_required","mfa_token","mfa_token_expires_at"],"additionalProperties":false}]}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/auth/sso:discover":{"post":{"summary":"Where an email or license signs in with SSO","description":"No token.","tags":["SSO"],"security":[],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","maxLength":254,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"license_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"sso":{"type":"boolean"},"required":{"type":"boolean"},"start_url":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["sso","required","start_url"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/auth/sso:exchange":{"post":{"summary":"Trade the one-time SSO code for tokens","description":"No token.","tags":["SSO"],"security":[],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","maxLength":256}},"required":["code"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"access_token":{"type":"string"},"access_token_expires_at":{"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{3}(?:Z))$"},"refresh_token":{"type":"string"},"refresh_token_expires_at":{"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{3}(?:Z))$"},"session_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)$"},"organization_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)$"},"agent_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)$"},"restriction":{"anyOf":[{"type":"string","enum":["email_unverified","awaiting_approval","mfa_setup_required"]},{"type":"null"}]},"organizations":{"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)$"},"name":{"type":"string"},"license_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"role":{"type":"string","enum":["owner","viceowner","admin","agent"]}},"required":["id","name","license_id","role"],"additionalProperties":false}}},"required":["access_token","access_token_expires_at","refresh_token","refresh_token_expires_at","session_id","organization_id","agent_id","restriction","organizations"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/accounts/me":{"get":{"summary":"The signed-in account, agent and organization","description":"A signed-in agent session only; API tokens are refused.","tags":["Account"],"security":[{"bearer":[]}],"parameters":[],"responses":{"200":{"description":"OK","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)$"},"email":{"type":"string","maxLength":254,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"name":{"type":"string"},"locale":{"type":"string"},"email_verified":{"type":"boolean"},"totp_enabled":{"type":"boolean"},"recovery_codes_left":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"agent":{"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)$"},"organization_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":["agent","bot"]},"email":{"anyOf":[{"type":"string","maxLength":254,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]},"name":{"type":"string"},"job_title":{"type":"string"},"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"role":{"type":"string","enum":["owner","viceowner","admin","agent"]},"custom_role_id":{"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"}]},"max_chats":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","enum":["active","suspended","awaiting_approval"]},"default_routing_status":{"type":"string","enum":["accepting_chats","not_accepting_chats","offline"]},"group_ids":{"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)$"}},"totp_enabled":{"type":"boolean"},"created_at":{"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{3}(?:Z))$"}},"required":["id","organization_id","kind","email","name","job_title","avatar_url","role","custom_role_id","max_chats","status","default_routing_status","group_ids","totp_enabled","created_at"],"additionalProperties":false},"organization":{"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)$"},"license_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"name":{"type":"string"},"region":{"type":"string","enum":["apac","eu","us"]},"timezone":{"type":"string"},"website":{"type":"string"},"company_size":{"anyOf":[{"type":"string","enum":["1","2-9","10-49","50-99","100-499","500-999","1000+"]},{"type":"null"}]},"status":{"type":"string","enum":["active","suspended","closed","deleting"]},"login_method":{"type":"string","enum":["any","sso"]},"require_2fa":{"type":"boolean"},"allowed_email_domains":{"type":"array","items":{"type":"string"}},"ip_allowlist":{"type":"array","items":{"type":"string"}},"created_at":{"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{3}(?:Z))$"}},"required":["id","license_id","name","region","timezone","website","company_size","status","login_method","require_2fa","allowed_email_domains","ip_allowlist","created_at"],"additionalProperties":false},"permissions":{"type":"array","items":{"type":"string","enum":["chats.access","chats.all","archives.read","archives.write","customers.read","customers.write","customers.ban","traffic.read","campaigns.manage","canned.manage","tags.manage","reports.read","team.read","team.manage","roles.manage","settings.manage","channels.manage","ai.manage","developers.manage","tokens.own","data.export","billing.manage","organization.manage"]}},"restriction":{"anyOf":[{"type":"string","enum":["email_unverified","awaiting_approval","mfa_setup_required"]},{"type":"null"}]},"organizations":{"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)$"},"name":{"type":"string"},"license_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"role":{"type":"string","enum":["owner","viceowner","admin","agent"]}},"required":["id","name","license_id","role"],"additionalProperties":false}}},"required":["id","email","name","locale","email_verified","totp_enabled","recovery_codes_left","agent","organization","permissions","restriction","organizations"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"patch":{"summary":"Change your name or locale","description":"A signed-in agent session only; API tokens are refused.","tags":["Account"],"security":[{"bearer":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"locale":{"type":"string","maxLength":16}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/accounts/me/password:change":{"post":{"summary":"Change your password","description":"A signed-in agent session only; API tokens are refused.","tags":["Account"],"security":[{"bearer":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"current_password":{"type":"string","maxLength":256},"password":{"type":"string","maxLength":256}},"required":["current_password","password"]}}}},"responses":{"204":{"description":"Done."},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/accounts/me/email:change":{"post":{"summary":"Ask to change your login email: the new address gets a confirmation link","description":"A signed-in agent session only; API tokens are refused.","tags":["Account"],"security":[{"bearer":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"new_email":{"type":"string","maxLength":254,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"current_password":{"type":"string","maxLength":256}},"required":["new_email","current_password"]}}}},"responses":{"204":{"description":"Done."},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/auth/email:confirm":{"post":{"summary":"Confirm a login email change with the mailed token","description":"No token.","tags":["Auth"],"security":[],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","minLength":1,"maxLength":256}},"required":["token"]}}}},"responses":{"204":{"description":"Done."},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/accounts/me/2fa:setup":{"post":{"summary":"Start TOTP setup","description":"A signed-in agent session only; API tokens are refused.","tags":["Account"],"security":[{"bearer":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"password":{"type":"string","maxLength":256}},"required":["password"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"secret":{"type":"string"},"otpauth_uri":{"type":"string"}},"required":["secret","otpauth_uri"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/accounts/me/2fa:enable":{"post":{"summary":"Turn TOTP on with a first code","description":"A signed-in agent session only; API tokens are refused.","tags":["Account"],"security":[{"bearer":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","pattern":"^\\d{6}$"}},"required":["code"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"recovery_codes":{"type":"array","items":{"type":"string"}}},"required":["recovery_codes"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/accounts/me/2fa:disable":{"post":{"summary":"Turn TOTP off","description":"A signed-in agent session only; API tokens are refused.","tags":["Account"],"security":[{"bearer":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"password":{"type":"string","maxLength":256},"code":{"type":"string","pattern":"^\\d{6}$"},"recovery_code":{"type":"string","pattern":"^[A-Za-z0-9]{5}-?[A-Za-z0-9]{5}$"}},"required":["password"]}}}},"responses":{"204":{"description":"Done."},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/accounts/me/recovery-codes:regenerate":{"post":{"summary":"Replace the recovery codes","description":"A signed-in agent session only; API tokens are refused.","tags":["Account"],"security":[{"bearer":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"password":{"type":"string","maxLength":256}},"required":["password"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"recovery_codes":{"type":"array","items":{"type":"string"}}},"required":["recovery_codes"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/sessions":{"get":{"summary":"Your open sessions","description":"A signed-in agent session only; API tokens are refused.","tags":["Account"],"security":[{"bearer":[]}],"parameters":[],"responses":{"200":{"description":"OK","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)$"},"user_agent":{"type":"string"},"ip_country":{"anyOf":[{"type":"string"},{"type":"null"}]},"via":{"type":"string"},"created_at":{"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{3}(?:Z))$"},"last_seen_at":{"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{3}(?:Z))$"},"current":{"type":"boolean"}},"required":["id","user_agent","ip_country","via","created_at","last_seen_at","current"],"additionalProperties":false}},"next_page_token":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["items","next_page_token"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/sessions/{id}":{"delete":{"summary":"End one session","description":"A signed-in agent session only; API tokens are refused.","tags":["Account"],"security":[{"bearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done."},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/sessions:revoke-others":{"post":{"summary":"End every other session","description":"A signed-in agent session only; API tokens are refused.","tags":["Account"],"security":[{"bearer":[]}],"parameters":[],"responses":{"204":{"description":"Done."},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/agents":{"get":{"summary":"List agents and bots","description":"Needs the `team.read` permission.","tags":["Team"],"security":[{"bearer":[]},{"oauth2":["team.read"]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["active","suspended","awaiting_approval"]}},{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["agent","bot"]}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":120}}],"responses":{"200":{"description":"OK","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)$"},"organization_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":["agent","bot"]},"email":{"anyOf":[{"type":"string","maxLength":254,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]},"name":{"type":"string"},"job_title":{"type":"string"},"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"role":{"type":"string","enum":["owner","viceowner","admin","agent"]},"custom_role_id":{"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"}]},"max_chats":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","enum":["active","suspended","awaiting_approval"]},"default_routing_status":{"type":"string","enum":["accepting_chats","not_accepting_chats","offline"]},"group_ids":{"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)$"}},"totp_enabled":{"type":"boolean"},"created_at":{"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{3}(?:Z))$"}},"required":["id","organization_id","kind","email","name","job_title","avatar_url","role","custom_role_id","max_chats","status","default_routing_status","group_ids","totp_enabled","created_at"],"additionalProperties":false}},"next_page_token":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["items","next_page_token"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"post":{"summary":"Create a bot","description":"Needs the `team.manage` permission.","tags":["Team"],"security":[{"bearer":[]},{"oauth2":["team.manage"]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"avatar_url":{"anyOf":[{"type":"string","maxLength":2048,"format":"uri"},{"type":"null"}]},"job_title":{"type":"string","maxLength":120},"max_chats":{"type":"integer","minimum":0,"maximum":100},"group_ids":{"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)$"}}},"required":["name"]}}}},"responses":{"201":{"description":"Created","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)$"},"organization_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":["agent","bot"]},"email":{"anyOf":[{"type":"string","maxLength":254,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]},"name":{"type":"string"},"job_title":{"type":"string"},"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"role":{"type":"string","enum":["owner","viceowner","admin","agent"]},"custom_role_id":{"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"}]},"max_chats":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","enum":["active","suspended","awaiting_approval"]},"default_routing_status":{"type":"string","enum":["accepting_chats","not_accepting_chats","offline"]},"group_ids":{"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)$"}},"totp_enabled":{"type":"boolean"},"created_at":{"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{3}(?:Z))$"}},"required":["id","organization_id","kind","email","name","job_title","avatar_url","role","custom_role_id","max_chats","status","default_routing_status","group_ids","totp_enabled","created_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/agents/{id}":{"get":{"summary":"One agent","description":"Needs the `team.read` permission.","tags":["Team"],"security":[{"bearer":[]},{"oauth2":["team.read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","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)$"},"organization_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":["agent","bot"]},"email":{"anyOf":[{"type":"string","maxLength":254,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]},"name":{"type":"string"},"job_title":{"type":"string"},"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"role":{"type":"string","enum":["owner","viceowner","admin","agent"]},"custom_role_id":{"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"}]},"max_chats":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","enum":["active","suspended","awaiting_approval"]},"default_routing_status":{"type":"string","enum":["accepting_chats","not_accepting_chats","offline"]},"group_ids":{"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)$"}},"totp_enabled":{"type":"boolean"},"created_at":{"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{3}(?:Z))$"}},"required":["id","organization_id","kind","email","name","job_title","avatar_url","role","custom_role_id","max_chats","status","default_routing_status","group_ids","totp_enabled","created_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"patch":{"summary":"Edit an agent (yourself: name, job title, avatar, default status)","description":"Needs the `team.manage` permission.","tags":["Team"],"security":[{"bearer":[]},{"oauth2":["team.manage"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"job_title":{"type":"string","maxLength":120},"avatar_url":{"anyOf":[{"type":"string","maxLength":2048,"format":"uri"},{"type":"null"}]},"max_chats":{"type":"integer","minimum":0,"maximum":100},"role":{"type":"string","enum":["viceowner","admin","agent"]},"custom_role_id":{"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"}]},"group_ids":{"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)$"}},"default_routing_status":{"type":"string","enum":["accepting_chats","not_accepting_chats","offline"]}}}}}},"responses":{"200":{"description":"OK","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)$"},"organization_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":["agent","bot"]},"email":{"anyOf":[{"type":"string","maxLength":254,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]},"name":{"type":"string"},"job_title":{"type":"string"},"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"role":{"type":"string","enum":["owner","viceowner","admin","agent"]},"custom_role_id":{"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"}]},"max_chats":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","enum":["active","suspended","awaiting_approval"]},"default_routing_status":{"type":"string","enum":["accepting_chats","not_accepting_chats","offline"]},"group_ids":{"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)$"}},"totp_enabled":{"type":"boolean"},"created_at":{"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{3}(?:Z))$"}},"required":["id","organization_id","kind","email","name","job_title","avatar_url","role","custom_role_id","max_chats","status","default_routing_status","group_ids","totp_enabled","created_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"delete":{"summary":"Remove an agent or bot","description":"Needs the `team.manage` permission.","tags":["Team"],"security":[{"bearer":[]},{"oauth2":["team.manage"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done."},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/agents/{id}:suspend":{"post":{"summary":"Suspend an agent","description":"Needs the `team.manage` permission.","tags":["Team"],"security":[{"bearer":[]},{"oauth2":["team.manage"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","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)$"},"organization_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":["agent","bot"]},"email":{"anyOf":[{"type":"string","maxLength":254,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]},"name":{"type":"string"},"job_title":{"type":"string"},"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"role":{"type":"string","enum":["owner","viceowner","admin","agent"]},"custom_role_id":{"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"}]},"max_chats":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","enum":["active","suspended","awaiting_approval"]},"default_routing_status":{"type":"string","enum":["accepting_chats","not_accepting_chats","offline"]},"group_ids":{"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)$"}},"totp_enabled":{"type":"boolean"},"created_at":{"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{3}(?:Z))$"}},"required":["id","organization_id","kind","email","name","job_title","avatar_url","role","custom_role_id","max_chats","status","default_routing_status","group_ids","totp_enabled","created_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/agents/{id}:reactivate":{"post":{"summary":"Reactivate a suspended agent","description":"Needs the `team.manage` permission.","tags":["Team"],"security":[{"bearer":[]},{"oauth2":["team.manage"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","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)$"},"organization_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":["agent","bot"]},"email":{"anyOf":[{"type":"string","maxLength":254,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]},"name":{"type":"string"},"job_title":{"type":"string"},"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"role":{"type":"string","enum":["owner","viceowner","admin","agent"]},"custom_role_id":{"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"}]},"max_chats":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","enum":["active","suspended","awaiting_approval"]},"default_routing_status":{"type":"string","enum":["accepting_chats","not_accepting_chats","offline"]},"group_ids":{"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)$"}},"totp_enabled":{"type":"boolean"},"created_at":{"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{3}(?:Z))$"}},"required":["id","organization_id","kind","email","name","job_title","avatar_url","role","custom_role_id","max_chats","status","default_routing_status","group_ids","totp_enabled","created_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/agents/{id}:approve":{"post":{"summary":"Approve a join request","description":"Needs the `team.manage` permission.","tags":["Team"],"security":[{"bearer":[]},{"oauth2":["team.manage"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","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)$"},"organization_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":["agent","bot"]},"email":{"anyOf":[{"type":"string","maxLength":254,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]},"name":{"type":"string"},"job_title":{"type":"string"},"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"role":{"type":"string","enum":["owner","viceowner","admin","agent"]},"custom_role_id":{"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"}]},"max_chats":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","enum":["active","suspended","awaiting_approval"]},"default_routing_status":{"type":"string","enum":["accepting_chats","not_accepting_chats","offline"]},"group_ids":{"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)$"}},"totp_enabled":{"type":"boolean"},"created_at":{"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{3}(?:Z))$"}},"required":["id","organization_id","kind","email","name","job_title","avatar_url","role","custom_role_id","max_chats","status","default_routing_status","group_ids","totp_enabled","created_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/agents/{id}:deny":{"post":{"summary":"Deny a join request","description":"Needs the `team.manage` permission.","tags":["Team"],"security":[{"bearer":[]},{"oauth2":["team.manage"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done."},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/invites":{"post":{"summary":"Invite people by email","description":"Needs the `team.manage` permission.","tags":["Team"],"security":[{"bearer":[]},{"oauth2":["team.manage"]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"emails":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string","maxLength":254,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"role":{"default":"agent","type":"string","enum":["viceowner","admin","agent"]},"custom_role_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)$"},"group_ids":{"default":[],"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)$"}}},"required":["emails"]}}}},"responses":{"201":{"description":"Created","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)$"},"email":{"type":"string","maxLength":254,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"role":{"type":"string","enum":["owner","viceowner","admin","agent"]},"custom_role_id":{"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"}]},"group_ids":{"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)$"}},"invited_by":{"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"}]},"expires_at":{"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{3}(?:Z))$"},"last_sent_at":{"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{3}(?:Z))$"},"send_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"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{3}(?:Z))$"}},"required":["id","email","role","custom_role_id","group_ids","invited_by","expires_at","last_sent_at","send_count","created_at"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"get":{"summary":"Open invites","description":"Needs the `team.read` permission.","tags":["Team"],"security":[{"bearer":[]},{"oauth2":["team.read"]}],"parameters":[],"responses":{"200":{"description":"OK","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)$"},"email":{"type":"string","maxLength":254,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"role":{"type":"string","enum":["owner","viceowner","admin","agent"]},"custom_role_id":{"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"}]},"group_ids":{"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)$"}},"invited_by":{"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"}]},"expires_at":{"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{3}(?:Z))$"},"last_sent_at":{"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{3}(?:Z))$"},"send_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"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{3}(?:Z))$"}},"required":["id","email","role","custom_role_id","group_ids","invited_by","expires_at","last_sent_at","send_count","created_at"],"additionalProperties":false}},"next_page_token":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["items","next_page_token"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/invites/{id}:remind":{"post":{"summary":"Send the invite again with a new link","description":"Needs the `team.manage` permission.","tags":["Team"],"security":[{"bearer":[]},{"oauth2":["team.manage"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","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)$"},"email":{"type":"string","maxLength":254,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"role":{"type":"string","enum":["owner","viceowner","admin","agent"]},"custom_role_id":{"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"}]},"group_ids":{"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)$"}},"invited_by":{"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"}]},"expires_at":{"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{3}(?:Z))$"},"last_sent_at":{"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{3}(?:Z))$"},"send_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"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{3}(?:Z))$"}},"required":["id","email","role","custom_role_id","group_ids","invited_by","expires_at","last_sent_at","send_count","created_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/invites/{id}":{"delete":{"summary":"Withdraw an invite","description":"Needs the `team.manage` permission.","tags":["Team"],"security":[{"bearer":[]},{"oauth2":["team.manage"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done."},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/invites:preview":{"post":{"summary":"What an invite link offers","description":"No token.","tags":["Team"],"security":[],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","maxLength":256}},"required":["token"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"organization_name":{"type":"string"},"inviter_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string","maxLength":254,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"role":{"type":"string","enum":["owner","viceowner","admin","agent"]},"account_exists":{"type":"boolean"},"expires_at":{"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{3}(?:Z))$"}},"required":["organization_name","inviter_name","email","role","account_exists","expires_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/invites:accept":{"post":{"summary":"Accept an invite","description":"No token.","tags":["Team"],"security":[],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","maxLength":256},"name":{"type":"string","minLength":1,"maxLength":120},"password":{"type":"string","maxLength":256}},"required":["token"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"anyOf":[{"anyOf":[{"type":"object","properties":{"access_token":{"type":"string"},"access_token_expires_at":{"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{3}(?:Z))$"},"refresh_token":{"type":"string"},"refresh_token_expires_at":{"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{3}(?:Z))$"},"session_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)$"},"organization_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)$"},"agent_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)$"},"restriction":{"anyOf":[{"type":"string","enum":["email_unverified","awaiting_approval","mfa_setup_required"]},{"type":"null"}]},"organizations":{"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)$"},"name":{"type":"string"},"license_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"role":{"type":"string","enum":["owner","viceowner","admin","agent"]}},"required":["id","name","license_id","role"],"additionalProperties":false}},"mfa_required":{"type":"boolean","const":false}},"required":["access_token","access_token_expires_at","refresh_token","refresh_token_expires_at","session_id","organization_id","agent_id","restriction","organizations","mfa_required"],"additionalProperties":false},{"type":"object","properties":{"mfa_required":{"type":"boolean","const":true},"mfa_token":{"type":"string"},"mfa_token_expires_at":{"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{3}(?:Z))$"}},"required":["mfa_required","mfa_token","mfa_token_expires_at"],"additionalProperties":false}]},{"type":"object","properties":{"organization_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)$"},"agent_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)$"},"switch_required":{"type":"boolean","const":true}},"required":["organization_id","agent_id","switch_required"],"additionalProperties":false}]}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/team/join-link":{"get":{"summary":"The team join link","description":"Needs the `team.manage` permission.","tags":["Team"],"security":[{"bearer":[]},{"oauth2":["team.manage"]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"token":{"type":"string"},"enabled":{"type":"boolean"}},"required":["url","token","enabled"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"patch":{"summary":"Turn the join link on or off","description":"Needs the `team.manage` permission.","tags":["Team"],"security":[{"bearer":[]},{"oauth2":["team.manage"]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"token":{"type":"string"},"enabled":{"type":"boolean"}},"required":["url","token","enabled"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/team/join-link:rotate":{"post":{"summary":"Replace the join link","description":"Needs the `team.manage` permission.","tags":["Team"],"security":[{"bearer":[]},{"oauth2":["team.manage"]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"token":{"type":"string"},"enabled":{"type":"boolean"}},"required":["url","token","enabled"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/team/join:preview":{"post":{"summary":"What a join link leads to","description":"No token.","tags":["Team"],"security":[],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","maxLength":256}},"required":["token"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"organization_name":{"type":"string"}},"required":["organization_name"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/team/join":{"post":{"summary":"Ask to join a team through its link","description":"No token.","tags":["Team"],"security":[],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","maxLength":256},"name":{"type":"string","minLength":1,"maxLength":120},"email":{"type":"string","maxLength":254,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"password":{"type":"string","maxLength":256},"turnstile_token":{"type":"string","maxLength":4096}},"required":["token","name","email","turnstile_token"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"access_token":{"type":"string"},"access_token_expires_at":{"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{3}(?:Z))$"},"refresh_token":{"type":"string"},"refresh_token_expires_at":{"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{3}(?:Z))$"},"session_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)$"},"organization_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)$"},"agent_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)$"},"restriction":{"anyOf":[{"type":"string","enum":["email_unverified","awaiting_approval","mfa_setup_required"]},{"type":"null"}]},"organizations":{"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)$"},"name":{"type":"string"},"license_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"role":{"type":"string","enum":["owner","viceowner","admin","agent"]}},"required":["id","name","license_id","role"],"additionalProperties":false}}},"required":["access_token","access_token_expires_at","refresh_token","refresh_token_expires_at","session_id","organization_id","agent_id","restriction","organizations"],"additionalProperties":false},{"type":"object","properties":{"organization_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)$"},"agent_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)$"},"switch_required":{"type":"boolean","const":true}},"required":["organization_id","agent_id","switch_required"],"additionalProperties":false}]}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/team/roles":{"get":{"summary":"Custom roles","description":"Needs the `team.read` permission.","tags":["Team"],"security":[{"bearer":[]},{"oauth2":["team.read"]}],"parameters":[],"responses":{"200":{"description":"OK","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)$"},"name":{"type":"string"},"description":{"type":"string"},"permissions":{"type":"array","items":{"type":"string","enum":["chats.access","chats.all","archives.read","archives.write","customers.read","customers.write","customers.ban","traffic.read","campaigns.manage","canned.manage","tags.manage","reports.read","team.read","team.manage","roles.manage","settings.manage","channels.manage","ai.manage","developers.manage","tokens.own","data.export","billing.manage","organization.manage"]}},"agent_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"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{3}(?:Z))$"}},"required":["id","name","description","permissions","agent_count","created_at"],"additionalProperties":false}},"next_page_token":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["items","next_page_token"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"post":{"summary":"Create a custom role","description":"A signed-in agent session with the `roles.manage` permission; API tokens are refused.","tags":["Team"],"security":[{"bearer":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"description":{"default":"","type":"string","maxLength":500},"permissions":{"maxItems":23,"type":"array","items":{"type":"string","enum":["chats.access","chats.all","archives.read","archives.write","customers.read","customers.write","customers.ban","traffic.read","campaigns.manage","canned.manage","tags.manage","reports.read","team.read","team.manage","roles.manage","settings.manage","channels.manage","ai.manage","developers.manage","tokens.own","data.export","billing.manage","organization.manage"]}}},"required":["name","permissions"]}}}},"responses":{"201":{"description":"Created","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)$"},"name":{"type":"string"},"description":{"type":"string"},"permissions":{"type":"array","items":{"type":"string","enum":["chats.access","chats.all","archives.read","archives.write","customers.read","customers.write","customers.ban","traffic.read","campaigns.manage","canned.manage","tags.manage","reports.read","team.read","team.manage","roles.manage","settings.manage","channels.manage","ai.manage","developers.manage","tokens.own","data.export","billing.manage","organization.manage"]}},"agent_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"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{3}(?:Z))$"}},"required":["id","name","description","permissions","agent_count","created_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/team/roles/{id}":{"patch":{"summary":"Edit a custom role","description":"A signed-in agent session with the `roles.manage` permission; API tokens are refused.","tags":["Team"],"security":[{"bearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"description":{"type":"string","maxLength":500},"permissions":{"maxItems":23,"type":"array","items":{"type":"string","enum":["chats.access","chats.all","archives.read","archives.write","customers.read","customers.write","customers.ban","traffic.read","campaigns.manage","canned.manage","tags.manage","reports.read","team.read","team.manage","roles.manage","settings.manage","channels.manage","ai.manage","developers.manage","tokens.own","data.export","billing.manage","organization.manage"]}}}}}}},"responses":{"200":{"description":"OK","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)$"},"name":{"type":"string"},"description":{"type":"string"},"permissions":{"type":"array","items":{"type":"string","enum":["chats.access","chats.all","archives.read","archives.write","customers.read","customers.write","customers.ban","traffic.read","campaigns.manage","canned.manage","tags.manage","reports.read","team.read","team.manage","roles.manage","settings.manage","channels.manage","ai.manage","developers.manage","tokens.own","data.export","billing.manage","organization.manage"]}},"agent_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"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{3}(?:Z))$"}},"required":["id","name","description","permissions","agent_count","created_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"delete":{"summary":"Delete a custom role","description":"A signed-in agent session with the `roles.manage` permission; API tokens are refused.","tags":["Team"],"security":[{"bearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done."},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/team/seats":{"get":{"summary":"Seats used and the plan's limit","description":"Needs the `team.read` permission.","tags":["Team"],"security":[{"bearer":[]},{"oauth2":["team.read"]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"seats_used":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"seat_limit":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"bots":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"suspended":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"awaiting_approval":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"pending_invites":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["seats_used","seat_limit","bots","suspended","awaiting_approval","pending_invites"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/organization":{"get":{"summary":"Company details and login policy","description":"Any valid token.","tags":["Organization"],"security":[{"bearer":[]}],"parameters":[],"responses":{"200":{"description":"OK","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)$"},"license_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"name":{"type":"string"},"region":{"type":"string","enum":["apac","eu","us"]},"timezone":{"type":"string"},"website":{"type":"string"},"company_size":{"anyOf":[{"type":"string","enum":["1","2-9","10-49","50-99","100-499","500-999","1000+"]},{"type":"null"}]},"status":{"type":"string","enum":["active","suspended","closed","deleting"]},"login_method":{"type":"string","enum":["any","sso"]},"require_2fa":{"type":"boolean"},"allowed_email_domains":{"type":"array","items":{"type":"string"}},"ip_allowlist":{"type":"array","items":{"type":"string"}},"created_at":{"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{3}(?:Z))$"}},"required":["id","license_id","name","region","timezone","website","company_size","status","login_method","require_2fa","allowed_email_domains","ip_allowlist","created_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"patch":{"summary":"Change company details and login policy","description":"A signed-in agent session with the `organization.manage` permission; API tokens are refused.","tags":["Organization"],"security":[{"bearer":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"timezone":{"type":"string","minLength":1,"maxLength":64},"website":{"type":"string","maxLength":253},"company_size":{"anyOf":[{"type":"string","enum":["1","2-9","10-49","50-99","100-499","500-999","1000+"]},{"type":"null"}]},"login_method":{"type":"string","enum":["any","sso"]},"require_2fa":{"type":"boolean"},"allowed_email_domains":{"maxItems":20,"type":"array","items":{"type":"string","pattern":"^(?=.{1,253}$)([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,63}$"}},"ip_allowlist":{"maxItems":50,"type":"array","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"OK","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)$"},"license_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"name":{"type":"string"},"region":{"type":"string","enum":["apac","eu","us"]},"timezone":{"type":"string"},"website":{"type":"string"},"company_size":{"anyOf":[{"type":"string","enum":["1","2-9","10-49","50-99","100-499","500-999","1000+"]},{"type":"null"}]},"status":{"type":"string","enum":["active","suspended","closed","deleting"]},"login_method":{"type":"string","enum":["any","sso"]},"require_2fa":{"type":"boolean"},"allowed_email_domains":{"type":"array","items":{"type":"string"}},"ip_allowlist":{"type":"array","items":{"type":"string"}},"created_at":{"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{3}(?:Z))$"}},"required":["id","license_id","name","region","timezone","website","company_size","status","login_method","require_2fa","allowed_email_domains","ip_allowlist","created_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/organization/ownership:transfer":{"post":{"summary":"Hand ownership to another agent","description":"A signed-in agent session only; API tokens are refused.","tags":["Organization"],"security":[{"bearer":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"agent_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)$"},"password":{"type":"string","maxLength":256}},"required":["agent_id","password"]}}}},"responses":{"204":{"description":"Done."},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/organization:delete":{"post":{"summary":"Delete the organization and all its data","description":"A signed-in agent session only; API tokens are refused.","tags":["Organization"],"security":[{"bearer":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"password":{"type":"string","maxLength":256},"organization_name":{"type":"string","maxLength":120}},"required":["password","organization_name"]}}}},"responses":{"204":{"description":"Done."},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/organization/audit-log":{"get":{"summary":"Who changed what","description":"A signed-in agent session with the `organization.manage` permission; API tokens are refused.","tags":["Organization"],"security":[{"bearer":[]}],"parameters":[{"name":"action","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"from","in":"query","required":false,"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{3}(?:Z))$"}},{"name":"to","in":"query","required":false,"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{3}(?:Z))$"}}],"responses":{"200":{"description":"OK","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)$"},"actor_agent_id":{"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"}]},"action":{"type":"string"},"target_type":{"anyOf":[{"type":"string"},{"type":"null"}]},"target_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}},"created_at":{"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{3}(?:Z))$"}},"required":["id","actor_agent_id","action","target_type","target_id","details","created_at"],"additionalProperties":false}},"next_page_token":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["items","next_page_token"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/organization/sso":{"get":{"summary":"SSO connections","description":"A signed-in agent session with the `organization.manage` permission; API tokens are refused.","tags":["SSO"],"security":[{"bearer":[]}],"parameters":[],"responses":{"200":{"description":"OK","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)$"},"kind":{"type":"string","enum":["saml","oidc"]},"name":{"type":"string"},"enabled":{"type":"boolean"},"auto_provision":{"type":"boolean"},"default_role":{"type":"string","enum":["admin","agent"]},"saml_idp_entity_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"saml_sso_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"saml_certificate_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"oidc_issuer":{"anyOf":[{"type":"string"},{"type":"null"}]},"oidc_client_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"oidc_client_secret_hint":{"type":"string"},"sp":{"type":"object","properties":{"entity_id":{"type":"string"},"acs_url":{"type":"string"},"oidc_redirect_uri":{"type":"string"}},"required":["entity_id","acs_url","oidc_redirect_uri"],"additionalProperties":false},"domains":{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string"},"verified":{"type":"boolean"},"txt_record":{"type":"string"}},"required":["domain","verified","txt_record"],"additionalProperties":false}},"created_at":{"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{3}(?:Z))$"}},"required":["id","kind","name","enabled","auto_provision","default_role","saml_idp_entity_id","saml_sso_url","saml_certificate_count","oidc_issuer","oidc_client_id","oidc_client_secret_hint","sp","domains","created_at"],"additionalProperties":false}},"next_page_token":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["items","next_page_token"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"post":{"summary":"Add a SAML or OIDC connection","description":"A signed-in agent session with the `organization.manage` permission; API tokens are refused.","tags":["SSO"],"security":[{"bearer":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"saml"},"name":{"type":"string","minLength":1,"maxLength":120},"enabled":{"default":true,"type":"boolean"},"auto_provision":{"default":false,"type":"boolean"},"default_role":{"default":"agent","type":"string","enum":["admin","agent"]},"saml_idp_entity_id":{"type":"string","minLength":1,"maxLength":1024},"saml_sso_url":{"type":"string","maxLength":2048,"format":"uri"},"saml_certificates":{"minItems":1,"maxItems":3,"type":"array","items":{"type":"string","minLength":100,"maxLength":16384}}},"required":["kind","name","saml_idp_entity_id","saml_sso_url","saml_certificates"]},{"type":"object","properties":{"kind":{"type":"string","const":"oidc"},"name":{"type":"string","minLength":1,"maxLength":120},"enabled":{"default":true,"type":"boolean"},"auto_provision":{"default":false,"type":"boolean"},"default_role":{"default":"agent","type":"string","enum":["admin","agent"]},"oidc_issuer":{"type":"string","maxLength":2048,"format":"uri"},"oidc_client_id":{"type":"string","minLength":1,"maxLength":512},"oidc_client_secret":{"type":"string","minLength":1,"maxLength":2048}},"required":["kind","name","oidc_issuer","oidc_client_id","oidc_client_secret"]}]}}}},"responses":{"201":{"description":"Created","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)$"},"kind":{"type":"string","enum":["saml","oidc"]},"name":{"type":"string"},"enabled":{"type":"boolean"},"auto_provision":{"type":"boolean"},"default_role":{"type":"string","enum":["admin","agent"]},"saml_idp_entity_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"saml_sso_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"saml_certificate_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"oidc_issuer":{"anyOf":[{"type":"string"},{"type":"null"}]},"oidc_client_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"oidc_client_secret_hint":{"type":"string"},"sp":{"type":"object","properties":{"entity_id":{"type":"string"},"acs_url":{"type":"string"},"oidc_redirect_uri":{"type":"string"}},"required":["entity_id","acs_url","oidc_redirect_uri"],"additionalProperties":false},"domains":{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string"},"verified":{"type":"boolean"},"txt_record":{"type":"string"}},"required":["domain","verified","txt_record"],"additionalProperties":false}},"created_at":{"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{3}(?:Z))$"}},"required":["id","kind","name","enabled","auto_provision","default_role","saml_idp_entity_id","saml_sso_url","saml_certificate_count","oidc_issuer","oidc_client_id","oidc_client_secret_hint","sp","domains","created_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/organization/sso/{id}":{"patch":{"summary":"Edit a connection","description":"A signed-in agent session with the `organization.manage` permission; API tokens are refused.","tags":["SSO"],"security":[{"bearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"enabled":{"type":"boolean"},"auto_provision":{"type":"boolean"},"default_role":{"type":"string","enum":["admin","agent"]},"saml_idp_entity_id":{"type":"string","minLength":1,"maxLength":1024},"saml_sso_url":{"type":"string","maxLength":2048,"format":"uri"},"saml_certificates":{"minItems":1,"maxItems":3,"type":"array","items":{"type":"string","minLength":100,"maxLength":16384}},"oidc_issuer":{"type":"string","maxLength":2048,"format":"uri"},"oidc_client_id":{"type":"string","minLength":1,"maxLength":512},"oidc_client_secret":{"type":"string","minLength":1,"maxLength":2048}}}}}},"responses":{"200":{"description":"OK","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)$"},"kind":{"type":"string","enum":["saml","oidc"]},"name":{"type":"string"},"enabled":{"type":"boolean"},"auto_provision":{"type":"boolean"},"default_role":{"type":"string","enum":["admin","agent"]},"saml_idp_entity_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"saml_sso_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"saml_certificate_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"oidc_issuer":{"anyOf":[{"type":"string"},{"type":"null"}]},"oidc_client_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"oidc_client_secret_hint":{"type":"string"},"sp":{"type":"object","properties":{"entity_id":{"type":"string"},"acs_url":{"type":"string"},"oidc_redirect_uri":{"type":"string"}},"required":["entity_id","acs_url","oidc_redirect_uri"],"additionalProperties":false},"domains":{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string"},"verified":{"type":"boolean"},"txt_record":{"type":"string"}},"required":["domain","verified","txt_record"],"additionalProperties":false}},"created_at":{"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{3}(?:Z))$"}},"required":["id","kind","name","enabled","auto_provision","default_role","saml_idp_entity_id","saml_sso_url","saml_certificate_count","oidc_issuer","oidc_client_id","oidc_client_secret_hint","sp","domains","created_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"delete":{"summary":"Remove a connection","description":"A signed-in agent session with the `organization.manage` permission; API tokens are refused.","tags":["SSO"],"security":[{"bearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done."},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/organization/sso/{id}/domains":{"post":{"summary":"Claim an email domain","description":"A signed-in agent session with the `organization.manage` permission; API tokens are refused.","tags":["SSO"],"security":[{"bearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string","pattern":"^(?=.{1,253}$)([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,63}$"}},"required":["domain"]}}}},"responses":{"201":{"description":"Created","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)$"},"kind":{"type":"string","enum":["saml","oidc"]},"name":{"type":"string"},"enabled":{"type":"boolean"},"auto_provision":{"type":"boolean"},"default_role":{"type":"string","enum":["admin","agent"]},"saml_idp_entity_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"saml_sso_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"saml_certificate_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"oidc_issuer":{"anyOf":[{"type":"string"},{"type":"null"}]},"oidc_client_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"oidc_client_secret_hint":{"type":"string"},"sp":{"type":"object","properties":{"entity_id":{"type":"string"},"acs_url":{"type":"string"},"oidc_redirect_uri":{"type":"string"}},"required":["entity_id","acs_url","oidc_redirect_uri"],"additionalProperties":false},"domains":{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string"},"verified":{"type":"boolean"},"txt_record":{"type":"string"}},"required":["domain","verified","txt_record"],"additionalProperties":false}},"created_at":{"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{3}(?:Z))$"}},"required":["id","kind","name","enabled","auto_provision","default_role","saml_idp_entity_id","saml_sso_url","saml_certificate_count","oidc_issuer","oidc_client_id","oidc_client_secret_hint","sp","domains","created_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/organization/sso/{id}/domains/{domain}:verify":{"post":{"summary":"Check the domain's DNS TXT record","description":"A signed-in agent session with the `organization.manage` permission; API tokens are refused.","tags":["SSO"],"security":[{"bearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"domain","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","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)$"},"kind":{"type":"string","enum":["saml","oidc"]},"name":{"type":"string"},"enabled":{"type":"boolean"},"auto_provision":{"type":"boolean"},"default_role":{"type":"string","enum":["admin","agent"]},"saml_idp_entity_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"saml_sso_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"saml_certificate_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"oidc_issuer":{"anyOf":[{"type":"string"},{"type":"null"}]},"oidc_client_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"oidc_client_secret_hint":{"type":"string"},"sp":{"type":"object","properties":{"entity_id":{"type":"string"},"acs_url":{"type":"string"},"oidc_redirect_uri":{"type":"string"}},"required":["entity_id","acs_url","oidc_redirect_uri"],"additionalProperties":false},"domains":{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string"},"verified":{"type":"boolean"},"txt_record":{"type":"string"}},"required":["domain","verified","txt_record"],"additionalProperties":false}},"created_at":{"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{3}(?:Z))$"}},"required":["id","kind","name","enabled","auto_provision","default_role","saml_idp_entity_id","saml_sso_url","saml_certificate_count","oidc_issuer","oidc_client_id","oidc_client_secret_hint","sp","domains","created_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/organization/sso/{id}/domains/{domain}":{"delete":{"summary":"Release a domain","description":"A signed-in agent session with the `organization.manage` permission; API tokens are refused.","tags":["SSO"],"security":[{"bearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"domain","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","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)$"},"kind":{"type":"string","enum":["saml","oidc"]},"name":{"type":"string"},"enabled":{"type":"boolean"},"auto_provision":{"type":"boolean"},"default_role":{"type":"string","enum":["admin","agent"]},"saml_idp_entity_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"saml_sso_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"saml_certificate_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"oidc_issuer":{"anyOf":[{"type":"string"},{"type":"null"}]},"oidc_client_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"oidc_client_secret_hint":{"type":"string"},"sp":{"type":"object","properties":{"entity_id":{"type":"string"},"acs_url":{"type":"string"},"oidc_redirect_uri":{"type":"string"}},"required":["entity_id","acs_url","oidc_redirect_uri"],"additionalProperties":false},"domains":{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string"},"verified":{"type":"boolean"},"txt_record":{"type":"string"}},"required":["domain","verified","txt_record"],"additionalProperties":false}},"created_at":{"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{3}(?:Z))$"}},"required":["id","kind","name","enabled","auto_provision","default_role","saml_idp_entity_id","saml_sso_url","saml_certificate_count","oidc_issuer","oidc_client_id","oidc_client_secret_hint","sp","domains","created_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/billing/plans":{"get":{"summary":"The plans anyone can choose","description":"No token.","tags":["Billing"],"security":[],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","pattern":"^[a-z0-9_-]{1,32}$"},"name":{"type":"string"},"description":{"type":"string"},"price_cents_monthly":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"price_cents_yearly":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"limits":{"type":"object","propertyNames":{"type":"string","enum":["seats","transcript_emails_per_month","chats_per_month","automated_conversations_per_month","api_conversations_per_month","emails_per_month","api_requests_per_month","max_upload_bytes","workflows","workflow_runs_per_month","retention_days","security_controls","history_days"]},"additionalProperties":{"type":"integer","minimum":0,"maximum":9007199254740991}},"features":{"type":"array","items":{"type":"string"}},"contact_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["code","name","description","price_cents_monthly","price_cents_yearly","currency","limits","features","contact_url","position"],"additionalProperties":false}},"next_page_token":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["items","next_page_token"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/billing/overview":{"get":{"summary":"The organization's plan, seats and this month's usage","description":"Any valid token.","tags":["Billing"],"security":[{"bearer":[]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"plan":{"type":"object","properties":{"code":{"type":"string","pattern":"^[a-z0-9_-]{1,32}$"},"name":{"type":"string"},"description":{"type":"string"},"price_cents_monthly":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"price_cents_yearly":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"limits":{"type":"object","propertyNames":{"type":"string","enum":["seats","transcript_emails_per_month","chats_per_month","automated_conversations_per_month","api_conversations_per_month","emails_per_month","api_requests_per_month","max_upload_bytes","workflows","workflow_runs_per_month","retention_days","security_controls","history_days"]},"additionalProperties":{"type":"integer","minimum":0,"maximum":9007199254740991}},"features":{"type":"array","items":{"type":"string"}},"contact_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["code","name","description","price_cents_monthly","price_cents_yearly","currency","limits","features","contact_url","position"],"additionalProperties":false},"subscription":{"type":"object","properties":{"plan_code":{"type":"string","pattern":"^[a-z0-9_-]{1,32}$"},"status":{"type":"string","enum":["active","trialing","past_due","canceled"]},"billing_cycle":{"type":"string","enum":["monthly","yearly"]},"current_period_start":{"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{3}(?:Z))$"},{"type":"null"}]},"current_period_end":{"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{3}(?:Z))$"},{"type":"null"}]},"provider":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["plan_code","status","billing_cycle","current_period_start","current_period_end","provider"],"additionalProperties":false},"period":{"type":"string","pattern":"^\\d{4}-\\d{2}$"},"seats_used":{"type":"integer","minimum":0,"maximum":9007199254740991},"usage":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","enum":["seats","transcript_emails_per_month","chats_per_month","automated_conversations_per_month","api_conversations_per_month","emails_per_month","api_requests_per_month","max_upload_bytes","workflows","workflow_runs_per_month","retention_days","security_controls","history_days"]},"used":{"type":"integer","minimum":0,"maximum":9007199254740991},"limit":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["key","used","limit"],"additionalProperties":false}},"payments_enabled":{"type":"boolean"}},"required":["plan","subscription","period","seats_used","usage","payments_enabled"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/billing/subscription:change":{"post":{"summary":"Move the organization to another plan","description":"A signed-in agent session with the `billing.manage` permission; API tokens are refused.","tags":["Billing"],"security":[{"bearer":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"plan_code":{"type":"string","pattern":"^[a-z0-9_-]{1,32}$"},"billing_cycle":{"default":"monthly","type":"string","enum":["monthly","yearly"]},"seats":{"type":"integer","minimum":1,"maximum":100000},"provider":{"type":"string","enum":["stripe","nowpayments"]},"months":{"type":"number","enum":[1,3,12]}},"required":["plan_code"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"changed"},"overview":{"type":"object","properties":{"plan":{"type":"object","properties":{"code":{"type":"string","pattern":"^[a-z0-9_-]{1,32}$"},"name":{"type":"string"},"description":{"type":"string"},"price_cents_monthly":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"price_cents_yearly":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"limits":{"type":"object","propertyNames":{"type":"string","enum":["seats","transcript_emails_per_month","chats_per_month","automated_conversations_per_month","api_conversations_per_month","emails_per_month","api_requests_per_month","max_upload_bytes","workflows","workflow_runs_per_month","retention_days","security_controls","history_days"]},"additionalProperties":{"type":"integer","minimum":0,"maximum":9007199254740991}},"features":{"type":"array","items":{"type":"string"}},"contact_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["code","name","description","price_cents_monthly","price_cents_yearly","currency","limits","features","contact_url","position"],"additionalProperties":false},"subscription":{"type":"object","properties":{"plan_code":{"type":"string","pattern":"^[a-z0-9_-]{1,32}$"},"status":{"type":"string","enum":["active","trialing","past_due","canceled"]},"billing_cycle":{"type":"string","enum":["monthly","yearly"]},"current_period_start":{"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{3}(?:Z))$"},{"type":"null"}]},"current_period_end":{"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{3}(?:Z))$"},{"type":"null"}]},"provider":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["plan_code","status","billing_cycle","current_period_start","current_period_end","provider"],"additionalProperties":false},"period":{"type":"string","pattern":"^\\d{4}-\\d{2}$"},"seats_used":{"type":"integer","minimum":0,"maximum":9007199254740991},"usage":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","enum":["seats","transcript_emails_per_month","chats_per_month","automated_conversations_per_month","api_conversations_per_month","emails_per_month","api_requests_per_month","max_upload_bytes","workflows","workflow_runs_per_month","retention_days","security_controls","history_days"]},"used":{"type":"integer","minimum":0,"maximum":9007199254740991},"limit":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["key","used","limit"],"additionalProperties":false}},"payments_enabled":{"type":"boolean"}},"required":["plan","subscription","period","seats_used","usage","payments_enabled"],"additionalProperties":false}},"required":["kind","overview"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"checkout"},"checkout_url":{"type":"string","format":"uri"}},"required":["kind","checkout_url"],"additionalProperties":false}]}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/channels/catalog":{"get":{"summary":"Every channel: capabilities, credential form, how it connects","description":"Any valid token.","tags":["Channels"],"security":[{"bearer":[]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"channels":{"type":"array","items":{"type":"object","properties":{"channel":{"type":"string","enum":["whatsapp","messenger","instagram","telegram","line","zalo","viber","wechat","kakaotalk","sms","x","discord","slack","teams","apple_messages"]},"capabilities":{"type":"object","properties":{"text":{"type":"object","properties":{"max_length":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["max_length"],"additionalProperties":false},"media":{"type":"object","propertyNames":{"type":"string","enum":["image","video","audio","document","sticker"]},"additionalProperties":{"type":"object","properties":{"max_bytes":{"type":"integer","minimum":0,"maximum":9007199254740991},"content_types":{"type":"array","items":{"type":"string"}}},"required":["max_bytes","content_types"],"additionalProperties":false}},"inbound":{"type":"object","properties":{"media":{"type":"boolean"},"postbacks":{"type":"boolean"}},"required":["media","postbacks"],"additionalProperties":false},"quick_replies":{"anyOf":[{"type":"object","properties":{"max":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"title_max":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["max","title_max"],"additionalProperties":false},{"type":"null"}]},"cards":{"anyOf":[{"type":"object","properties":{"max_elements":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_buttons":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["max_elements","max_buttons"],"additionalProperties":false},{"type":"null"}]},"templates":{"type":"boolean"},"typing":{"type":"boolean"},"mark_seen":{"type":"boolean"},"receipts":{"type":"boolean"},"reactions":{"type":"boolean"},"window":{"anyOf":[{"type":"object","properties":{"hours":{"type":"integer","minimum":1,"maximum":9007199254740991},"after":{"type":"string","enum":["template","human_agent_tag","closed"]},"tag_hours":{"anyOf":[{"type":"integer","minimum":1,"maximum":9007199254740991},{"type":"null"}]}},"required":["hours","after","tag_hours"],"additionalProperties":false},{"type":"null"}]},"rate_per_second":{"type":"integer","minimum":1,"maximum":9007199254740991},"billing":{"type":"string","enum":["free","tenant"]}},"required":["text","media","inbound","quick_replies","cards","templates","typing","mark_seen","receipts","reactions","window","rate_per_second","billing"],"additionalProperties":false},"credential_fields":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]*$"},"secret":{"type":"boolean"},"required":{"type":"boolean"}},"required":["key","secret","required"],"additionalProperties":false}},"platform_connect":{"anyOf":[{"type":"string","enum":["whatsapp_embedded_signup","facebook_login"]},{"type":"null"}]},"available":{"type":"boolean"}},"required":["channel","capabilities","credential_fields","platform_connect","available"],"additionalProperties":false}},"meta":{"type":"object","properties":{"app_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"graph_version":{"type":"string"},"whatsapp_config_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"login_config_id":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["app_id","graph_version","whatsapp_config_id","login_config_id"],"additionalProperties":false}},"required":["channels","meta"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/channels/connections":{"get":{"summary":"List channel connections","description":"Any valid token.","tags":["Channels"],"security":[{"bearer":[]}],"parameters":[{"name":"channel","in":"query","required":false,"schema":{"type":"string","enum":["whatsapp","messenger","instagram","telegram","line","zalo","viber","wechat","kakaotalk","sms","x","discord","slack","teams","apple_messages"]}}],"responses":{"200":{"description":"OK","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)$"},"channel":{"type":"string","enum":["whatsapp","messenger","instagram","telegram","line","zalo","viber","wechat","kakaotalk","sms","x","discord","slack","teams","apple_messages"]},"external_id":{"type":"string"},"name":{"type":"string","maxLength":120},"status":{"type":"string","enum":["active","error","disabled"]},"credentials_hint":{"type":"string"},"group_id":{"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"}]},"last_error_code":{"anyOf":[{"type":"string"},{"type":"null"}]},"mode":{"type":"string","enum":["embedded","oauth","credentials"]},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}},"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"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{3}(?:Z))$"}},"required":["id","channel","external_id","name","status","credentials_hint","group_id","last_error_code","mode","details","webhook_url","created_at"],"additionalProperties":false}},"next_page_token":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["items","next_page_token"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"post":{"summary":"Connect a channel with the tenant's own credentials","description":"Needs the `channels.manage` permission.","tags":["Channels"],"security":[{"bearer":[]},{"oauth2":["channels.manage"]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"channel":{"type":"string","enum":["whatsapp","messenger","instagram","telegram","line","zalo","viber","wechat","kakaotalk","sms","x","discord","slack","teams","apple_messages"]},"name":{"type":"string","maxLength":120},"group_id":{"default":null,"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"}]},"credentials":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"string","maxLength":4096}}},"required":["channel","credentials"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"connections":{"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)$"},"channel":{"type":"string","enum":["whatsapp","messenger","instagram","telegram","line","zalo","viber","wechat","kakaotalk","sms","x","discord","slack","teams","apple_messages"]},"external_id":{"type":"string"},"name":{"type":"string","maxLength":120},"status":{"type":"string","enum":["active","error","disabled"]},"credentials_hint":{"type":"string"},"group_id":{"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"}]},"last_error_code":{"anyOf":[{"type":"string"},{"type":"null"}]},"mode":{"type":"string","enum":["embedded","oauth","credentials"]},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}},"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"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{3}(?:Z))$"}},"required":["id","channel","external_id","name","status","credentials_hint","group_id","last_error_code","mode","details","webhook_url","created_at"],"additionalProperties":false}},"manual_steps":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"value":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","value"],"additionalProperties":false}}},"required":["connections","manual_steps"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/channels/connections/{connection_id}":{"get":{"summary":"Get a channel connection","description":"Any valid token.","tags":["Channels"],"security":[{"bearer":[]}],"parameters":[{"name":"connection_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","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)$"},"channel":{"type":"string","enum":["whatsapp","messenger","instagram","telegram","line","zalo","viber","wechat","kakaotalk","sms","x","discord","slack","teams","apple_messages"]},"external_id":{"type":"string"},"name":{"type":"string","maxLength":120},"status":{"type":"string","enum":["active","error","disabled"]},"credentials_hint":{"type":"string"},"group_id":{"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"}]},"last_error_code":{"anyOf":[{"type":"string"},{"type":"null"}]},"mode":{"type":"string","enum":["embedded","oauth","credentials"]},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}},"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"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{3}(?:Z))$"}},"required":["id","channel","external_id","name","status","credentials_hint","group_id","last_error_code","mode","details","webhook_url","created_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"patch":{"summary":"Rename, regroup, disable or re-credential a connection","description":"Needs the `channels.manage` permission.","tags":["Channels"],"security":[{"bearer":[]},{"oauth2":["channels.manage"]}],"parameters":[{"name":"connection_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"group_id":{"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","enum":["active","disabled"]},"credentials":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"string","maxLength":4096}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"connections":{"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)$"},"channel":{"type":"string","enum":["whatsapp","messenger","instagram","telegram","line","zalo","viber","wechat","kakaotalk","sms","x","discord","slack","teams","apple_messages"]},"external_id":{"type":"string"},"name":{"type":"string","maxLength":120},"status":{"type":"string","enum":["active","error","disabled"]},"credentials_hint":{"type":"string"},"group_id":{"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"}]},"last_error_code":{"anyOf":[{"type":"string"},{"type":"null"}]},"mode":{"type":"string","enum":["embedded","oauth","credentials"]},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}},"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"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{3}(?:Z))$"}},"required":["id","channel","external_id","name","status","credentials_hint","group_id","last_error_code","mode","details","webhook_url","created_at"],"additionalProperties":false}},"manual_steps":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"value":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","value"],"additionalProperties":false}}},"required":["connections","manual_steps"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"delete":{"summary":"Disconnect a channel","description":"Needs the `channels.manage` permission.","tags":["Channels"],"security":[{"bearer":[]},{"oauth2":["channels.manage"]}],"parameters":[{"name":"connection_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"webhook_moved","in":"query","required":false,"schema":{"default":"false","type":"string","enum":["true","false"]}}],"responses":{"204":{"description":"Done."},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/channels/connections/{connection_id}:test":{"post":{"summary":"Re-check a connection's credentials","description":"Needs the `channels.manage` permission.","tags":["Channels"],"security":[{"bearer":[]},{"oauth2":["channels.manage"]}],"parameters":[{"name":"connection_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","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)$"},"channel":{"type":"string","enum":["whatsapp","messenger","instagram","telegram","line","zalo","viber","wechat","kakaotalk","sms","x","discord","slack","teams","apple_messages"]},"external_id":{"type":"string"},"name":{"type":"string","maxLength":120},"status":{"type":"string","enum":["active","error","disabled"]},"credentials_hint":{"type":"string"},"group_id":{"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"}]},"last_error_code":{"anyOf":[{"type":"string"},{"type":"null"}]},"mode":{"type":"string","enum":["embedded","oauth","credentials"]},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}},"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"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{3}(?:Z))$"}},"required":["id","channel","external_id","name","status","credentials_hint","group_id","last_error_code","mode","details","webhook_url","created_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/channels/connections/{connection_id}:sync_templates":{"post":{"summary":"Sync WhatsApp message templates from Meta","description":"Needs the `channels.manage` permission.","tags":["Channels"],"security":[{"bearer":[]},{"oauth2":["channels.manage"]}],"parameters":[{"name":"connection_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"language":{"type":"string"},"status":{"type":"string"},"category":{"type":"string"},"components":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}},"required":["id","name","language","status","category","components"],"additionalProperties":false}},"next_page_token":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["items","next_page_token"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/channels/connections/{connection_id}/templates":{"get":{"summary":"List stored WhatsApp message templates","description":"Any valid token.","tags":["Channels"],"security":[{"bearer":[]}],"parameters":[{"name":"connection_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","maxLength":32}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"language":{"type":"string"},"status":{"type":"string"},"category":{"type":"string"},"components":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}},"required":["id","name","language","status","category","components"],"additionalProperties":false}},"next_page_token":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["items","next_page_token"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/channels/connections/{connection_id}/phone_numbers":{"get":{"summary":"List the WhatsApp Business Account's phone numbers","description":"Needs the `channels.manage` permission.","tags":["Channels"],"security":[{"bearer":[]},{"oauth2":["channels.manage"]}],"parameters":[{"name":"connection_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"display_phone_number":{"type":"string"},"verified_name":{"type":"string"},"quality_rating":{"anyOf":[{"type":"string"},{"type":"null"}]},"verification_status":{"anyOf":[{"type":"string"},{"type":"null"}]},"messaging_limit_tier":{"anyOf":[{"type":"string"},{"type":"null"}]},"connection_id":{"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"}]}},"required":["id","display_phone_number","verified_name","quality_rating","verification_status","messaging_limit_tier","connection_id"],"additionalProperties":false}},"next_page_token":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["items","next_page_token"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/channels/connections/{connection_id}/phone_numbers/{number_id}:connect":{"post":{"summary":"Connect another number of the same WhatsApp Business Account","description":"Needs the `channels.manage` permission.","tags":["Channels"],"security":[{"bearer":[]},{"oauth2":["channels.manage"]}],"parameters":[{"name":"connection_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"number_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"group_id":{"default":null,"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"}]}}}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"connections":{"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)$"},"channel":{"type":"string","enum":["whatsapp","messenger","instagram","telegram","line","zalo","viber","wechat","kakaotalk","sms","x","discord","slack","teams","apple_messages"]},"external_id":{"type":"string"},"name":{"type":"string","maxLength":120},"status":{"type":"string","enum":["active","error","disabled"]},"credentials_hint":{"type":"string"},"group_id":{"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"}]},"last_error_code":{"anyOf":[{"type":"string"},{"type":"null"}]},"mode":{"type":"string","enum":["embedded","oauth","credentials"]},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}},"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"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{3}(?:Z))$"}},"required":["id","channel","external_id","name","status","credentials_hint","group_id","last_error_code","mode","details","webhook_url","created_at"],"additionalProperties":false}},"manual_steps":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"value":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","value"],"additionalProperties":false}}},"required":["connections","manual_steps"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/channels/whatsapp:embedded_signup":{"post":{"summary":"Finish WhatsApp embedded signup","description":"Needs the `channels.manage` permission.","tags":["Channels"],"security":[{"bearer":[]},{"oauth2":["channels.manage"]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","minLength":1,"maxLength":2048},"waba_id":{"type":"string","pattern":"^\\d{1,32}$"},"phone_number_id":{"type":"string","pattern":"^\\d{1,32}$"},"pin":{"type":"string","pattern":"^\\d{6}$"},"group_id":{"default":null,"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"}]}},"required":["code","waba_id","phone_number_id"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"connections":{"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)$"},"channel":{"type":"string","enum":["whatsapp","messenger","instagram","telegram","line","zalo","viber","wechat","kakaotalk","sms","x","discord","slack","teams","apple_messages"]},"external_id":{"type":"string"},"name":{"type":"string","maxLength":120},"status":{"type":"string","enum":["active","error","disabled"]},"credentials_hint":{"type":"string"},"group_id":{"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"}]},"last_error_code":{"anyOf":[{"type":"string"},{"type":"null"}]},"mode":{"type":"string","enum":["embedded","oauth","credentials"]},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}},"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"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{3}(?:Z))$"}},"required":["id","channel","external_id","name","status","credentials_hint","group_id","last_error_code","mode","details","webhook_url","created_at"],"additionalProperties":false}},"manual_steps":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"value":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","value"],"additionalProperties":false}}},"required":["connections","manual_steps"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/channels/meta:pages":{"post":{"summary":"Facebook Login: the Pages and Instagram accounts the login manages","description":"Needs the `channels.manage` permission.","tags":["Channels"],"security":[{"bearer":[]},{"oauth2":["channels.manage"]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","minLength":1,"maxLength":2048}},"required":["code"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"grant_id":{"type":"string"},"pages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"instagram":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"username":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","username"],"additionalProperties":false},{"type":"null"}]},"connected":{"type":"object","properties":{"messenger":{"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"}]},"instagram":{"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"}]}},"required":["messenger","instagram"],"additionalProperties":false}},"required":["id","name","instagram","connected"],"additionalProperties":false}}},"required":["grant_id","pages"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/channels/meta:connect":{"post":{"summary":"Facebook Login: connect Pages' Messenger and Instagram inboxes","description":"Needs the `channels.manage` permission.","tags":["Channels"],"security":[{"bearer":[]},{"oauth2":["channels.manage"]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"grant_id":{"type":"string","minLength":1,"maxLength":64},"pages":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"page_id":{"type":"string","pattern":"^\\d{1,32}$"},"messenger":{"type":"boolean"},"instagram":{"type":"boolean"},"group_id":{"default":null,"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"}]}},"required":["page_id","messenger","instagram"]}}},"required":["grant_id","pages"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"connections":{"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)$"},"channel":{"type":"string","enum":["whatsapp","messenger","instagram","telegram","line","zalo","viber","wechat","kakaotalk","sms","x","discord","slack","teams","apple_messages"]},"external_id":{"type":"string"},"name":{"type":"string","maxLength":120},"status":{"type":"string","enum":["active","error","disabled"]},"credentials_hint":{"type":"string"},"group_id":{"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"}]},"last_error_code":{"anyOf":[{"type":"string"},{"type":"null"}]},"mode":{"type":"string","enum":["embedded","oauth","credentials"]},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}},"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"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{3}(?:Z))$"}},"required":["id","channel","external_id","name","status","credentials_hint","group_id","last_error_code","mode","details","webhook_url","created_at"],"additionalProperties":false}},"manual_steps":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"value":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","value"],"additionalProperties":false}}},"required":["connections","manual_steps"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/channels/chats/{chat_id}":{"get":{"summary":"A chat's channel, reply window and what the composer may send","description":"Needs the `chats.access` permission.","tags":["Channels"],"security":[{"bearer":[]},{"oauth2":["chats.access"]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"channel":{"type":"string","enum":["whatsapp","messenger","instagram","telegram","line","zalo","viber","wechat","kakaotalk","sms","x","discord","slack","teams","apple_messages"]},"connection":{"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)$"},"name":{"type":"string"},"status":{"type":"string","enum":["active","error","disabled"]}},"required":["id","name","status"],"additionalProperties":false},"capabilities":{"type":"object","properties":{"text":{"type":"object","properties":{"max_length":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["max_length"],"additionalProperties":false},"media":{"type":"object","propertyNames":{"type":"string","enum":["image","video","audio","document","sticker"]},"additionalProperties":{"type":"object","properties":{"max_bytes":{"type":"integer","minimum":0,"maximum":9007199254740991},"content_types":{"type":"array","items":{"type":"string"}}},"required":["max_bytes","content_types"],"additionalProperties":false}},"inbound":{"type":"object","properties":{"media":{"type":"boolean"},"postbacks":{"type":"boolean"}},"required":["media","postbacks"],"additionalProperties":false},"quick_replies":{"anyOf":[{"type":"object","properties":{"max":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"title_max":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["max","title_max"],"additionalProperties":false},{"type":"null"}]},"cards":{"anyOf":[{"type":"object","properties":{"max_elements":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_buttons":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["max_elements","max_buttons"],"additionalProperties":false},{"type":"null"}]},"templates":{"type":"boolean"},"typing":{"type":"boolean"},"mark_seen":{"type":"boolean"},"receipts":{"type":"boolean"},"reactions":{"type":"boolean"},"window":{"anyOf":[{"type":"object","properties":{"hours":{"type":"integer","minimum":1,"maximum":9007199254740991},"after":{"type":"string","enum":["template","human_agent_tag","closed"]},"tag_hours":{"anyOf":[{"type":"integer","minimum":1,"maximum":9007199254740991},{"type":"null"}]}},"required":["hours","after","tag_hours"],"additionalProperties":false},{"type":"null"}]},"rate_per_second":{"type":"integer","minimum":1,"maximum":9007199254740991},"billing":{"type":"string","enum":["free","tenant"]}},"required":["text","media","inbound","quick_replies","cards","templates","typing","mark_seen","receipts","reactions","window","rate_per_second","billing"],"additionalProperties":false},"last_customer_message_at":{"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{3}(?:Z))$"},{"type":"null"}]},"window":{"type":"object","properties":{"mode":{"type":"string","enum":["none","open","tag","template","closed"]},"until":{"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{3}(?:Z))$"},{"type":"null"}]}},"required":["mode","until"],"additionalProperties":false},"gate":{"type":"object","properties":{"text":{"type":"boolean"},"attachments":{"type":"array","items":{"type":"string","enum":["image","video","audio","document","sticker"]}},"quick_replies":{"type":"boolean"},"cards":{"type":"boolean"},"templates":{"type":"boolean"},"reason":{"anyOf":[{"type":"string","enum":["window_closed","templates_only","connection_disabled"]},{"type":"null"}]}},"required":["text","attachments","quick_replies","cards","templates","reason"],"additionalProperties":false}},"required":["chat_id","channel","connection","capabilities","last_customer_message_at","window","gate"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/config/canned-responses":{"get":{"summary":"List the canned responses the caller can use","description":"Needs the `chats.access` permission.","tags":["Canned responses"],"security":[{"bearer":[]},{"oauth2":["chats.access"]}],"parameters":[{"name":"visibility","in":"query","required":false,"schema":{"default":"all","type":"string","enum":["all","shared","private"]}},{"name":"group_id","in":"query","required":false,"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":"q","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"shortcut_prefix","in":"query","required":false,"schema":{"type":"string"}},{"name":"suggest_on","in":"query","required":false,"schema":{"type":"string","enum":["chat_started","chat_transferred","chat_idle","chat_rated_good","chat_rated_bad","ai_proposed"]}}],"responses":{"200":{"description":"OK","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)$"},"visibility":{"type":"string","enum":["shared","private"]},"group_id":{"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"}]},"text":{"type":"string","minLength":1,"maxLength":8192},"variants":{"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":8192}},"shortcuts":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","pattern":"^[\\p{L}\\p{N}_-]{1,32}$"}},"auto_tags":{"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}},"suggest_on":{"type":"array","items":{"type":"string","enum":["chat_started","chat_transferred","chat_idle","chat_rated_good","chat_rated_bad","ai_proposed"]}},"created_by":{"anyOf":[{"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)$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"created_at":{"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{3}(?:Z))$"},"updated_at":{"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{3}(?:Z))$"}},"required":["id","visibility","group_id","text","variants","shortcuts","auto_tags","suggest_on","created_by","created_at","updated_at"],"additionalProperties":false}},"next_page_token":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["items","next_page_token"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"post":{"summary":"Create a canned response; a shared one needs canned.manage","description":"Needs the `chats.access` permission.","tags":["Canned responses"],"security":[{"bearer":[]},{"oauth2":["chats.access"]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"visibility":{"default":"shared","type":"string","enum":["shared","private"]},"group_id":{"default":null,"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"}]},"text":{"type":"string","minLength":1,"maxLength":8192},"variants":{"default":[],"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":8192}},"shortcuts":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string"}},"auto_tags":{"default":[],"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}},"suggest_on":{"default":[],"type":"array","items":{"type":"string","enum":["chat_started","chat_transferred","chat_idle","chat_rated_good","chat_rated_bad","ai_proposed"]}}},"required":["text","shortcuts"]}}}},"responses":{"201":{"description":"Created","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)$"},"visibility":{"type":"string","enum":["shared","private"]},"group_id":{"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"}]},"text":{"type":"string","minLength":1,"maxLength":8192},"variants":{"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":8192}},"shortcuts":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","pattern":"^[\\p{L}\\p{N}_-]{1,32}$"}},"auto_tags":{"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}},"suggest_on":{"type":"array","items":{"type":"string","enum":["chat_started","chat_transferred","chat_idle","chat_rated_good","chat_rated_bad","ai_proposed"]}},"created_by":{"anyOf":[{"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)$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"created_at":{"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{3}(?:Z))$"},"updated_at":{"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{3}(?:Z))$"}},"required":["id","visibility","group_id","text","variants","shortcuts","auto_tags","suggest_on","created_by","created_at","updated_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/config/canned-responses/{id}":{"get":{"summary":"Get a canned response","description":"Needs the `chats.access` permission.","tags":["Canned responses"],"security":[{"bearer":[]},{"oauth2":["chats.access"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","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)$"},"visibility":{"type":"string","enum":["shared","private"]},"group_id":{"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"}]},"text":{"type":"string","minLength":1,"maxLength":8192},"variants":{"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":8192}},"shortcuts":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","pattern":"^[\\p{L}\\p{N}_-]{1,32}$"}},"auto_tags":{"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}},"suggest_on":{"type":"array","items":{"type":"string","enum":["chat_started","chat_transferred","chat_idle","chat_rated_good","chat_rated_bad","ai_proposed"]}},"created_by":{"anyOf":[{"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)$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"created_at":{"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{3}(?:Z))$"},"updated_at":{"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{3}(?:Z))$"}},"required":["id","visibility","group_id","text","variants","shortcuts","auto_tags","suggest_on","created_by","created_at","updated_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"patch":{"summary":"Update a canned response: a private one by its author, a shared one with canned.manage","description":"Needs the `chats.access` permission.","tags":["Canned responses"],"security":[{"bearer":[]},{"oauth2":["chats.access"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"visibility":{"type":"string","enum":["shared","private"]},"group_id":{"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"}]},"text":{"type":"string","minLength":1,"maxLength":8192},"variants":{"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":8192}},"shortcuts":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string"}},"auto_tags":{"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}},"suggest_on":{"type":"array","items":{"type":"string","enum":["chat_started","chat_transferred","chat_idle","chat_rated_good","chat_rated_bad","ai_proposed"]}}}}}}},"responses":{"200":{"description":"OK","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)$"},"visibility":{"type":"string","enum":["shared","private"]},"group_id":{"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"}]},"text":{"type":"string","minLength":1,"maxLength":8192},"variants":{"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":8192}},"shortcuts":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","pattern":"^[\\p{L}\\p{N}_-]{1,32}$"}},"auto_tags":{"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}},"suggest_on":{"type":"array","items":{"type":"string","enum":["chat_started","chat_transferred","chat_idle","chat_rated_good","chat_rated_bad","ai_proposed"]}},"created_by":{"anyOf":[{"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)$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"created_at":{"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{3}(?:Z))$"},"updated_at":{"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{3}(?:Z))$"}},"required":["id","visibility","group_id","text","variants","shortcuts","auto_tags","suggest_on","created_by","created_at","updated_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"delete":{"summary":"Delete a canned response, under the same rule as update","description":"Needs the `chats.access` permission.","tags":["Canned responses"],"security":[{"bearer":[]},{"oauth2":["chats.access"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done."},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/config/tags":{"get":{"summary":"List tags","description":"Needs the `chats.access` permission.","tags":["Tags"],"security":[{"bearer":[]},{"oauth2":["chats.access"]}],"parameters":[{"name":"group_id","in":"query","required":false,"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":"q","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":64}}],"responses":{"200":{"description":"OK","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)$"},"name":{"type":"string","minLength":1,"maxLength":64},"color":{"anyOf":[{},{"type":"null"}]},"group_ids":{"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)$"}},"pinned":{"type":"boolean"},"created_by":{"anyOf":[{"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)$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"created_at":{"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{3}(?:Z))$"}},"required":["id","name","color","group_ids","pinned","created_by","created_at"],"additionalProperties":false}},"next_page_token":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["items","next_page_token"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"post":{"summary":"Create a tag","description":"Needs the `tags.manage` permission.","tags":["Tags"],"security":[{"bearer":[]},{"oauth2":["tags.manage"]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64},"color":{"anyOf":[{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},{"type":"null"}]},"group_ids":{"default":[],"maxItems":100,"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)$"}},"pinned":{"default":false,"type":"boolean"}},"required":["name"]}}}},"responses":{"201":{"description":"Created","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)$"},"name":{"type":"string","minLength":1,"maxLength":64},"color":{"anyOf":[{},{"type":"null"}]},"group_ids":{"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)$"}},"pinned":{"type":"boolean"},"created_by":{"anyOf":[{"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)$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"created_at":{"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{3}(?:Z))$"}},"required":["id","name","color","group_ids","pinned","created_by","created_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/config/tags/{id}":{"patch":{"summary":"Change a tag's colour, groups or pin","description":"Needs the `tags.manage` permission.","tags":["Tags"],"security":[{"bearer":[]},{"oauth2":["tags.manage"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"color":{"anyOf":[{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},{"type":"null"}]},"group_ids":{"maxItems":100,"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)$"}},"pinned":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","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)$"},"name":{"type":"string","minLength":1,"maxLength":64},"color":{"anyOf":[{},{"type":"null"}]},"group_ids":{"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)$"}},"pinned":{"type":"boolean"},"created_by":{"anyOf":[{"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)$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"created_at":{"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{3}(?:Z))$"}},"required":["id","name","color","group_ids","pinned","created_by","created_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"delete":{"summary":"Delete a tag","description":"Needs the `tags.manage` permission.","tags":["Tags"],"security":[{"bearer":[]},{"oauth2":["tags.manage"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done."},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/config/groups":{"get":{"summary":"List groups with their members","description":"Needs the `team.read` permission.","tags":["Groups"],"security":[{"bearer":[]},{"oauth2":["team.read"]}],"parameters":[],"responses":{"200":{"description":"OK","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)$"},"name":{"type":"string","minLength":1,"maxLength":120},"language_code":{"type":"string","pattern":"^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$"},"is_default":{"type":"boolean"},"members":{"type":"array","items":{"type":"object","properties":{"agent_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)$"},"priority":{"type":"string","enum":["first","normal","last","supervisor"]}},"required":["agent_id","priority"],"additionalProperties":false}},"created_at":{"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{3}(?:Z))$"}},"required":["id","name","language_code","is_default","members","created_at"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"post":{"summary":"Create a group","description":"Needs the `team.manage` permission.","tags":["Groups"],"security":[{"bearer":[]},{"oauth2":["team.manage"]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"language_code":{"default":"en","type":"string","pattern":"^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$"},"members":{"default":[],"maxItems":1000,"type":"array","items":{"type":"object","properties":{"agent_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)$"},"priority":{"type":"string","enum":["first","normal","last","supervisor"]}},"required":["agent_id","priority"]}}},"required":["name"]}}}},"responses":{"201":{"description":"Created","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)$"},"name":{"type":"string","minLength":1,"maxLength":120},"language_code":{"type":"string","pattern":"^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$"},"is_default":{"type":"boolean"},"members":{"type":"array","items":{"type":"object","properties":{"agent_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)$"},"priority":{"type":"string","enum":["first","normal","last","supervisor"]}},"required":["agent_id","priority"],"additionalProperties":false}},"created_at":{"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{3}(?:Z))$"}},"required":["id","name","language_code","is_default","members","created_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/config/groups/{id}":{"get":{"summary":"Get a group","description":"Needs the `team.read` permission.","tags":["Groups"],"security":[{"bearer":[]},{"oauth2":["team.read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","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)$"},"name":{"type":"string","minLength":1,"maxLength":120},"language_code":{"type":"string","pattern":"^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$"},"is_default":{"type":"boolean"},"members":{"type":"array","items":{"type":"object","properties":{"agent_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)$"},"priority":{"type":"string","enum":["first","normal","last","supervisor"]}},"required":["agent_id","priority"],"additionalProperties":false}},"created_at":{"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{3}(?:Z))$"}},"required":["id","name","language_code","is_default","members","created_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"patch":{"summary":"Rename a group, change its language or replace its members","description":"Needs the `team.manage` permission.","tags":["Groups"],"security":[{"bearer":[]},{"oauth2":["team.manage"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"language_code":{"type":"string","pattern":"^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$"},"members":{"maxItems":1000,"type":"array","items":{"type":"object","properties":{"agent_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)$"},"priority":{"type":"string","enum":["first","normal","last","supervisor"]}},"required":["agent_id","priority"]}}}}}}},"responses":{"200":{"description":"OK","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)$"},"name":{"type":"string","minLength":1,"maxLength":120},"language_code":{"type":"string","pattern":"^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$"},"is_default":{"type":"boolean"},"members":{"type":"array","items":{"type":"object","properties":{"agent_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)$"},"priority":{"type":"string","enum":["first","normal","last","supervisor"]}},"required":["agent_id","priority"],"additionalProperties":false}},"created_at":{"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{3}(?:Z))$"}},"required":["id","name","language_code","is_default","members","created_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"delete":{"summary":"Delete a group no routing rule targets","description":"Needs the `team.manage` permission.","tags":["Groups"],"security":[{"bearer":[]},{"oauth2":["team.manage"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done."},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/config/groups/{id}/members/{agent_id}":{"put":{"summary":"Add an agent to a group or change its priority","description":"Needs the `team.manage` permission.","tags":["Groups"],"security":[{"bearer":[]},{"oauth2":["team.manage"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"agent_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"priority":{"type":"string","enum":["first","normal","last","supervisor"]}},"required":["priority"]}}}},"responses":{"200":{"description":"OK","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)$"},"name":{"type":"string","minLength":1,"maxLength":120},"language_code":{"type":"string","pattern":"^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$"},"is_default":{"type":"boolean"},"members":{"type":"array","items":{"type":"object","properties":{"agent_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)$"},"priority":{"type":"string","enum":["first","normal","last","supervisor"]}},"required":["agent_id","priority"],"additionalProperties":false}},"created_at":{"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{3}(?:Z))$"}},"required":["id","name","language_code","is_default","members","created_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"delete":{"summary":"Remove an agent from a group","description":"Needs the `team.manage` permission.","tags":["Groups"],"security":[{"bearer":[]},{"oauth2":["team.manage"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"agent_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","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)$"},"name":{"type":"string","minLength":1,"maxLength":120},"language_code":{"type":"string","pattern":"^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$"},"is_default":{"type":"boolean"},"members":{"type":"array","items":{"type":"object","properties":{"agent_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)$"},"priority":{"type":"string","enum":["first","normal","last","supervisor"]}},"required":["agent_id","priority"],"additionalProperties":false}},"created_at":{"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{3}(?:Z))$"}},"required":["id","name","language_code","is_default","members","created_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/config/routing-rules":{"get":{"summary":"List routing rules in evaluation order","description":"Needs the `settings.manage` permission.","tags":["Routing rules"],"security":[{"bearer":[]},{"oauth2":["settings.manage"]}],"parameters":[],"responses":{"200":{"description":"OK","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)$"},"name":{"type":"string","minLength":1,"maxLength":120},"position":{"type":"integer","minimum":0,"maximum":9007199254740991},"enabled":{"type":"boolean"},"condition":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"clauses":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","enum":["url","domain","referrer","title","country","language","customer_email","customer_name","property"]},"property":{"type":"string","pattern":"^[^.\\s]{1,64}\\.[^.\\s]{1,64}$"},"operator":{"type":"string","enum":["contains","not_contains","equals","not_equals","starts_with","ends_with"]},"values":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":2048}}},"required":["field","operator","values"],"additionalProperties":false}}},"required":["match","clauses"],"additionalProperties":false},"action":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"route_to_group"},"group_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)$"}},"required":["type","group_id"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"turn_chat_off"}},"required":["type"],"additionalProperties":false}]}},"required":["id","name","position","enabled","condition","action"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"post":{"summary":"Add a routing rule at the end","description":"Needs the `settings.manage` permission.","tags":["Routing rules"],"security":[{"bearer":[]},{"oauth2":["settings.manage"]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"default":"New rule","type":"string","minLength":1,"maxLength":120},"enabled":{"default":true,"type":"boolean"},"condition":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"clauses":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","enum":["url","domain","referrer","title","country","language","customer_email","customer_name","property"]},"property":{"type":"string","pattern":"^[^.\\s]{1,64}\\.[^.\\s]{1,64}$"},"operator":{"type":"string","enum":["contains","not_contains","equals","not_equals","starts_with","ends_with"]},"values":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":2048}}},"required":["field","operator","values"]}}},"required":["match","clauses"]},"action":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"route_to_group"},"group_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)$"}},"required":["type","group_id"]},{"type":"object","properties":{"type":{"type":"string","const":"turn_chat_off"}},"required":["type"]}]}},"required":["condition","action"]}}}},"responses":{"201":{"description":"Created","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)$"},"name":{"type":"string","minLength":1,"maxLength":120},"position":{"type":"integer","minimum":0,"maximum":9007199254740991},"enabled":{"type":"boolean"},"condition":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"clauses":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","enum":["url","domain","referrer","title","country","language","customer_email","customer_name","property"]},"property":{"type":"string","pattern":"^[^.\\s]{1,64}\\.[^.\\s]{1,64}$"},"operator":{"type":"string","enum":["contains","not_contains","equals","not_equals","starts_with","ends_with"]},"values":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":2048}}},"required":["field","operator","values"],"additionalProperties":false}}},"required":["match","clauses"],"additionalProperties":false},"action":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"route_to_group"},"group_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)$"}},"required":["type","group_id"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"turn_chat_off"}},"required":["type"],"additionalProperties":false}]}},"required":["id","name","position","enabled","condition","action"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/config/routing-rules/{id}":{"patch":{"summary":"Update a routing rule","description":"Needs the `settings.manage` permission.","tags":["Routing rules"],"security":[{"bearer":[]},{"oauth2":["settings.manage"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"enabled":{"type":"boolean"},"condition":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"clauses":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","enum":["url","domain","referrer","title","country","language","customer_email","customer_name","property"]},"property":{"type":"string","pattern":"^[^.\\s]{1,64}\\.[^.\\s]{1,64}$"},"operator":{"type":"string","enum":["contains","not_contains","equals","not_equals","starts_with","ends_with"]},"values":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":2048}}},"required":["field","operator","values"]}}},"required":["match","clauses"]},"action":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"route_to_group"},"group_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)$"}},"required":["type","group_id"]},{"type":"object","properties":{"type":{"type":"string","const":"turn_chat_off"}},"required":["type"]}]}}}}}},"responses":{"200":{"description":"OK","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)$"},"name":{"type":"string","minLength":1,"maxLength":120},"position":{"type":"integer","minimum":0,"maximum":9007199254740991},"enabled":{"type":"boolean"},"condition":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"clauses":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","enum":["url","domain","referrer","title","country","language","customer_email","customer_name","property"]},"property":{"type":"string","pattern":"^[^.\\s]{1,64}\\.[^.\\s]{1,64}$"},"operator":{"type":"string","enum":["contains","not_contains","equals","not_equals","starts_with","ends_with"]},"values":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":2048}}},"required":["field","operator","values"],"additionalProperties":false}}},"required":["match","clauses"],"additionalProperties":false},"action":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"route_to_group"},"group_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)$"}},"required":["type","group_id"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"turn_chat_off"}},"required":["type"],"additionalProperties":false}]}},"required":["id","name","position","enabled","condition","action"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"delete":{"summary":"Delete a routing rule","description":"Needs the `settings.manage` permission.","tags":["Routing rules"],"security":[{"bearer":[]},{"oauth2":["settings.manage"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done."},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/config/routing-rules:reorder":{"post":{"summary":"Set the order of every routing rule","description":"Needs the `settings.manage` permission.","tags":["Routing rules"],"security":[{"bearer":[]},{"oauth2":["settings.manage"]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"maxItems":100,"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":["ids"]}}}},"responses":{"200":{"description":"OK","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)$"},"name":{"type":"string","minLength":1,"maxLength":120},"position":{"type":"integer","minimum":0,"maximum":9007199254740991},"enabled":{"type":"boolean"},"condition":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"clauses":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","enum":["url","domain","referrer","title","country","language","customer_email","customer_name","property"]},"property":{"type":"string","pattern":"^[^.\\s]{1,64}\\.[^.\\s]{1,64}$"},"operator":{"type":"string","enum":["contains","not_contains","equals","not_equals","starts_with","ends_with"]},"values":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":2048}}},"required":["field","operator","values"],"additionalProperties":false}}},"required":["match","clauses"],"additionalProperties":false},"action":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"route_to_group"},"group_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)$"}},"required":["type","group_id"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"turn_chat_off"}},"required":["type"],"additionalProperties":false}]}},"required":["id","name","position","enabled","condition","action"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/config/settings":{"get":{"summary":"Every setting's effective value at a scope","description":"Needs the `chats.access` permission.","tags":["Settings"],"security":[{"bearer":[]},{"oauth2":["chats.access"]}],"parameters":[{"name":"scope","in":"query","required":false,"schema":{"default":"organization","type":"string","enum":["organization","brand","group"]}},{"name":"scope_id","in":"query","required":false,"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":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","enum":["realtime","chat.availability","chat.ask_for_email","file_sharing","chat.credit_card_masking","chat.tagging","chat.translation","routing.fallback","working_hours","widget.appearance","widget.position","widget.mobile","widget.behavior","widget.language","widget.welcome_screen","widget.privacy_banner","widget.chat_page","privacy.retention","privacy.gdpr","onboarding"]},"value":{},"source":{"type":"string","enum":["default","organization","brand","group"]}},"required":["key","value","source"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"patch":{"summary":"Save several settings at one scope atomically","description":"Needs the `settings.manage` permission.","tags":["Settings"],"security":[{"bearer":[]},{"oauth2":["settings.manage"]}],"parameters":[{"name":"scope","in":"query","required":false,"schema":{"default":"organization","type":"string","enum":["organization","brand","group"]}},{"name":"scope_id","in":"query","required":false,"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":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"values":{"type":"object","propertyNames":{"type":"string","enum":["realtime","chat.availability","chat.ask_for_email","file_sharing","chat.credit_card_masking","chat.tagging","chat.translation","routing.fallback","working_hours","widget.appearance","widget.position","widget.mobile","widget.behavior","widget.language","widget.welcome_screen","widget.privacy_banner","widget.chat_page","privacy.retention","privacy.gdpr","onboarding"]},"additionalProperties":{}}},"required":["values"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","enum":["realtime","chat.availability","chat.ask_for_email","file_sharing","chat.credit_card_masking","chat.tagging","chat.translation","routing.fallback","working_hours","widget.appearance","widget.position","widget.mobile","widget.behavior","widget.language","widget.welcome_screen","widget.privacy_banner","widget.chat_page","privacy.retention","privacy.gdpr","onboarding"]},"value":{},"source":{"type":"string","enum":["default","organization","brand","group"]}},"required":["key","value","source"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/config/settings/{key}":{"get":{"summary":"One setting's effective value at a scope","description":"Needs the `chats.access` permission.","tags":["Settings"],"security":[{"bearer":[]},{"oauth2":["chats.access"]}],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}},{"name":"scope","in":"query","required":false,"schema":{"default":"organization","type":"string","enum":["organization","brand","group"]}},{"name":"scope_id","in":"query","required":false,"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":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","enum":["realtime","chat.availability","chat.ask_for_email","file_sharing","chat.credit_card_masking","chat.tagging","chat.translation","routing.fallback","working_hours","widget.appearance","widget.position","widget.mobile","widget.behavior","widget.language","widget.welcome_screen","widget.privacy_banner","widget.chat_page","privacy.retention","privacy.gdpr","onboarding"]},"value":{},"source":{"type":"string","enum":["default","organization","brand","group"]}},"required":["key","value","source"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"put":{"summary":"Set one setting at a scope","description":"Needs the `settings.manage` permission.","tags":["Settings"],"security":[{"bearer":[]},{"oauth2":["settings.manage"]}],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}},{"name":"scope","in":"query","required":false,"schema":{"default":"organization","type":"string","enum":["organization","brand","group"]}},{"name":"scope_id","in":"query","required":false,"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":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"value":{}},"required":["value"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","enum":["realtime","chat.availability","chat.ask_for_email","file_sharing","chat.credit_card_masking","chat.tagging","chat.translation","routing.fallback","working_hours","widget.appearance","widget.position","widget.mobile","widget.behavior","widget.language","widget.welcome_screen","widget.privacy_banner","widget.chat_page","privacy.retention","privacy.gdpr","onboarding"]},"value":{},"source":{"type":"string","enum":["default","organization","brand","group"]}},"required":["key","value","source"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"delete":{"summary":"Clear a scope's value so it inherits; the organization's resets to the default","description":"Needs the `settings.manage` permission.","tags":["Settings"],"security":[{"bearer":[]},{"oauth2":["settings.manage"]}],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}},{"name":"scope","in":"query","required":false,"schema":{"default":"organization","type":"string","enum":["organization","brand","group"]}},{"name":"scope_id","in":"query","required":false,"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":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","enum":["realtime","chat.availability","chat.ask_for_email","file_sharing","chat.credit_card_masking","chat.tagging","chat.translation","routing.fallback","working_hours","widget.appearance","widget.position","widget.mobile","widget.behavior","widget.language","widget.welcome_screen","widget.privacy_banner","widget.chat_page","privacy.retention","privacy.gdpr","onboarding"]},"value":{},"source":{"type":"string","enum":["default","organization","brand","group"]}},"required":["key","value","source"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/config/agents/{agent_id}/settings/{key}":{"get":{"summary":"An agent's personal setting; `me` is the caller, another agent needs team.manage","description":"Needs the `chats.access` permission.","tags":["Settings"],"security":[{"bearer":[]},{"oauth2":["chats.access"]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","enum":["notifications","working_hours"]},"agent_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)$"},"value":{},"source":{"type":"string","enum":["agent","default"]}},"required":["key","agent_id","value","source"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"put":{"summary":"Set an agent's personal setting; working hours and other agents need team.manage","description":"Needs the `chats.access` permission.","tags":["Settings"],"security":[{"bearer":[]},{"oauth2":["chats.access"]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"value":{}},"required":["value"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","enum":["notifications","working_hours"]},"agent_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)$"},"value":{},"source":{"type":"string","enum":["agent","default"]}},"required":["key","agent_id","value","source"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/config/forms/{kind}":{"get":{"summary":"The pre-chat or post-chat form of the organization or a group","description":"Needs the `chats.access` permission.","tags":["Forms"],"security":[{"bearer":[]},{"oauth2":["chats.access"]}],"parameters":[{"name":"kind","in":"path","required":true,"schema":{"type":"string"}},{"name":"group_id","in":"query","required":false,"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":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["prechat","postchat"]},"enabled":{"type":"boolean"},"fields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9_-]{1,64}$"},"type":{"type":"string","enum":["info","name","email","phone","text","textarea","select","checkbox","radio","group_chooser","consent","rating"]},"label":{"type":"string","maxLength":512},"required":{"type":"boolean"},"options":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":256}},"group_ids":{"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)$"}},"comment_label":{"type":"string","maxLength":256},"url":{"type":"string","maxLength":2048,"format":"uri"}},"required":["id","type","label","required","options"],"additionalProperties":false}},"show_after_greeting":{"type":"boolean"},"group_id":{"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"}]},"inherited":{"type":"boolean"}},"required":["kind","enabled","fields","show_after_greeting","group_id","inherited"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"put":{"summary":"Save the form of the organization or a group","description":"Needs the `settings.manage` permission.","tags":["Forms"],"security":[{"bearer":[]},{"oauth2":["settings.manage"]}],"parameters":[{"name":"kind","in":"path","required":true,"schema":{"type":"string"}},{"name":"group_id","in":"query","required":false,"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":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"fields":{"minItems":1,"maxItems":40,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9_-]{1,64}$"},"type":{"type":"string","enum":["info","name","email","phone","text","textarea","select","checkbox","radio","group_chooser","consent","rating"]},"label":{"type":"string","maxLength":512},"required":{"type":"boolean"},"options":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":256}},"group_ids":{"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)$"}},"comment_label":{"type":"string","maxLength":256},"url":{"type":"string","maxLength":2048,"format":"uri"}},"required":["id","type","label","required"]}},"show_after_greeting":{"default":true,"type":"boolean"}},"required":["enabled","fields"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["prechat","postchat"]},"enabled":{"type":"boolean"},"fields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9_-]{1,64}$"},"type":{"type":"string","enum":["info","name","email","phone","text","textarea","select","checkbox","radio","group_chooser","consent","rating"]},"label":{"type":"string","maxLength":512},"required":{"type":"boolean"},"options":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":256}},"group_ids":{"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)$"}},"comment_label":{"type":"string","maxLength":256},"url":{"type":"string","maxLength":2048,"format":"uri"}},"required":["id","type","label","required","options"],"additionalProperties":false}},"show_after_greeting":{"type":"boolean"},"group_id":{"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"}]},"inherited":{"type":"boolean"}},"required":["kind","enabled","fields","show_after_greeting","group_id","inherited"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"delete":{"summary":"Remove a group's own form so it inherits","description":"Needs the `settings.manage` permission.","tags":["Forms"],"security":[{"bearer":[]},{"oauth2":["settings.manage"]}],"parameters":[{"name":"kind","in":"path","required":true,"schema":{"type":"string"}},{"name":"group_id","in":"query","required":false,"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":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["prechat","postchat"]},"enabled":{"type":"boolean"},"fields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9_-]{1,64}$"},"type":{"type":"string","enum":["info","name","email","phone","text","textarea","select","checkbox","radio","group_chooser","consent","rating"]},"label":{"type":"string","maxLength":512},"required":{"type":"boolean"},"options":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":256}},"group_ids":{"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)$"}},"comment_label":{"type":"string","maxLength":256},"url":{"type":"string","maxLength":2048,"format":"uri"}},"required":["id","type","label","required","options"],"additionalProperties":false}},"show_after_greeting":{"type":"boolean"},"group_id":{"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"}]},"inherited":{"type":"boolean"}},"required":["kind","enabled","fields","show_after_greeting","group_id","inherited"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/config/trusted-domains":{"get":{"summary":"List trusted domains","description":"Needs the `settings.manage` permission.","tags":["Trusted domains"],"security":[{"bearer":[]},{"oauth2":["settings.manage"]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string"},"created_at":{"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{3}(?:Z))$"}},"required":["domain","created_at"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"post":{"summary":"Trust a domain and its subdomains","description":"Needs the `settings.manage` permission.","tags":["Trusted domains"],"security":[{"bearer":[]},{"oauth2":["settings.manage"]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string","maxLength":2048}},"required":["domain"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string"},"created_at":{"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{3}(?:Z))$"}},"required":["domain","created_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/config/trusted-domains/{domain}":{"delete":{"summary":"Stop trusting a domain","description":"Needs the `settings.manage` permission.","tags":["Trusted domains"],"security":[{"bearer":[]},{"oauth2":["settings.manage"]}],"parameters":[{"name":"domain","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done."},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/config/detected-domains":{"get":{"summary":"Hosts the widget loaded on or was refused on in the last 90 days that no trusted domain covers","description":"Needs the `settings.manage` permission.","tags":["Trusted domains"],"security":[{"bearer":[]},{"oauth2":["settings.manage"]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"host":{"type":"string"},"domain":{"type":"string"},"last_seen_at":{"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{3}(?:Z))$"}},"required":["host","domain","last_seen_at"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/config/bans":{"get":{"summary":"List bans","description":"Needs the `customers.read` permission.","tags":["Bans"],"security":[{"bearer":[]},{"oauth2":["customers.read"]}],"parameters":[{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["ip","visitor","customer"]}},{"name":"include_expired","in":"query","required":false,"schema":{"default":"false","type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"OK","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)$"},"kind":{"type":"string","enum":["ip","visitor","customer"]},"value":{"type":"string"},"reason":{"type":"string"},"expires_at":{"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{3}(?:Z))$"},{"type":"null"}]},"created_by":{"anyOf":[{"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)$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"created_at":{"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{3}(?:Z))$"}},"required":["id","kind","value","reason","expires_at","created_by","created_at"],"additionalProperties":false}},"next_page_token":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["items","next_page_token"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"post":{"summary":"Ban an IP range, visitor or customer, or change an existing ban","description":"Needs the `customers.ban` permission.","tags":["Bans"],"security":[{"bearer":[]},{"oauth2":["customers.ban"]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["ip","visitor","customer"]},"value":{"type":"string","minLength":1,"maxLength":128},"reason":{"default":"","type":"string","maxLength":500},"expires_at":{"default":null,"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{3}(?:Z))$"},{"type":"null"}]}},"required":["kind","value"]}}}},"responses":{"200":{"description":"OK","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)$"},"kind":{"type":"string","enum":["ip","visitor","customer"]},"value":{"type":"string"},"reason":{"type":"string"},"expires_at":{"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{3}(?:Z))$"},{"type":"null"}]},"created_by":{"anyOf":[{"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)$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"created_at":{"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{3}(?:Z))$"}},"required":["id","kind","value","reason","expires_at","created_by","created_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/config/bans/{id}":{"delete":{"summary":"Lift a ban","description":"Needs the `customers.ban` permission.","tags":["Bans"],"security":[{"bearer":[]},{"oauth2":["customers.ban"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done."},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/config/brands":{"get":{"summary":"List brands","description":"Needs the `chats.access` permission.","tags":["Widget"],"security":[{"bearer":[]},{"oauth2":["chats.access"]}],"parameters":[],"responses":{"200":{"description":"OK","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)$"},"name":{"type":"string","minLength":1,"maxLength":120},"is_default":{"type":"boolean"},"default_group_id":{"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"}]},"group_ids":{"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)$"}},"created_at":{"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{3}(?:Z))$"}},"required":["id","name","is_default","default_group_id","group_ids","created_at"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"post":{"summary":"Create a brand","description":"Needs the `settings.manage` permission.","tags":["Widget"],"security":[{"bearer":[]},{"oauth2":["settings.manage"]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"default_group_id":{"default":null,"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"}]},"group_ids":{"default":[],"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":["name"]}}}},"responses":{"201":{"description":"Created","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)$"},"name":{"type":"string","minLength":1,"maxLength":120},"is_default":{"type":"boolean"},"default_group_id":{"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"}]},"group_ids":{"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)$"}},"created_at":{"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{3}(?:Z))$"}},"required":["id","name","is_default","default_group_id","group_ids","created_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/config/brands/{id}":{"patch":{"summary":"Update a brand","description":"Needs the `settings.manage` permission.","tags":["Widget"],"security":[{"bearer":[]},{"oauth2":["settings.manage"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"default_group_id":{"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"}]},"group_ids":{"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)$"}}}}}}},"responses":{"200":{"description":"OK","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)$"},"name":{"type":"string","minLength":1,"maxLength":120},"is_default":{"type":"boolean"},"default_group_id":{"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"}]},"group_ids":{"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)$"}},"created_at":{"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{3}(?:Z))$"}},"required":["id","name","is_default","default_group_id","group_ids","created_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"delete":{"summary":"Delete a brand other than the default","description":"Needs the `settings.manage` permission.","tags":["Widget"],"security":[{"bearer":[]},{"oauth2":["settings.manage"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done."},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/config/widget/{group_id}":{"get":{"summary":"The widget config as published for a group","description":"Needs the `chats.access` permission.","tags":["Widget"],"security":[{"bearer":[]},{"oauth2":["chats.access"]}],"parameters":[{"name":"group_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"schema":{"type":"number","const":1},"version":{"type":"integer","minimum":1,"maximum":9007199254740991},"published_at":{"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{3}(?:Z))$"},"organization_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)$"},"license_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"region":{"type":"string","enum":["apac","eu","us"]},"group_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)$"},"brand_id":{"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"}]},"company_name":{"type":"string"},"logo_url":{"anyOf":[{"type":"string","maxLength":2048,"format":"uri"},{"type":"null"}]},"theme":{"type":"object","properties":{"launcher":{"type":"string","enum":["bubble","bar"]},"variant":{"type":"string","enum":["light","dark"]},"colors":{"type":"object","properties":{"launcher_bg":{},"launcher_icon":{},"cta":{},"background":{},"agent_bubble_bg":{},"agent_bubble_text":{},"visitor_bubble_bg":{},"visitor_bubble_text":{},"system_text":{},"agentbar_bg":{},"agentbar_text":{}},"required":["launcher_bg","launcher_icon","cta","background","agent_bubble_bg","agent_bubble_text","visitor_bubble_bg","visitor_bubble_text","system_text","agentbar_bg","agentbar_text"],"additionalProperties":false},"background_opacity":{"type":"number"}},"required":["launcher","variant","colors","background_opacity"],"additionalProperties":false},"position":{"type":"object","properties":{"align":{"type":"string","enum":["left","right"]},"offset_x":{"type":"integer","minimum":0,"maximum":400},"offset_y":{"type":"integer","minimum":0,"maximum":400},"visibility":{"type":"string","enum":["always","hide_until_activated","hide_launcher"]}},"required":["align","offset_x","offset_y","visibility"],"additionalProperties":false},"mobile":{"type":"object","properties":{"enabled":{"type":"boolean"},"custom":{"type":"boolean"},"launcher":{"type":"string","enum":["bubble","bar"]},"align":{"type":"string","enum":["left","right"]},"offset_x":{"type":"integer","minimum":0,"maximum":400},"offset_y":{"type":"integer","minimum":0,"maximum":400},"visibility":{"type":"string","enum":["always","hide_until_activated","hide_launcher"]},"minimized_input":{"type":"boolean"}},"required":["enabled","custom","launcher","align","offset_x","offset_y","visibility","minimized_input"],"additionalProperties":false},"features":{"type":"object","properties":{"homescreen":{"type":"boolean"},"minimized_input":{"type":"boolean"},"sounds":{"type":"boolean"},"rating":{"type":"boolean"},"transcript":{"type":"boolean"},"show_logo":{"type":"boolean"},"show_agent_photo":{"type":"boolean"},"show_agent_name":{"type":"boolean"},"show_agent_title":{"type":"boolean"},"white_label":{"type":"boolean"},"attachments":{"type":"boolean"},"continuous_chat":{"type":"boolean"},"hide_when_offline":{"type":"boolean"},"mask_credit_cards":{"type":"boolean"},"links_unfurling":{"type":"boolean"},"customer_history":{"type":"boolean"},"emoji":{"type":"boolean"},"reactions":{"type":"boolean"},"screenshot":{"type":"boolean"},"cookie_consent":{"type":"boolean"}},"required":["homescreen","minimized_input","sounds","rating","transcript","show_logo","show_agent_photo","show_agent_name","show_agent_title","white_label","attachments","continuous_chat","hide_when_offline","mask_credit_cards","links_unfurling","customer_history","emoji","reactions","screenshot","cookie_consent"],"additionalProperties":false},"welcome":{"type":"object","properties":{"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"show_logo":{"default":true,"type":"boolean"},"logo_url":{"anyOf":[{"type":"string","maxLength":2048,"format":"uri"},{"type":"null"}]},"links":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"url":{"type":"string"}},"required":["label","url"],"additionalProperties":false}}},"required":["title","show_logo","logo_url","links"],"additionalProperties":false},"language":{},"strings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","maxLength":1000}}},"welcome_message":{"anyOf":[{"type":"string"},{"type":"null"}]},"prechat_form":{"type":"object","properties":{"enabled":{"type":"boolean"},"fields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9_-]{1,64}$"},"type":{"type":"string","enum":["info","name","email","phone","text","textarea","select","checkbox","radio","group_chooser","consent","rating"]},"label":{"type":"string","maxLength":512},"required":{"type":"boolean"},"options":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":256}},"group_ids":{"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)$"}},"comment_label":{"type":"string","maxLength":256},"url":{"type":"string","maxLength":2048,"format":"uri"}},"required":["id","type","label","required","options"],"additionalProperties":false}},"show_after_greeting":{"type":"boolean"}},"required":["enabled","fields","show_after_greeting"],"additionalProperties":false},"postchat_form":{"type":"object","properties":{"enabled":{"type":"boolean"},"fields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9_-]{1,64}$"},"type":{"type":"string","enum":["info","name","email","phone","text","textarea","select","checkbox","radio","group_chooser","consent","rating"]},"label":{"type":"string","maxLength":512},"required":{"type":"boolean"},"options":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":256}},"group_ids":{"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)$"}},"comment_label":{"type":"string","maxLength":256},"url":{"type":"string","maxLength":2048,"format":"uri"}},"required":["id","type","label","required","options"],"additionalProperties":false}},"show_after_greeting":{"type":"boolean"}},"required":["enabled","fields","show_after_greeting"],"additionalProperties":false},"ask_for_email":{"type":"object","properties":{"enabled":{"type":"boolean"},"after_s":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"when_offline":{"type":"boolean"}},"required":["enabled","after_s","when_offline"],"additionalProperties":false},"privacy_policy":{"type":"object","properties":{"enabled":{"type":"boolean"},"text":{"type":"string"},"url":{"anyOf":[{"type":"string","maxLength":2048,"format":"uri"},{"type":"null"}]}},"required":["enabled","text","url"],"additionalProperties":false},"chat_page":{"type":"object","properties":{"enabled":{"type":"boolean"},"show_stats":{"type":"boolean"},"headline":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]}},"required":["enabled","show_stats","headline","description"],"additionalProperties":false},"groups":{"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)$"},"name":{"type":"string"},"language_code":{"type":"string","pattern":"^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$"}},"required":["id","name","language_code"],"additionalProperties":false}},"working_hours":{"type":"object","properties":{"enabled":{"type":"boolean"},"timezone":{"type":"string","minLength":1,"maxLength":64},"days":{"type":"object","properties":{"mon":{"maxItems":6,"type":"array","items":{"type":"object","properties":{"from":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$|^24:00$"},"to":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$|^24:00$"}},"required":["from","to"],"additionalProperties":false}},"tue":{"maxItems":6,"type":"array","items":{"type":"object","properties":{"from":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$|^24:00$"},"to":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$|^24:00$"}},"required":["from","to"],"additionalProperties":false}},"wed":{"maxItems":6,"type":"array","items":{"type":"object","properties":{"from":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$|^24:00$"},"to":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$|^24:00$"}},"required":["from","to"],"additionalProperties":false}},"thu":{"maxItems":6,"type":"array","items":{"type":"object","properties":{"from":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$|^24:00$"},"to":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$|^24:00$"}},"required":["from","to"],"additionalProperties":false}},"fri":{"maxItems":6,"type":"array","items":{"type":"object","properties":{"from":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$|^24:00$"},"to":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$|^24:00$"}},"required":["from","to"],"additionalProperties":false}},"sat":{"maxItems":6,"type":"array","items":{"type":"object","properties":{"from":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$|^24:00$"},"to":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$|^24:00$"}},"required":["from","to"],"additionalProperties":false}},"sun":{"maxItems":6,"type":"array","items":{"type":"object","properties":{"from":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$|^24:00$"},"to":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$|^24:00$"}},"required":["from","to"],"additionalProperties":false}}},"required":["mon","tue","wed","thu","fri","sat","sun"],"additionalProperties":false}},"required":["enabled","timezone","days"],"additionalProperties":false},"routing_rules":{"type":"array","items":{"type":"object","properties":{"condition":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"clauses":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","enum":["url","domain","referrer","title","country","language","customer_email","customer_name","property"]},"property":{"type":"string","pattern":"^[^.\\s]{1,64}\\.[^.\\s]{1,64}$"},"operator":{"type":"string","enum":["contains","not_contains","equals","not_equals","starts_with","ends_with"]},"values":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":2048}}},"required":["field","operator","values"],"additionalProperties":false}}},"required":["match","clauses"],"additionalProperties":false},"action":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"route_to_group"},"group_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)$"}},"required":["type","group_id"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"turn_chat_off"}},"required":["type"],"additionalProperties":false}]}},"required":["condition","action"],"additionalProperties":false}},"trusted_domains":{"type":"array","items":{"type":"string"}},"ai":{"type":"object","properties":{"enabled":{"type":"boolean"},"suggested_questions":{"type":"array","items":{"type":"string"}}},"required":["enabled","suggested_questions"],"additionalProperties":false}},"required":["schema","version","published_at","organization_id","license_id","region","group_id","brand_id","company_name","logo_url","theme","position","mobile","features","welcome","language","strings","welcome_message","prechat_form","postchat_form","ask_for_email","privacy_policy","chat_page","groups","working_hours","routing_rules","trusted_domains","ai"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/config/widget:publish":{"post":{"summary":"Republish every group's widget config and resync routing","description":"Needs the `settings.manage` permission.","tags":["Widget"],"security":[{"bearer":[]},{"oauth2":["settings.manage"]}],"parameters":[],"responses":{"204":{"description":"Done."},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/config/audit-log":{"get":{"summary":"Configuration changes, newest first","description":"Needs the `settings.manage` permission.","tags":["Settings"],"security":[{"bearer":[]},{"oauth2":["settings.manage"]}],"parameters":[],"responses":{"200":{"description":"OK","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)$"},"agent":{"anyOf":[{"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)$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"action":{"type":"string","enum":["create","update","delete"]},"entity":{"type":"string"},"entity_id":{"type":"string"},"created_at":{"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{3}(?:Z))$"}},"required":["id","agent","action","entity","entity_id","created_at"],"additionalProperties":false}},"next_page_token":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["items","next_page_token"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/tokens":{"get":{"summary":"List your personal tokens (admins: every token, or bot tokens)","description":"A signed-in agent session only; API tokens are refused.","tags":["Tokens"],"security":[{"bearer":[]}],"parameters":[{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["personal","bot"]}},{"name":"agent_id","in":"query","required":false,"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":"OK","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)$"},"name":{"type":"string"},"agent_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":["personal","bot"]},"prefix":{"type":"string"},"scopes":{"type":"array","items":{"type":"string","enum":["chats.access","chats.all","archives.read","archives.write","customers.read","customers.write","customers.ban","traffic.read","campaigns.manage","canned.manage","tags.manage","reports.read","team.read","team.manage","settings.manage","channels.manage","ai.manage","developers.manage","data.export"]}},"created_at":{"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{3}(?:Z))$"},"last_used_at":{"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{3}(?:Z))$"},{"type":"null"}]},"expires_at":{"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{3}(?:Z))$"},{"type":"null"}]}},"required":["id","name","agent_id","kind","prefix","scopes","created_at","last_used_at","expires_at"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"post":{"summary":"Create a personal access token","description":"A signed-in agent session with the `tokens.own` permission; API tokens are refused.","tags":["Tokens"],"security":[{"bearer":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"scopes":{"minItems":1,"type":"array","items":{"type":"string","enum":["chats.access","chats.all","archives.read","archives.write","customers.read","customers.write","customers.ban","traffic.read","campaigns.manage","canned.manage","tags.manage","reports.read","team.read","team.manage","settings.manage","channels.manage","ai.manage","developers.manage","data.export"]}},"expires_in_days":{"anyOf":[{"type":"integer","minimum":1,"maximum":3650},{"type":"null"}]}},"required":["name","scopes","expires_in_days"]}}}},"responses":{"201":{"description":"Created","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)$"},"name":{"type":"string"},"agent_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":["personal","bot"]},"prefix":{"type":"string"},"scopes":{"type":"array","items":{"type":"string","enum":["chats.access","chats.all","archives.read","archives.write","customers.read","customers.write","customers.ban","traffic.read","campaigns.manage","canned.manage","tags.manage","reports.read","team.read","team.manage","settings.manage","channels.manage","ai.manage","developers.manage","data.export"]}},"created_at":{"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{3}(?:Z))$"},"last_used_at":{"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{3}(?:Z))$"},{"type":"null"}]},"expires_at":{"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{3}(?:Z))$"},{"type":"null"}]},"token":{"type":"string"}},"required":["id","name","agent_id","kind","prefix","scopes","created_at","last_used_at","expires_at","token"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/tokens/bots":{"post":{"summary":"Create a token for a bot agent","description":"A signed-in agent session with the `developers.manage` permission; API tokens are refused.","tags":["Tokens"],"security":[{"bearer":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"scopes":{"minItems":1,"type":"array","items":{"type":"string","enum":["chats.access","chats.all","archives.read","archives.write","customers.read","customers.write","customers.ban","traffic.read","campaigns.manage","canned.manage","tags.manage","reports.read","team.read","team.manage","settings.manage","channels.manage","ai.manage","developers.manage","data.export"]}},"expires_in_days":{"anyOf":[{"type":"integer","minimum":1,"maximum":3650},{"type":"null"}]},"bot_agent_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)$"}},"required":["name","scopes","expires_in_days","bot_agent_id"]}}}},"responses":{"201":{"description":"Created","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)$"},"name":{"type":"string"},"agent_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":["personal","bot"]},"prefix":{"type":"string"},"scopes":{"type":"array","items":{"type":"string","enum":["chats.access","chats.all","archives.read","archives.write","customers.read","customers.write","customers.ban","traffic.read","campaigns.manage","canned.manage","tags.manage","reports.read","team.read","team.manage","settings.manage","channels.manage","ai.manage","developers.manage","data.export"]}},"created_at":{"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{3}(?:Z))$"},"last_used_at":{"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{3}(?:Z))$"},{"type":"null"}]},"expires_at":{"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{3}(?:Z))$"},{"type":"null"}]},"token":{"type":"string"}},"required":["id","name","agent_id","kind","prefix","scopes","created_at","last_used_at","expires_at","token"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/tokens/{id}":{"delete":{"summary":"Revoke a personal or bot token","description":"A signed-in agent session only; API tokens are refused.","tags":["Tokens"],"security":[{"bearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done."},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/oauth/authorize":{"get":{"summary":"Consent screen data for an authorization request","description":"A signed-in agent session only; API tokens are refused.","tags":["OAuth"],"security":[{"bearer":[]}],"parameters":[{"name":"response_type","in":"query","required":true,"schema":{"type":"string","const":"code"}},{"name":"client_id","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":64}},{"name":"redirect_uri","in":"query","required":true,"schema":{"type":"string","maxLength":500}},{"name":"scope","in":"query","required":false,"schema":{"default":"","type":"string","maxLength":2000}},{"name":"state","in":"query","required":false,"schema":{"type":"string","maxLength":500}},{"name":"code_challenge","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{43,128}$"}},{"name":"code_challenge_method","in":"query","required":false,"schema":{"type":"string","enum":["S256"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"app":{"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)$"},"client_id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"homepage_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"privacy_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"logo_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"category":{"type":"string","enum":["crm","ecommerce","helpdesk","marketing","analytics","automation","messaging","productivity","ai","other"]}},"required":["id","client_id","name","description","homepage_url","privacy_url","logo_url","category"],"additionalProperties":false},"developer":{"type":"object","properties":{"organization_name":{"type":"string"}},"required":["organization_name"],"additionalProperties":false},"organization":{"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)$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"requested_scopes":{"type":"array","items":{"type":"object","properties":{"scope":{"type":"string","enum":["chats.access","chats.all","archives.read","archives.write","customers.read","customers.write","customers.ban","traffic.read","campaigns.manage","canned.manage","tags.manage","reports.read","team.read","team.manage","settings.manage","channels.manage","ai.manage","developers.manage","data.export"]},"description":{"type":"string"},"grantable":{"type":"boolean"}},"required":["scope","description","grantable"],"additionalProperties":false}},"already_granted":{"type":"array","items":{"type":"string","enum":["chats.access","chats.all","archives.read","archives.write","customers.read","customers.write","customers.ban","traffic.read","campaigns.manage","canned.manage","tags.manage","reports.read","team.read","team.manage","settings.manage","channels.manage","ai.manage","developers.manage","data.export"]}}},"required":["app","developer","organization","requested_scopes","already_granted"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"post":{"summary":"Approve or deny an authorization request","description":"A signed-in agent session only; API tokens are refused.","tags":["OAuth"],"security":[{"bearer":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"response_type":{"type":"string","const":"code"},"client_id":{"type":"string","minLength":1,"maxLength":64},"redirect_uri":{"type":"string","maxLength":500},"scope":{"default":"","type":"string","maxLength":2000},"state":{"type":"string","maxLength":500},"code_challenge":{"type":"string","pattern":"^[A-Za-z0-9_-]{43,128}$"},"code_challenge_method":{"type":"string","enum":["S256"]},"decision":{"type":"string","enum":["approve","deny"]}},"required":["response_type","client_id","redirect_uri","decision"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"redirect_to":{"type":"string"}},"required":["redirect_to"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/oauth/token":{"post":{"summary":"Exchange a code or a refresh token (form or JSON body)","description":"No token.","tags":["OAuth"],"security":[],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"grant_type":{"type":"string","const":"authorization_code"},"code":{"type":"string","minLength":1,"maxLength":256},"redirect_uri":{"type":"string","maxLength":500},"client_id":{"type":"string","minLength":1,"maxLength":64},"client_secret":{"type":"string","maxLength":256},"code_verifier":{"type":"string","pattern":"^[A-Za-z0-9._~-]{43,128}$"}},"required":["grant_type","code","redirect_uri"]},{"type":"object","properties":{"grant_type":{"type":"string","const":"refresh_token"},"refresh_token":{"type":"string","minLength":1,"maxLength":256},"client_id":{"type":"string","minLength":1,"maxLength":64},"client_secret":{"type":"string","maxLength":256},"scope":{"type":"string","maxLength":2000}},"required":["grant_type","refresh_token"]}]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"access_token":{"type":"string"},"token_type":{"type":"string","const":"Bearer"},"expires_in":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"refresh_token":{"type":"string"},"scope":{"type":"string"},"organization_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)$"},"agent_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)$"}},"required":["access_token","token_type","expires_in","refresh_token","scope","organization_id","agent_id"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","enum":["invalid_request","invalid_client","invalid_grant","unauthorized_client","unsupported_grant_type","invalid_scope","access_denied"]},"error_description":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}}}}},"/v1/oauth/revoke":{"post":{"summary":"Revoke an access or refresh token (RFC 7009)","description":"No token.","tags":["OAuth"],"security":[],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","minLength":1,"maxLength":256},"token_type_hint":{"type":"string","enum":["access_token","refresh_token"]},"client_id":{"type":"string","minLength":1,"maxLength":64},"client_secret":{"type":"string","maxLength":256}},"required":["token"]}}}},"responses":{"200":{"description":"Done."},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","enum":["invalid_request","invalid_client","invalid_grant","unauthorized_client","unsupported_grant_type","invalid_scope","access_denied"]},"error_description":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}}}}},"/v1/oauth/introspect":{"post":{"summary":"Introspect a token (RFC 7662)","description":"No token.","tags":["OAuth"],"security":[],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","minLength":1,"maxLength":256},"token_type_hint":{"type":"string","enum":["access_token","refresh_token"]},"client_id":{"type":"string","minLength":1,"maxLength":64},"client_secret":{"type":"string","maxLength":256}},"required":["token"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"active":{"type":"boolean"},"token_type":{"type":"string","enum":["session","personal","bot","oauth"]},"scope":{"type":"string"},"client_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"organization_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)$"},"agent_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)$"},"exp":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["active"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","enum":["invalid_request","invalid_client","invalid_grant","unauthorized_client","unsupported_grant_type","invalid_scope","access_denied"]},"error_description":{"type":"string"}},"required":["error","error_description"],"additionalProperties":false}}}}}}},"/v1/oauth/info":{"get":{"summary":"Describe the calling token","description":"Any valid token.","tags":["OAuth"],"security":[{"bearer":[]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"active":{"type":"boolean"},"token_type":{"type":"string","enum":["session","personal","bot","oauth"]},"scope":{"type":"string"},"client_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"organization_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)$"},"agent_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)$"},"exp":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["active"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/oauth/metadata":{"get":{"summary":"Authorization server metadata (RFC 8414)","description":"No token.","tags":["OAuth"],"security":[],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/apps/catalog":{"get":{"summary":"Integrations and apps available to the organization","description":"A signed-in agent session only; API tokens are refused.","tags":["Apps"],"security":[{"bearer":[]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["channel","builtin","app"]},"name":{"type":"string"},"description":{"type":"string"},"category":{"type":"string","enum":["crm","ecommerce","helpdesk","marketing","analytics","automation","messaging","productivity","ai","other"]},"logo_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"configure_path":{"anyOf":[{"type":"string"},{"type":"null"}]},"install_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"developer":{"anyOf":[{"type":"string"},{"type":"null"}]},"installed":{"type":"boolean"}},"required":["id","kind","name","description","category","logo_url","configure_path","install_url","developer","installed"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/apps/installed":{"get":{"summary":"Apps installed in the organization","description":"A signed-in agent session only; API tokens are refused.","tags":["Apps"],"security":[{"bearer":[]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"app_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)$"},"client_id":{"type":"string"},"name":{"type":"string"},"logo_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"scopes":{"type":"array","items":{"type":"string","enum":["chats.access","chats.all","archives.read","archives.write","customers.read","customers.write","customers.ban","traffic.read","campaigns.manage","canned.manage","tags.manage","reports.read","team.read","team.manage","settings.manage","channels.manage","ai.manage","developers.manage","data.export"]}},"installed_by":{"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"}]},"installed_at":{"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{3}(?:Z))$"}},"required":["app_id","client_id","name","logo_url","scopes","installed_by","installed_at"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/apps/installed/{app_id}":{"delete":{"summary":"Uninstall an app: revoke its tokens and delete its webhooks","description":"A signed-in agent session with the `developers.manage` permission; API tokens are refused.","tags":["Apps"],"security":[{"bearer":[]}],"parameters":[{"name":"app_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done."},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/apps/registered":{"get":{"summary":"Apps this organization develops","description":"A signed-in agent session with the `developers.manage` permission; API tokens are refused.","tags":["Apps"],"security":[{"bearer":[]}],"parameters":[],"responses":{"200":{"description":"OK","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)$"},"client_id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"homepage_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"privacy_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"logo_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"category":{"type":"string","enum":["crm","ecommerce","helpdesk","marketing","analytics","automation","messaging","productivity","ai","other"]},"client_type":{"type":"string","enum":["confidential","public"]},"redirect_uris":{"type":"array","items":{"type":"string"}},"scopes":{"type":"array","items":{"type":"string","enum":["chats.access","chats.all","archives.read","archives.write","customers.read","customers.write","customers.ban","traffic.read","campaigns.manage","canned.manage","tags.manage","reports.read","team.read","team.manage","settings.manage","channels.manage","ai.manage","developers.manage","data.export"]}},"listed":{"type":"boolean"},"install_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"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{3}(?:Z))$"},"updated_at":{"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{3}(?:Z))$"}},"required":["id","client_id","name","description","homepage_url","privacy_url","logo_url","category","client_type","redirect_uris","scopes","listed","install_count","created_at","updated_at"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"post":{"summary":"Register an OAuth app","description":"A signed-in agent session with the `developers.manage` permission; API tokens are refused.","tags":["Apps"],"security":[{"bearer":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"description":{"default":"","type":"string","maxLength":1000},"homepage_url":{"default":null,"anyOf":[{"type":"string","maxLength":500,"format":"uri"},{"type":"null"}]},"privacy_url":{"default":null,"anyOf":[{"type":"string","maxLength":500,"format":"uri"},{"type":"null"}]},"logo_url":{"default":null,"anyOf":[{"type":"string","maxLength":500,"format":"uri"},{"type":"null"}]},"category":{"default":"other","type":"string","enum":["crm","ecommerce","helpdesk","marketing","analytics","automation","messaging","productivity","ai","other"]},"client_type":{"default":"confidential","type":"string","enum":["confidential","public"]},"redirect_uris":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","maxLength":500,"format":"uri"}},"scopes":{"minItems":1,"type":"array","items":{"type":"string","enum":["chats.access","chats.all","archives.read","archives.write","customers.read","customers.write","customers.ban","traffic.read","campaigns.manage","canned.manage","tags.manage","reports.read","team.read","team.manage","settings.manage","channels.manage","ai.manage","developers.manage","data.export"]}}},"required":["name","redirect_uris","scopes"]}}}},"responses":{"201":{"description":"Created","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)$"},"client_id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"homepage_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"privacy_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"logo_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"category":{"type":"string","enum":["crm","ecommerce","helpdesk","marketing","analytics","automation","messaging","productivity","ai","other"]},"client_type":{"type":"string","enum":["confidential","public"]},"redirect_uris":{"type":"array","items":{"type":"string"}},"scopes":{"type":"array","items":{"type":"string","enum":["chats.access","chats.all","archives.read","archives.write","customers.read","customers.write","customers.ban","traffic.read","campaigns.manage","canned.manage","tags.manage","reports.read","team.read","team.manage","settings.manage","channels.manage","ai.manage","developers.manage","data.export"]}},"listed":{"type":"boolean"},"install_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"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{3}(?:Z))$"},"updated_at":{"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{3}(?:Z))$"},"client_secret":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","client_id","name","description","homepage_url","privacy_url","logo_url","category","client_type","redirect_uris","scopes","listed","install_count","created_at","updated_at","client_secret"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/apps/registered/{id}":{"get":{"summary":"Get a registered app","description":"A signed-in agent session with the `developers.manage` permission; API tokens are refused.","tags":["Apps"],"security":[{"bearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","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)$"},"client_id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"homepage_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"privacy_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"logo_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"category":{"type":"string","enum":["crm","ecommerce","helpdesk","marketing","analytics","automation","messaging","productivity","ai","other"]},"client_type":{"type":"string","enum":["confidential","public"]},"redirect_uris":{"type":"array","items":{"type":"string"}},"scopes":{"type":"array","items":{"type":"string","enum":["chats.access","chats.all","archives.read","archives.write","customers.read","customers.write","customers.ban","traffic.read","campaigns.manage","canned.manage","tags.manage","reports.read","team.read","team.manage","settings.manage","channels.manage","ai.manage","developers.manage","data.export"]}},"listed":{"type":"boolean"},"install_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"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{3}(?:Z))$"},"updated_at":{"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{3}(?:Z))$"}},"required":["id","client_id","name","description","homepage_url","privacy_url","logo_url","category","client_type","redirect_uris","scopes","listed","install_count","created_at","updated_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"patch":{"summary":"Change a registered app","description":"A signed-in agent session with the `developers.manage` permission; API tokens are refused.","tags":["Apps"],"security":[{"bearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"description":{"type":"string","maxLength":1000},"homepage_url":{"anyOf":[{"type":"string","maxLength":500,"format":"uri"},{"type":"null"}]},"privacy_url":{"anyOf":[{"type":"string","maxLength":500,"format":"uri"},{"type":"null"}]},"logo_url":{"anyOf":[{"type":"string","maxLength":500,"format":"uri"},{"type":"null"}]},"category":{"type":"string","enum":["crm","ecommerce","helpdesk","marketing","analytics","automation","messaging","productivity","ai","other"]},"client_type":{"type":"string","enum":["confidential","public"]},"redirect_uris":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","maxLength":500,"format":"uri"}},"scopes":{"minItems":1,"type":"array","items":{"type":"string","enum":["chats.access","chats.all","archives.read","archives.write","customers.read","customers.write","customers.ban","traffic.read","campaigns.manage","canned.manage","tags.manage","reports.read","team.read","team.manage","settings.manage","channels.manage","ai.manage","developers.manage","data.export"]}}}}}}},"responses":{"200":{"description":"OK","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)$"},"client_id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"homepage_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"privacy_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"logo_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"category":{"type":"string","enum":["crm","ecommerce","helpdesk","marketing","analytics","automation","messaging","productivity","ai","other"]},"client_type":{"type":"string","enum":["confidential","public"]},"redirect_uris":{"type":"array","items":{"type":"string"}},"scopes":{"type":"array","items":{"type":"string","enum":["chats.access","chats.all","archives.read","archives.write","customers.read","customers.write","customers.ban","traffic.read","campaigns.manage","canned.manage","tags.manage","reports.read","team.read","team.manage","settings.manage","channels.manage","ai.manage","developers.manage","data.export"]}},"listed":{"type":"boolean"},"install_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"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{3}(?:Z))$"},"updated_at":{"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{3}(?:Z))$"}},"required":["id","client_id","name","description","homepage_url","privacy_url","logo_url","category","client_type","redirect_uris","scopes","listed","install_count","created_at","updated_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"delete":{"summary":"Delete a registered app and every grant it holds","description":"A signed-in agent session with the `developers.manage` permission; API tokens are refused.","tags":["Apps"],"security":[{"bearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done."},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/apps/registered/{id}:rotate_secret":{"post":{"summary":"Issue a new client secret","description":"A signed-in agent session with the `developers.manage` permission; API tokens are refused.","tags":["Apps"],"security":[{"bearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","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)$"},"client_id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"homepage_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"privacy_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"logo_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"category":{"type":"string","enum":["crm","ecommerce","helpdesk","marketing","analytics","automation","messaging","productivity","ai","other"]},"client_type":{"type":"string","enum":["confidential","public"]},"redirect_uris":{"type":"array","items":{"type":"string"}},"scopes":{"type":"array","items":{"type":"string","enum":["chats.access","chats.all","archives.read","archives.write","customers.read","customers.write","customers.ban","traffic.read","campaigns.manage","canned.manage","tags.manage","reports.read","team.read","team.manage","settings.manage","channels.manage","ai.manage","developers.manage","data.export"]}},"listed":{"type":"boolean"},"install_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"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{3}(?:Z))$"},"updated_at":{"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{3}(?:Z))$"},"client_secret":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","client_id","name","description","homepage_url","privacy_url","logo_url","category","client_type","redirect_uris","scopes","listed","install_count","created_at","updated_at","client_secret"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/webhooks":{"get":{"summary":"List webhooks","description":"Needs the `developers.manage` permission.","tags":["Webhooks"],"security":[{"bearer":[]},{"oauth2":["developers.manage"]}],"parameters":[],"responses":{"200":{"description":"OK","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)$"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string","enum":["chat.started","chat.queued","chat.assigned","chat.transferred","chat.unassigned","chat.deactivated","chat.closed","chat.priority_changed","goal.achieved","chat.rated","chat.user_added","chat.user_removed","chat.properties_updated","thread.tagged","thread.untagged","thread.properties_updated","thread.summary_set","event.created","event.updated","event.deleted","event.seen","ticket.created","ticket.updated","customer.created","customer.updated","customer.identified","customer.banned","agent.status_changed","agent.created","agent.updated","agent.deleted","group.created","group.updated","group.deleted","tag.created","tag.updated","tag.deleted","canned_response.created","canned_response.updated","canned_response.deleted","routing_rule.created","routing_rule.updated","routing_rule.deleted","greeting.created","greeting.updated","greeting.deleted","settings.updated","webhook.test"]}},"filters":{"type":"object","properties":{"group_ids":{"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)$"}},"channels":{"type":"array","items":{"type":"string","enum":["widget","chat_page","api","email","whatsapp","messenger","instagram","telegram","line","zalo","viber","wechat","kakaotalk","sms","x","discord","slack","teams","apple_messages"]}},"author_types":{"type":"array","items":{"type":"string","enum":["customer","agent","bot","system"]}},"agent_ids":{"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)$"}}},"additionalProperties":false},"description":{"type":"string"},"enabled":{"type":"boolean"},"secret_hint":{"type":"string"},"owner_app":{"anyOf":[{"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)$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"paused_at":{"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{3}(?:Z))$"},{"type":"null"}]},"pause_reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"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{3}(?:Z))$"},"updated_at":{"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{3}(?:Z))$"}},"required":["id","url","events","filters","description","enabled","secret_hint","owner_app","paused_at","pause_reason","created_at","updated_at"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"post":{"summary":"Create a webhook","description":"Needs the `developers.manage` permission.","tags":["Webhooks"],"security":[{"bearer":[]},{"oauth2":["developers.manage"]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","maxLength":2000,"format":"uri"},"events":{"minItems":1,"maxItems":48,"type":"array","items":{"type":"string","enum":["chat.started","chat.queued","chat.assigned","chat.transferred","chat.unassigned","chat.deactivated","chat.closed","chat.priority_changed","goal.achieved","chat.rated","chat.user_added","chat.user_removed","chat.properties_updated","thread.tagged","thread.untagged","thread.properties_updated","thread.summary_set","event.created","event.updated","event.deleted","event.seen","ticket.created","ticket.updated","customer.created","customer.updated","customer.identified","customer.banned","agent.status_changed","agent.created","agent.updated","agent.deleted","group.created","group.updated","group.deleted","tag.created","tag.updated","tag.deleted","canned_response.created","canned_response.updated","canned_response.deleted","routing_rule.created","routing_rule.updated","routing_rule.deleted","greeting.created","greeting.updated","greeting.deleted","settings.updated"]}},"filters":{"default":{},"type":"object","properties":{"group_ids":{"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)$"}},"channels":{"type":"array","items":{"type":"string","enum":["widget","chat_page","api","email","whatsapp","messenger","instagram","telegram","line","zalo","viber","wechat","kakaotalk","sms","x","discord","slack","teams","apple_messages"]}},"author_types":{"type":"array","items":{"type":"string","enum":["customer","agent","bot","system"]}},"agent_ids":{"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)$"}}},"additionalProperties":false},"description":{"default":"","type":"string","maxLength":200}},"required":["url","events"]}}}},"responses":{"201":{"description":"Created","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)$"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string","enum":["chat.started","chat.queued","chat.assigned","chat.transferred","chat.unassigned","chat.deactivated","chat.closed","chat.priority_changed","goal.achieved","chat.rated","chat.user_added","chat.user_removed","chat.properties_updated","thread.tagged","thread.untagged","thread.properties_updated","thread.summary_set","event.created","event.updated","event.deleted","event.seen","ticket.created","ticket.updated","customer.created","customer.updated","customer.identified","customer.banned","agent.status_changed","agent.created","agent.updated","agent.deleted","group.created","group.updated","group.deleted","tag.created","tag.updated","tag.deleted","canned_response.created","canned_response.updated","canned_response.deleted","routing_rule.created","routing_rule.updated","routing_rule.deleted","greeting.created","greeting.updated","greeting.deleted","settings.updated","webhook.test"]}},"filters":{"type":"object","properties":{"group_ids":{"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)$"}},"channels":{"type":"array","items":{"type":"string","enum":["widget","chat_page","api","email","whatsapp","messenger","instagram","telegram","line","zalo","viber","wechat","kakaotalk","sms","x","discord","slack","teams","apple_messages"]}},"author_types":{"type":"array","items":{"type":"string","enum":["customer","agent","bot","system"]}},"agent_ids":{"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)$"}}},"additionalProperties":false},"description":{"type":"string"},"enabled":{"type":"boolean"},"secret_hint":{"type":"string"},"owner_app":{"anyOf":[{"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)$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"paused_at":{"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{3}(?:Z))$"},{"type":"null"}]},"pause_reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"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{3}(?:Z))$"},"updated_at":{"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{3}(?:Z))$"},"secret":{"type":"string"}},"required":["id","url","events","filters","description","enabled","secret_hint","owner_app","paused_at","pause_reason","created_at","updated_at","secret"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/webhooks/events":{"get":{"summary":"The webhook event catalog","description":"No token.","tags":["Webhooks"],"security":[],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"event":{"type":"string","enum":["chat.started","chat.queued","chat.assigned","chat.transferred","chat.unassigned","chat.deactivated","chat.closed","chat.priority_changed","goal.achieved","chat.rated","chat.user_added","chat.user_removed","chat.properties_updated","thread.tagged","thread.untagged","thread.properties_updated","thread.summary_set","event.created","event.updated","event.deleted","event.seen","ticket.created","ticket.updated","customer.created","customer.updated","customer.identified","customer.banned","agent.status_changed","agent.created","agent.updated","agent.deleted","group.created","group.updated","group.deleted","tag.created","tag.updated","tag.deleted","canned_response.created","canned_response.updated","canned_response.deleted","routing_rule.created","routing_rule.updated","routing_rule.deleted","greeting.created","greeting.updated","greeting.deleted","settings.updated","webhook.test"]},"scope":{"type":"string","enum":["chats.access","chats.all","archives.read","archives.write","customers.read","customers.write","customers.ban","traffic.read","campaigns.manage","canned.manage","tags.manage","reports.read","team.read","team.manage","settings.manage","channels.manage","ai.manage","developers.manage","data.export"]},"description":{"type":"string"}},"required":["event","scope","description"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/webhooks/{id}":{"get":{"summary":"Get a webhook with its delivery health","description":"Needs the `developers.manage` permission.","tags":["Webhooks"],"security":[{"bearer":[]},{"oauth2":["developers.manage"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","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)$"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string","enum":["chat.started","chat.queued","chat.assigned","chat.transferred","chat.unassigned","chat.deactivated","chat.closed","chat.priority_changed","goal.achieved","chat.rated","chat.user_added","chat.user_removed","chat.properties_updated","thread.tagged","thread.untagged","thread.properties_updated","thread.summary_set","event.created","event.updated","event.deleted","event.seen","ticket.created","ticket.updated","customer.created","customer.updated","customer.identified","customer.banned","agent.status_changed","agent.created","agent.updated","agent.deleted","group.created","group.updated","group.deleted","tag.created","tag.updated","tag.deleted","canned_response.created","canned_response.updated","canned_response.deleted","routing_rule.created","routing_rule.updated","routing_rule.deleted","greeting.created","greeting.updated","greeting.deleted","settings.updated","webhook.test"]}},"filters":{"type":"object","properties":{"group_ids":{"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)$"}},"channels":{"type":"array","items":{"type":"string","enum":["widget","chat_page","api","email","whatsapp","messenger","instagram","telegram","line","zalo","viber","wechat","kakaotalk","sms","x","discord","slack","teams","apple_messages"]}},"author_types":{"type":"array","items":{"type":"string","enum":["customer","agent","bot","system"]}},"agent_ids":{"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)$"}}},"additionalProperties":false},"description":{"type":"string"},"enabled":{"type":"boolean"},"secret_hint":{"type":"string"},"owner_app":{"anyOf":[{"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)$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"paused_at":{"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{3}(?:Z))$"},{"type":"null"}]},"pause_reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"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{3}(?:Z))$"},"updated_at":{"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{3}(?:Z))$"},"health":{"type":"object","properties":{"state":{"type":"string","enum":["closed","open","half_open","paused"]},"consecutive_failures":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"open_until":{"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{3}(?:Z))$"},{"type":"null"}]},"last_success_at":{"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{3}(?:Z))$"},{"type":"null"}]},"last_failure_at":{"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{3}(?:Z))$"},{"type":"null"}]}},"required":["state","consecutive_failures","open_until","last_success_at","last_failure_at"],"additionalProperties":false}},"required":["id","url","events","filters","description","enabled","secret_hint","owner_app","paused_at","pause_reason","created_at","updated_at","health"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"patch":{"summary":"Change a webhook","description":"Needs the `developers.manage` permission.","tags":["Webhooks"],"security":[{"bearer":[]},{"oauth2":["developers.manage"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","maxLength":2000,"format":"uri"},"events":{"minItems":1,"maxItems":48,"type":"array","items":{"type":"string","enum":["chat.started","chat.queued","chat.assigned","chat.transferred","chat.unassigned","chat.deactivated","chat.closed","chat.priority_changed","goal.achieved","chat.rated","chat.user_added","chat.user_removed","chat.properties_updated","thread.tagged","thread.untagged","thread.properties_updated","thread.summary_set","event.created","event.updated","event.deleted","event.seen","ticket.created","ticket.updated","customer.created","customer.updated","customer.identified","customer.banned","agent.status_changed","agent.created","agent.updated","agent.deleted","group.created","group.updated","group.deleted","tag.created","tag.updated","tag.deleted","canned_response.created","canned_response.updated","canned_response.deleted","routing_rule.created","routing_rule.updated","routing_rule.deleted","greeting.created","greeting.updated","greeting.deleted","settings.updated"]}},"filters":{"type":"object","properties":{"group_ids":{"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)$"}},"channels":{"type":"array","items":{"type":"string","enum":["widget","chat_page","api","email","whatsapp","messenger","instagram","telegram","line","zalo","viber","wechat","kakaotalk","sms","x","discord","slack","teams","apple_messages"]}},"author_types":{"type":"array","items":{"type":"string","enum":["customer","agent","bot","system"]}},"agent_ids":{"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)$"}}},"additionalProperties":false},"description":{"type":"string","maxLength":200},"enabled":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","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)$"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string","enum":["chat.started","chat.queued","chat.assigned","chat.transferred","chat.unassigned","chat.deactivated","chat.closed","chat.priority_changed","goal.achieved","chat.rated","chat.user_added","chat.user_removed","chat.properties_updated","thread.tagged","thread.untagged","thread.properties_updated","thread.summary_set","event.created","event.updated","event.deleted","event.seen","ticket.created","ticket.updated","customer.created","customer.updated","customer.identified","customer.banned","agent.status_changed","agent.created","agent.updated","agent.deleted","group.created","group.updated","group.deleted","tag.created","tag.updated","tag.deleted","canned_response.created","canned_response.updated","canned_response.deleted","routing_rule.created","routing_rule.updated","routing_rule.deleted","greeting.created","greeting.updated","greeting.deleted","settings.updated","webhook.test"]}},"filters":{"type":"object","properties":{"group_ids":{"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)$"}},"channels":{"type":"array","items":{"type":"string","enum":["widget","chat_page","api","email","whatsapp","messenger","instagram","telegram","line","zalo","viber","wechat","kakaotalk","sms","x","discord","slack","teams","apple_messages"]}},"author_types":{"type":"array","items":{"type":"string","enum":["customer","agent","bot","system"]}},"agent_ids":{"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)$"}}},"additionalProperties":false},"description":{"type":"string"},"enabled":{"type":"boolean"},"secret_hint":{"type":"string"},"owner_app":{"anyOf":[{"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)$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"paused_at":{"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{3}(?:Z))$"},{"type":"null"}]},"pause_reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"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{3}(?:Z))$"},"updated_at":{"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{3}(?:Z))$"}},"required":["id","url","events","filters","description","enabled","secret_hint","owner_app","paused_at","pause_reason","created_at","updated_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"delete":{"summary":"Delete a webhook","description":"Needs the `developers.manage` permission.","tags":["Webhooks"],"security":[{"bearer":[]},{"oauth2":["developers.manage"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done."},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/webhooks/{id}:test":{"post":{"summary":"Send a test delivery now and report the result","description":"Needs the `developers.manage` permission.","tags":["Webhooks"],"security":[{"bearer":[]},{"oauth2":["developers.manage"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"status_code":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"duration_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"error_code":{"type":"string"}},"required":["ok","status_code","duration_ms","error_code"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/webhooks/{id}:rotate_secret":{"post":{"summary":"Issue a new signing secret; the old one keeps signing for 24 hours","description":"Needs the `developers.manage` permission.","tags":["Webhooks"],"security":[{"bearer":[]},{"oauth2":["developers.manage"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","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)$"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string","enum":["chat.started","chat.queued","chat.assigned","chat.transferred","chat.unassigned","chat.deactivated","chat.closed","chat.priority_changed","goal.achieved","chat.rated","chat.user_added","chat.user_removed","chat.properties_updated","thread.tagged","thread.untagged","thread.properties_updated","thread.summary_set","event.created","event.updated","event.deleted","event.seen","ticket.created","ticket.updated","customer.created","customer.updated","customer.identified","customer.banned","agent.status_changed","agent.created","agent.updated","agent.deleted","group.created","group.updated","group.deleted","tag.created","tag.updated","tag.deleted","canned_response.created","canned_response.updated","canned_response.deleted","routing_rule.created","routing_rule.updated","routing_rule.deleted","greeting.created","greeting.updated","greeting.deleted","settings.updated","webhook.test"]}},"filters":{"type":"object","properties":{"group_ids":{"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)$"}},"channels":{"type":"array","items":{"type":"string","enum":["widget","chat_page","api","email","whatsapp","messenger","instagram","telegram","line","zalo","viber","wechat","kakaotalk","sms","x","discord","slack","teams","apple_messages"]}},"author_types":{"type":"array","items":{"type":"string","enum":["customer","agent","bot","system"]}},"agent_ids":{"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)$"}}},"additionalProperties":false},"description":{"type":"string"},"enabled":{"type":"boolean"},"secret_hint":{"type":"string"},"owner_app":{"anyOf":[{"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)$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"paused_at":{"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{3}(?:Z))$"},{"type":"null"}]},"pause_reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"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{3}(?:Z))$"},"updated_at":{"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{3}(?:Z))$"},"secret":{"type":"string"}},"required":["id","url","events","filters","description","enabled","secret_hint","owner_app","paused_at","pause_reason","created_at","updated_at","secret"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/webhooks/{id}:resume":{"post":{"summary":"Resume a paused webhook and close its circuit","description":"Needs the `developers.manage` permission.","tags":["Webhooks"],"security":[{"bearer":[]},{"oauth2":["developers.manage"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","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)$"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string","enum":["chat.started","chat.queued","chat.assigned","chat.transferred","chat.unassigned","chat.deactivated","chat.closed","chat.priority_changed","goal.achieved","chat.rated","chat.user_added","chat.user_removed","chat.properties_updated","thread.tagged","thread.untagged","thread.properties_updated","thread.summary_set","event.created","event.updated","event.deleted","event.seen","ticket.created","ticket.updated","customer.created","customer.updated","customer.identified","customer.banned","agent.status_changed","agent.created","agent.updated","agent.deleted","group.created","group.updated","group.deleted","tag.created","tag.updated","tag.deleted","canned_response.created","canned_response.updated","canned_response.deleted","routing_rule.created","routing_rule.updated","routing_rule.deleted","greeting.created","greeting.updated","greeting.deleted","settings.updated","webhook.test"]}},"filters":{"type":"object","properties":{"group_ids":{"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)$"}},"channels":{"type":"array","items":{"type":"string","enum":["widget","chat_page","api","email","whatsapp","messenger","instagram","telegram","line","zalo","viber","wechat","kakaotalk","sms","x","discord","slack","teams","apple_messages"]}},"author_types":{"type":"array","items":{"type":"string","enum":["customer","agent","bot","system"]}},"agent_ids":{"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)$"}}},"additionalProperties":false},"description":{"type":"string"},"enabled":{"type":"boolean"},"secret_hint":{"type":"string"},"owner_app":{"anyOf":[{"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)$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"paused_at":{"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{3}(?:Z))$"},{"type":"null"}]},"pause_reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"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{3}(?:Z))$"},"updated_at":{"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{3}(?:Z))$"}},"required":["id","url","events","filters","description","enabled","secret_hint","owner_app","paused_at","pause_reason","created_at","updated_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/webhooks/{id}/deliveries":{"get":{"summary":"The delivery log, newest first","description":"Needs the `developers.manage` permission.","tags":["Webhooks"],"security":[{"bearer":[]},{"oauth2":["developers.manage"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["delivered","failed","dead","circuit_open","paused","test"]}},{"name":"event_id","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"limit","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"name":"page_token","in":"query","required":false,"schema":{"type":"string","maxLength":256}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"event_id":{"type":"string"},"event":{"type":"string"},"attempt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","enum":["delivered","failed","dead","circuit_open","paused","test"]},"status_code":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"duration_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"error_code":{"type":"string"},"response_snippet":{"type":"string"},"manual":{"type":"boolean"},"at":{"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{3}(?:Z))$"}},"required":["event_id","event","attempt","status","status_code","duration_ms","error_code","response_snippet","manual","at"],"additionalProperties":false}},"next_page_token":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["items","next_page_token"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/webhooks/{id}/deliveries/{event_id}:redeliver":{"post":{"summary":"Send a logged event again","description":"Needs the `developers.manage` permission.","tags":["Webhooks"],"security":[{"bearer":[]},{"oauth2":["developers.manage"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"event_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done."},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/transcripts":{"post":{"summary":"Email a chat transcript","description":"Any valid token.","tags":["Transcripts"],"security":[{"bearer":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"email":{"type":"string","maxLength":254,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"required":["chat_id"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["sent","verification_sent","cap_reached"]},"link":{"anyOf":[{"type":"object","properties":{"url":{"type":"string","format":"uri"},"expires_at":{"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{3}(?:Z))$"}},"required":["url","expires_at"],"additionalProperties":false},{"type":"null"}]}},"required":["status","link"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/transcripts/links":{"post":{"summary":"A signed, expiring link to the hosted transcript","description":"Any valid token.","tags":["Transcripts"],"security":[{"bearer":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"}},"required":["chat_id"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"expires_at":{"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{3}(?:Z))$"}},"required":["url","expires_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/transcripts/{token}":{"get":{"summary":"The hosted transcript page (HTML, or JSON by Accept)","description":"No token.","tags":["Transcripts"],"security":[],"parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"organization_name":{"type":"string"},"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"created_at":{"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{3}(?:Z))$"},"closed_at":{"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{3}(?:Z))$"},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","properties":{"author":{"type":"string"},"time":{"type":"string"},"side":{"type":"string","enum":["agent","customer","system"]},"lines":{"type":"array","items":{"type":"string"}}},"required":["author","time","side","lines"],"additionalProperties":false}}},"required":["organization_name","chat_id","thread_id","created_at","closed_at","items"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/email/settings":{"get":{"summary":"Email settings","description":"Needs the `settings.manage` permission.","tags":["Email"],"security":[{"bearer":[]},{"oauth2":["settings.manage"]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"transcript_forwarding_address":{"anyOf":[{"type":"string","maxLength":254,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]},"sender_name":{"anyOf":[{"type":"string","minLength":1,"maxLength":120},{"type":"null"}]},"conversation_replies":{"type":"boolean"}},"required":["transcript_forwarding_address","sender_name","conversation_replies"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"put":{"summary":"Change email settings","description":"Needs the `settings.manage` permission.","tags":["Email"],"security":[{"bearer":[]},{"oauth2":["settings.manage"]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"transcript_forwarding_address":{"anyOf":[{"type":"string","maxLength":254,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]},"sender_name":{"anyOf":[{"type":"string","minLength":1,"maxLength":120},{"type":"null"}]},"conversation_replies":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"transcript_forwarding_address":{"anyOf":[{"type":"string","maxLength":254,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]},"sender_name":{"anyOf":[{"type":"string","minLength":1,"maxLength":120},{"type":"null"}]},"conversation_replies":{"type":"boolean"}},"required":["transcript_forwarding_address","sender_name","conversation_replies"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/email/inboxes":{"get":{"summary":"Forwarding addresses","description":"Needs the `settings.manage` permission.","tags":["Email"],"security":[{"bearer":[]},{"oauth2":["settings.manage"]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"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"}]},"address":{"type":"string","maxLength":254,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"name":{"type":"string"},"group_id":{"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"}]},"auto_reply":{"type":"boolean"},"is_default":{"type":"boolean"}},"required":["id","address","name","group_id","auto_reply","is_default"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"post":{"summary":"Add or configure a forwarding address","description":"Needs the `settings.manage` permission.","tags":["Email"],"security":[{"bearer":[]},{"oauth2":["settings.manage"]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"slug":{"type":"string","pattern":"^[a-z0-9]([a-z0-9-]{0,38}[a-z0-9])?$"},"group_id":{"default":null,"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"}]},"auto_reply":{"default":true,"type":"boolean"}},"required":["name"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"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"}]},"address":{"type":"string","maxLength":254,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"name":{"type":"string"},"group_id":{"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"}]},"auto_reply":{"type":"boolean"},"is_default":{"type":"boolean"}},"required":["id","address","name","group_id","auto_reply","is_default"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/email/inboxes/{id}":{"patch":{"summary":"Change a forwarding address","description":"Needs the `settings.manage` permission.","tags":["Email"],"security":[{"bearer":[]},{"oauth2":["settings.manage"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"group_id":{"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"}]},"auto_reply":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"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"}]},"address":{"type":"string","maxLength":254,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"name":{"type":"string"},"group_id":{"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"}]},"auto_reply":{"type":"boolean"},"is_default":{"type":"boolean"}},"required":["id","address","name","group_id","auto_reply","is_default"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"delete":{"summary":"Remove a forwarding address","description":"Needs the `settings.manage` permission.","tags":["Email"],"security":[{"bearer":[]},{"oauth2":["settings.manage"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done."},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/email/blocked-senders":{"get":{"summary":"Blocked senders","description":"Needs the `settings.manage` permission.","tags":["Email"],"security":[{"bearer":[]},{"oauth2":["settings.manage"]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"pattern":{"type":"string","maxLength":254,"pattern":"^([^@\\s]+)?@[^@\\s]+\\.[^@\\s]+$"},"created_at":{"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{3}(?:Z))$"}},"required":["pattern","created_at"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"post":{"summary":"Block a sender or a domain","description":"Needs the `settings.manage` permission.","tags":["Email"],"security":[{"bearer":[]},{"oauth2":["settings.manage"]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"pattern":{"type":"string","maxLength":254,"pattern":"^([^@\\s]+)?@[^@\\s]+\\.[^@\\s]+$"}},"required":["pattern"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"pattern":{"type":"string","maxLength":254,"pattern":"^([^@\\s]+)?@[^@\\s]+\\.[^@\\s]+$"},"created_at":{"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{3}(?:Z))$"}},"required":["pattern","created_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/email/blocked-senders/{pattern}":{"delete":{"summary":"Unblock a sender","description":"Needs the `settings.manage` permission.","tags":["Email"],"security":[{"bearer":[]},{"oauth2":["settings.manage"]}],"parameters":[{"name":"pattern","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done."},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/email/suppressions":{"get":{"summary":"Addresses we do not email","description":"Needs the `settings.manage` permission.","tags":["Email"],"security":[{"bearer":[]},{"oauth2":["settings.manage"]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"address":{"type":"string","maxLength":254,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"reason":{"type":"string","enum":["bounce","complaint","unsubscribe","manual"]},"created_at":{"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{3}(?:Z))$"}},"required":["address","reason","created_at"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"post":{"summary":"Stop emailing an address","description":"Needs the `settings.manage` permission.","tags":["Email"],"security":[{"bearer":[]},{"oauth2":["settings.manage"]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"address":{"type":"string","maxLength":254,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"required":["address"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"address":{"type":"string","maxLength":254,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"reason":{"type":"string","enum":["bounce","complaint","unsubscribe","manual"]},"created_at":{"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{3}(?:Z))$"}},"required":["address","reason","created_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/email/suppressions/{address}":{"delete":{"summary":"Email an address again","description":"Needs the `settings.manage` permission.","tags":["Email"],"security":[{"bearer":[]},{"oauth2":["settings.manage"]}],"parameters":[{"name":"address","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done."},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/email/messages":{"get":{"summary":"Emails sent and received","description":"Needs the `chats.access` permission.","tags":["Email"],"security":[{"bearer":[]},{"oauth2":["chats.access"]}],"parameters":[{"name":"chat_id","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"}},{"name":"direction","in":"query","required":false,"schema":{"type":"string","enum":["out","in"]}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["queued","sent","failed","suppressed","skipped","received","delivered","spam","blocked","released"]}},{"name":"limit","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"name":"page_token","in":"query","required":false,"schema":{"type":"string","maxLength":256}}],"responses":{"200":{"description":"OK","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)$"},"direction":{"type":"string","enum":["out","in"]},"template":{"anyOf":[{"type":"string"},{"type":"null"}]},"chat_id":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},{"type":"null"}]},"address":{"type":"string"},"status":{"type":"string","enum":["queued","sent","failed","suppressed","skipped","received","delivered","spam","blocked","released"]},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"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{3}(?:Z))$"}},"required":["id","direction","template","chat_id","address","status","reason","created_at"],"additionalProperties":false}},"next_page_token":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["items","next_page_token"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/email/messages/{id}:release":{"post":{"summary":"Deliver an email held as spam into its chat","description":"Needs the `chats.access` permission.","tags":["Email"],"security":[{"bearer":[]},{"oauth2":["chats.access"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","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)$"},"direction":{"type":"string","enum":["out","in"]},"template":{"anyOf":[{"type":"string"},{"type":"null"}]},"chat_id":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},{"type":"null"}]},"address":{"type":"string"},"status":{"type":"string","enum":["queued","sent","failed","suppressed","skipped","received","delivered","spam","blocked","released"]},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"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{3}(?:Z))$"}},"required":["id","direction","template","chat_id","address","status","reason","created_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/email/install-instructions":{"post":{"summary":"Email a developer the widget install instructions","description":"Needs the `settings.manage` permission.","tags":["Email"],"security":[{"bearer":[]},{"oauth2":["settings.manage"]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","maxLength":254,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"platform":{"default":"html","type":"string","enum":["html","wordpress","shopify","wix","gtm","react"]}},"required":["email"]}}}},"responses":{"202":{"description":"Accepted","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"queued"}},"required":["status"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/email/usage":{"get":{"summary":"This month's email usage","description":"Needs the `settings.manage` permission.","tags":["Email"],"security":[{"bearer":[]},{"oauth2":["settings.manage"]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"period":{"type":"string"},"transcript_emails":{"type":"object","properties":{"used":{"type":"integer","minimum":0,"maximum":9007199254740991},"limit":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["used","limit"],"additionalProperties":false},"emails":{"type":"object","properties":{"used":{"type":"integer","minimum":0,"maximum":9007199254740991},"limit":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["used","limit"],"additionalProperties":false}},"required":["period","transcript_emails","emails"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/email/verify/{token}":{"get":{"summary":"The address confirmation page (HTML)","description":"No token.","tags":["Email"],"security":[],"parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"post":{"summary":"Confirm the address and mail the transcript (HTML)","description":"No token.","tags":["Email"],"security":[],"parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/email/unsubscribe/{token}":{"get":{"summary":"Unsubscribe page (HTML)","description":"No token.","tags":["Email"],"security":[],"parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"post":{"summary":"Unsubscribe, also RFC 8058 one-click","description":"No token.","tags":["Email"],"security":[],"parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Done."},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/files":{"post":{"summary":"Start an upload: signed URLs for a chat file and its thumbnail (a customer token, or an agent token with chats.access), or a knowledge file (ai.manage)","description":"Any valid token.","tags":["Files"],"security":[{"bearer":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"purpose":{"type":"string","const":"knowledge"},"name":{"type":"string","minLength":1,"maxLength":255},"content_type":{"type":"string","enum":["application/pdf","text/plain","text/markdown","text/csv"]},"size":{"type":"integer","minimum":1,"maximum":20971520}},"required":["purpose","name","content_type","size"]},{"type":"object","properties":{"purpose":{"default":"chat","type":"string","const":"chat"},"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"name":{"type":"string","minLength":1,"maxLength":255},"content_type":{"type":"string","minLength":1,"maxLength":127},"size":{"type":"integer","minimum":1,"maximum":9007199254740991},"thumbnail":{"default":false,"type":"boolean"}},"required":["chat_id","name","content_type","size"]}]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"file_key":{"type":"string","maxLength":512},"upload_url":{"type":"string","format":"uri"},"thumbnail_upload_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"max_bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"expires_at":{"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{3}(?:Z))$"}},"required":["file_key","upload_url","thumbnail_upload_url","max_bytes","expires_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/files/blob/{file_key}":{"put":{"summary":"Upload the bytes to a signed upload URL (no Authorization header)","description":"No token.","tags":["Files"],"security":[],"parameters":[{"name":"file_key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"file_key":{"type":"string","maxLength":512},"name":{"type":"string","minLength":1,"maxLength":255},"content_type":{"type":"string","enum":["image/png","image/jpeg","image/gif","image/webp","application/pdf","text/plain","text/csv","text/markdown","application/zip","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/msword","application/vnd.ms-excel","video/mp4","video/quicktime","video/webm","audio/mpeg","audio/mp4","audio/ogg","audio/wav"]},"size":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"width":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"height":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["file_key","name","content_type","size","width","height"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"get":{"summary":"Download through a signed URL (no Authorization header)","description":"No token.","tags":["Files"],"security":[],"parameters":[{"name":"file_key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/files/capabilities":{"get":{"summary":"Whether uploads work here and for you","description":"Any valid token.","tags":["Files"],"security":[{"bearer":[]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"storage":{"type":"boolean"},"uploads":{"type":"boolean"},"knowledge_uploads":{"type":"boolean"},"max_upload_bytes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"link_previews":{"type":"boolean"}},"required":["storage","uploads","knowledge_uploads","max_upload_bytes","link_previews"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/files:sign":{"post":{"summary":"Signed download URLs for up to 100 files (a customer token for its own chats, or an agent token with chats.access)","description":"Any valid token.","tags":["Files"],"security":[{"bearer":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"file_keys":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":512}},"variant":{"default":"original","type":"string","enum":["original","thumbnail"]},"download":{"default":false,"type":"boolean"}},"required":["file_keys"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"file_key":{"type":"string"},"url":{"type":"string","format":"uri"},"expires_at":{"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{3}(?:Z))$"}},"required":["file_key","url","expires_at"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/files:unfurl":{"post":{"summary":"Link preview for a URL in a message (a customer token, or an agent token with chats.access)","description":"Any valid token.","tags":["Files"],"security":[{"bearer":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","minLength":8,"maxLength":2048}},"required":["url"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"image_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"site_name":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["url","title","description","image_url","site_name"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/files/proxy":{"get":{"summary":"A link preview's image through a signed URL (no Authorization header)","description":"No token.","tags":["Files"],"security":[],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/imports/sources":{"get":{"summary":"Platforms you can import from and what each needs","description":"Any valid token.","tags":["Imports"],"security":[{"bearer":[]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string","enum":["livechat","intercom","crisp","zendesk_chat","tawk","tidio","olark","generic"]},"label":{"type":"string"},"kind":{"type":"string","enum":["api","file"]},"credentials":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"secret":{"type":"boolean"},"options":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"label":{"type":"string"}},"required":["value","label"],"additionalProperties":false}},{"type":"null"}]},"help":{"type":"string"}},"required":["key","label","secret","options","help"],"additionalProperties":false}},"steps":{"type":"array","items":{"type":"string","enum":["groups","agents","tags","canned_responses","customers","archives"]}},"file_formats":{"type":"array","items":{"type":"string","enum":["json","ndjson","csv"]}},"help":{"type":"string"}},"required":["source","label","kind","credentials","steps","file_formats","help"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/imports:upload_url":{"post":{"summary":"A signed URL to upload an export file to","description":"Needs the `settings.manage` permission.","tags":["Imports"],"security":[{"bearer":[]},{"oauth2":["settings.manage"]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"size":{"type":"integer","minimum":1,"maximum":52428800}},"required":["name","size"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"file_key":{"type":"string"},"upload_url":{"type":"string","format":"uri"},"expires_at":{"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{3}(?:Z))$"}},"required":["file_key","upload_url","expires_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/imports":{"post":{"summary":"Start an import","description":"Needs the `settings.manage` permission.","tags":["Imports"],"security":[{"bearer":[]},{"oauth2":["settings.manage"]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"source":{"type":"string","enum":["livechat","intercom","crisp","zendesk_chat","tawk","tidio","olark","generic"]},"credentials":{"default":{},"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"string","maxLength":4096}},"file_key":{"default":null,"anyOf":[{"type":"string","maxLength":512},{"type":"null"}]},"options":{"default":{"archives_since":null,"include":["groups","agents","tags","canned_responses","customers","archives"],"csv_entity":null},"type":"object","properties":{"archives_since":{"default":null,"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{3}(?:Z))$"},{"type":"null"}]},"include":{"default":["groups","agents","tags","canned_responses","customers","archives"],"minItems":1,"type":"array","items":{"type":"string","enum":["groups","agents","tags","canned_responses","customers","archives"]}},"csv_entity":{"default":null,"anyOf":[{"type":"string","enum":["groups","agents","tags","canned_responses","customers","archives"]},{"type":"null"}]}}}},"required":["source"]}}}},"responses":{"200":{"description":"OK","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)$"},"source":{"type":"string","enum":["livechat","intercom","crisp","zendesk_chat","tawk","tidio","olark","generic"]},"status":{"type":"string","enum":["queued","running","done","failed","cancelled"]},"step":{"anyOf":[{"type":"string","enum":["groups","agents","tags","canned_responses","customers","archives"]},{"type":"null"}]},"include":{"type":"array","items":{"type":"string","enum":["groups","agents","tags","canned_responses","customers","archives"]}},"progress":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"imported":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skipped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"done":{"type":"boolean"}},"required":["imported","skipped","failed","total","done"],"additionalProperties":false}},"error_code":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"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{3}(?:Z))$"},"started_at":{"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{3}(?:Z))$"},{"type":"null"}]},"finished_at":{"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{3}(?:Z))$"},{"type":"null"}]}},"required":["id","source","status","step","include","progress","error_code","created_at","started_at","finished_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"get":{"summary":"List imports, newest first","description":"Needs the `settings.manage` permission.","tags":["Imports"],"security":[{"bearer":[]},{"oauth2":["settings.manage"]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"name":"page_token","in":"query","required":false,"schema":{"type":"string","maxLength":2048}}],"responses":{"200":{"description":"OK","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)$"},"source":{"type":"string","enum":["livechat","intercom","crisp","zendesk_chat","tawk","tidio","olark","generic"]},"status":{"type":"string","enum":["queued","running","done","failed","cancelled"]},"step":{"anyOf":[{"type":"string","enum":["groups","agents","tags","canned_responses","customers","archives"]},{"type":"null"}]},"include":{"type":"array","items":{"type":"string","enum":["groups","agents","tags","canned_responses","customers","archives"]}},"progress":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"imported":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skipped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"done":{"type":"boolean"}},"required":["imported","skipped","failed","total","done"],"additionalProperties":false}},"error_code":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"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{3}(?:Z))$"},"started_at":{"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{3}(?:Z))$"},{"type":"null"}]},"finished_at":{"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{3}(?:Z))$"},{"type":"null"}]}},"required":["id","source","status","step","include","progress","error_code","created_at","started_at","finished_at"],"additionalProperties":false}},"next_page_token":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["items","next_page_token"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/imports/{import_id}":{"get":{"summary":"An import and its progress","description":"Needs the `settings.manage` permission.","tags":["Imports"],"security":[{"bearer":[]},{"oauth2":["settings.manage"]}],"parameters":[{"name":"import_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","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)$"},"source":{"type":"string","enum":["livechat","intercom","crisp","zendesk_chat","tawk","tidio","olark","generic"]},"status":{"type":"string","enum":["queued","running","done","failed","cancelled"]},"step":{"anyOf":[{"type":"string","enum":["groups","agents","tags","canned_responses","customers","archives"]},{"type":"null"}]},"include":{"type":"array","items":{"type":"string","enum":["groups","agents","tags","canned_responses","customers","archives"]}},"progress":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"imported":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skipped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"done":{"type":"boolean"}},"required":["imported","skipped","failed","total","done"],"additionalProperties":false}},"error_code":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"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{3}(?:Z))$"},"started_at":{"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{3}(?:Z))$"},{"type":"null"}]},"finished_at":{"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{3}(?:Z))$"},{"type":"null"}]}},"required":["id","source","status","step","include","progress","error_code","created_at","started_at","finished_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/imports/{import_id}:cancel":{"post":{"summary":"Cancel a running import","description":"Needs the `settings.manage` permission.","tags":["Imports"],"security":[{"bearer":[]},{"oauth2":["settings.manage"]}],"parameters":[{"name":"import_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","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)$"},"source":{"type":"string","enum":["livechat","intercom","crisp","zendesk_chat","tawk","tidio","olark","generic"]},"status":{"type":"string","enum":["queued","running","done","failed","cancelled"]},"step":{"anyOf":[{"type":"string","enum":["groups","agents","tags","canned_responses","customers","archives"]},{"type":"null"}]},"include":{"type":"array","items":{"type":"string","enum":["groups","agents","tags","canned_responses","customers","archives"]}},"progress":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"imported":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skipped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"done":{"type":"boolean"}},"required":["imported","skipped","failed","total","done"],"additionalProperties":false}},"error_code":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"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{3}(?:Z))$"},"started_at":{"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{3}(?:Z))$"},{"type":"null"}]},"finished_at":{"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{3}(?:Z))$"},{"type":"null"}]}},"required":["id","source","status","step","include","progress","error_code","created_at","started_at","finished_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/imports/{import_id}:resume":{"post":{"summary":"Resume a failed or cancelled import from where it stopped","description":"Needs the `settings.manage` permission.","tags":["Imports"],"security":[{"bearer":[]},{"oauth2":["settings.manage"]}],"parameters":[{"name":"import_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"credentials":{"default":{},"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"string","maxLength":4096}}}}}}},"responses":{"200":{"description":"OK","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)$"},"source":{"type":"string","enum":["livechat","intercom","crisp","zendesk_chat","tawk","tidio","olark","generic"]},"status":{"type":"string","enum":["queued","running","done","failed","cancelled"]},"step":{"anyOf":[{"type":"string","enum":["groups","agents","tags","canned_responses","customers","archives"]},{"type":"null"}]},"include":{"type":"array","items":{"type":"string","enum":["groups","agents","tags","canned_responses","customers","archives"]}},"progress":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"imported":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skipped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"done":{"type":"boolean"}},"required":["imported","skipped","failed","total","done"],"additionalProperties":false}},"error_code":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"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{3}(?:Z))$"},"started_at":{"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{3}(?:Z))$"},{"type":"null"}]},"finished_at":{"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{3}(?:Z))$"},{"type":"null"}]}},"required":["id","source","status","step","include","progress","error_code","created_at","started_at","finished_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/payments/methods":{"get":{"summary":"Which payment methods are configured","description":"Any valid token.","tags":["Payments"],"security":[{"bearer":[]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"card":{"type":"boolean"},"crypto":{"type":"boolean"},"crypto_months":{"type":"array","items":{"type":"number","enum":[1,3,12]}}},"required":["card","crypto","crypto_months"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/payments/usage":{"get":{"summary":"This month's conversations against the plan's limits","description":"Any valid token.","tags":["Payments"],"security":[{"bearer":[]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"period":{"type":"string","pattern":"^\\d{4}-\\d{2}$"},"conversations":{"type":"object","properties":{"used":{"type":"integer","minimum":0,"maximum":9007199254740991},"limit":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["used","limit"],"additionalProperties":false},"automated":{"type":"object","properties":{"used":{"type":"integer","minimum":0,"maximum":9007199254740991},"included":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"packs":{"type":"integer","minimum":0,"maximum":9007199254740991},"pack":{"type":"object","properties":{"conversations":{"type":"integer","minimum":0,"maximum":9007199254740991},"price_cents":{"type":"integer","minimum":0,"maximum":9007199254740991},"currency":{"type":"string"}},"required":["conversations","price_cents","currency"],"additionalProperties":false}},"required":["used","included","packs","pack"],"additionalProperties":false},"api":{"type":"object","properties":{"used":{"type":"integer","minimum":0,"maximum":9007199254740991},"limit":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["used","limit"],"additionalProperties":false},"capped":{"type":"object","properties":{"conversations":{"type":"boolean"},"api":{"type":"boolean"}},"required":["conversations","api"],"additionalProperties":false}},"required":["period","conversations","automated","api","capped"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/payments/portal":{"post":{"summary":"A Stripe Customer Portal session: card, invoices, cancel","description":"A signed-in agent session with the `billing.manage` permission; API tokens are refused.","tags":["Payments"],"security":[{"bearer":[]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"portal_url":{"type":"string","format":"uri"}},"required":["portal_url"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/payments/seats":{"post":{"summary":"Pay for more seats now","description":"A signed-in agent session with the `billing.manage` permission; API tokens are refused.","tags":["Payments"],"security":[{"bearer":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"seats":{"type":"integer","minimum":1,"maximum":100000}},"required":["seats"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"changed"},"overview":{"type":"object","properties":{"plan":{"type":"object","properties":{"code":{"type":"string","pattern":"^[a-z0-9_-]{1,32}$"},"name":{"type":"string"},"description":{"type":"string"},"price_cents_monthly":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"price_cents_yearly":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"limits":{"type":"object","propertyNames":{"type":"string","enum":["seats","transcript_emails_per_month","chats_per_month","automated_conversations_per_month","api_conversations_per_month","emails_per_month","api_requests_per_month","max_upload_bytes","workflows","workflow_runs_per_month","retention_days","security_controls","history_days"]},"additionalProperties":{"type":"integer","minimum":0,"maximum":9007199254740991}},"features":{"type":"array","items":{"type":"string"}},"contact_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["code","name","description","price_cents_monthly","price_cents_yearly","currency","limits","features","contact_url","position"],"additionalProperties":false},"subscription":{"type":"object","properties":{"plan_code":{"type":"string","pattern":"^[a-z0-9_-]{1,32}$"},"status":{"type":"string","enum":["active","trialing","past_due","canceled"]},"billing_cycle":{"type":"string","enum":["monthly","yearly"]},"current_period_start":{"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{3}(?:Z))$"},{"type":"null"}]},"current_period_end":{"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{3}(?:Z))$"},{"type":"null"}]},"provider":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["plan_code","status","billing_cycle","current_period_start","current_period_end","provider"],"additionalProperties":false},"period":{"type":"string","pattern":"^\\d{4}-\\d{2}$"},"seats_used":{"type":"integer","minimum":0,"maximum":9007199254740991},"usage":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","enum":["seats","transcript_emails_per_month","chats_per_month","automated_conversations_per_month","api_conversations_per_month","emails_per_month","api_requests_per_month","max_upload_bytes","workflows","workflow_runs_per_month","retention_days","security_controls","history_days"]},"used":{"type":"integer","minimum":0,"maximum":9007199254740991},"limit":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["key","used","limit"],"additionalProperties":false}},"payments_enabled":{"type":"boolean"}},"required":["plan","subscription","period","seats_used","usage","payments_enabled"],"additionalProperties":false}},"required":["kind","overview"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"checkout"},"checkout_url":{"type":"string","format":"uri"}},"required":["kind","checkout_url"],"additionalProperties":false}]}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/payments/invoices":{"get":{"summary":"Invoices and receipts, newest first","description":"A signed-in agent session with the `billing.manage` permission; API tokens are refused.","tags":["Payments"],"security":[{"bearer":[]}],"parameters":[],"responses":{"200":{"description":"OK","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)$"},"provider":{"type":"string","enum":["stripe","nowpayments"]},"kind":{"type":"string","enum":["subscription","prepaid","seats"]},"status":{"type":"string","enum":["open","confirming","paid","partially_paid","expired","failed","refunded","void"]},"plan_code":{"type":"string","pattern":"^[a-z0-9_-]{1,32}$"},"billing_cycle":{"type":"string","enum":["monthly","yearly"]},"months":{"anyOf":[{"type":"number","enum":[1,3,12]},{"type":"null"}]},"seats":{"type":"integer","minimum":1,"maximum":9007199254740991},"amount_cents":{"type":"integer","minimum":0,"maximum":9007199254740991},"owed_paid_cents":{"type":"integer","minimum":0,"maximum":9007199254740991},"credit_cents":{"type":"integer","minimum":0,"maximum":9007199254740991},"amount_paid_cents":{"type":"integer","minimum":0,"maximum":9007199254740991},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"hosted_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"pdf_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"period_start":{"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{3}(?:Z))$"},{"type":"null"}]},"period_end":{"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{3}(?:Z))$"},{"type":"null"}]},"paid_at":{"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{3}(?:Z))$"},{"type":"null"}]},"created_at":{"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{3}(?:Z))$"}},"required":["id","provider","kind","status","plan_code","billing_cycle","months","seats","amount_cents","owed_paid_cents","credit_cents","amount_paid_cents","currency","hosted_url","pdf_url","period_start","period_end","paid_at","created_at"],"additionalProperties":false}},"next_page_token":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["items","next_page_token"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/payments/invoices/{id}":{"get":{"summary":"One invoice; poll it for a crypto payment's status","description":"A signed-in agent session with the `billing.manage` permission; API tokens are refused.","tags":["Payments"],"security":[{"bearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","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)$"},"provider":{"type":"string","enum":["stripe","nowpayments"]},"kind":{"type":"string","enum":["subscription","prepaid","seats"]},"status":{"type":"string","enum":["open","confirming","paid","partially_paid","expired","failed","refunded","void"]},"plan_code":{"type":"string","pattern":"^[a-z0-9_-]{1,32}$"},"billing_cycle":{"type":"string","enum":["monthly","yearly"]},"months":{"anyOf":[{"type":"number","enum":[1,3,12]},{"type":"null"}]},"seats":{"type":"integer","minimum":1,"maximum":9007199254740991},"amount_cents":{"type":"integer","minimum":0,"maximum":9007199254740991},"owed_paid_cents":{"type":"integer","minimum":0,"maximum":9007199254740991},"credit_cents":{"type":"integer","minimum":0,"maximum":9007199254740991},"amount_paid_cents":{"type":"integer","minimum":0,"maximum":9007199254740991},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"hosted_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"pdf_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"period_start":{"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{3}(?:Z))$"},{"type":"null"}]},"period_end":{"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{3}(?:Z))$"},{"type":"null"}]},"paid_at":{"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{3}(?:Z))$"},{"type":"null"}]},"created_at":{"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{3}(?:Z))$"}},"required":["id","provider","kind","status","plan_code","billing_cycle","months","seats","amount_cents","owed_paid_cents","credit_cents","amount_paid_cents","currency","hosted_url","pdf_url","period_start","period_end","paid_at","created_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/payments/invoices:complete":{"post":{"summary":"Replace an under-paid crypto invoice with one for the shortfall","description":"A signed-in agent session with the `billing.manage` permission; API tokens are refused.","tags":["Payments"],"security":[{"bearer":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"invoice_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)$"}},"required":["invoice_id"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"invoice":{"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)$"},"provider":{"type":"string","enum":["stripe","nowpayments"]},"kind":{"type":"string","enum":["subscription","prepaid","seats"]},"status":{"type":"string","enum":["open","confirming","paid","partially_paid","expired","failed","refunded","void"]},"plan_code":{"type":"string","pattern":"^[a-z0-9_-]{1,32}$"},"billing_cycle":{"type":"string","enum":["monthly","yearly"]},"months":{"anyOf":[{"type":"number","enum":[1,3,12]},{"type":"null"}]},"seats":{"type":"integer","minimum":1,"maximum":9007199254740991},"amount_cents":{"type":"integer","minimum":0,"maximum":9007199254740991},"owed_paid_cents":{"type":"integer","minimum":0,"maximum":9007199254740991},"credit_cents":{"type":"integer","minimum":0,"maximum":9007199254740991},"amount_paid_cents":{"type":"integer","minimum":0,"maximum":9007199254740991},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"hosted_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"pdf_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"period_start":{"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{3}(?:Z))$"},{"type":"null"}]},"period_end":{"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{3}(?:Z))$"},{"type":"null"}]},"paid_at":{"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{3}(?:Z))$"},{"type":"null"}]},"created_at":{"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{3}(?:Z))$"}},"required":["id","provider","kind","status","plan_code","billing_cycle","months","seats","amount_cents","owed_paid_cents","credit_cents","amount_paid_cents","currency","hosted_url","pdf_url","period_start","period_end","paid_at","created_at"],"additionalProperties":false},"checkout_url":{"type":"string","format":"uri"}},"required":["invoice","checkout_url"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/payments/profile":{"get":{"summary":"Billing name, country, email and tax ids","description":"A signed-in agent session with the `billing.manage` permission; API tokens are refused.","tags":["Payments"],"security":[{"bearer":[]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"billing_email":{"anyOf":[{"type":"string","maxLength":254,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]},"legal_name":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"country":{"anyOf":[{"type":"string","pattern":"^[A-Z]{2}$"},{"type":"null"}]},"tax_ids":{"maxItems":5,"type":"array","items":{"type":"object","properties":{"type":{"type":"string","pattern":"^[a-z]{2}_[a-z_]{2,16}$"},"value":{"type":"string","minLength":2,"maxLength":64}},"required":["type","value"],"additionalProperties":false}},"credit_cents":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["billing_email","legal_name","country","tax_ids","credit_cents"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"put":{"summary":"Set the billing details; tax ids reach Stripe","description":"A signed-in agent session with the `billing.manage` permission; API tokens are refused.","tags":["Payments"],"security":[{"bearer":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"billing_email":{"anyOf":[{"type":"string","maxLength":254,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]},"legal_name":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"country":{"anyOf":[{"type":"string","pattern":"^[A-Z]{2}$"},{"type":"null"}]},"tax_ids":{"maxItems":5,"type":"array","items":{"type":"object","properties":{"type":{"type":"string","pattern":"^[a-z]{2}_[a-z_]{2,16}$"},"value":{"type":"string","minLength":2,"maxLength":64}},"required":["type","value"]}}},"required":["billing_email","legal_name","country","tax_ids"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"billing_email":{"anyOf":[{"type":"string","maxLength":254,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]},"legal_name":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"country":{"anyOf":[{"type":"string","pattern":"^[A-Z]{2}$"},{"type":"null"}]},"tax_ids":{"maxItems":5,"type":"array","items":{"type":"object","properties":{"type":{"type":"string","pattern":"^[a-z]{2}_[a-z_]{2,16}$"},"value":{"type":"string","minLength":2,"maxLength":64}},"required":["type","value"],"additionalProperties":false}},"credit_cents":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["billing_email","legal_name","country","tax_ids","credit_cents"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/hooks/payments/stripe":{"post":{"summary":"Stripe webhook (signed)","description":"No token.","tags":["Payments"],"security":[],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/hooks/payments/nowpayments":{"post":{"summary":"NOWPayments IPN (signed)","description":"No token.","tags":["Payments"],"security":[],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/push/config":{"get":{"summary":"The VAPID public key browsers subscribe with","description":"Any valid token.","tags":["Push"],"security":[{"bearer":[]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"vapid_public_key":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["vapid_public_key"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/push/subscriptions":{"post":{"summary":"Register this device for web push or FCM","description":"Any valid token.","tags":["Push"],"security":[{"bearer":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"webpush"},"endpoint":{"type":"string","maxLength":2048,"format":"uri"},"keys":{"type":"object","properties":{"p256dh":{"type":"string","minLength":86,"maxLength":88,"pattern":"^[A-Za-z0-9_-]+={0,2}$"},"auth":{"type":"string","minLength":22,"maxLength":24,"pattern":"^[A-Za-z0-9_-]+={0,2}$"}},"required":["p256dh","auth"]},"device_label":{"default":"","type":"string","maxLength":64}},"required":["kind","endpoint","keys"]},{"type":"object","properties":{"kind":{"type":"string","const":"fcm"},"token":{"type":"string","minLength":16,"maxLength":4096},"device_label":{"default":"","type":"string","maxLength":64}},"required":["kind","token"]}]}}}},"responses":{"200":{"description":"OK","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)$"},"kind":{"type":"string","enum":["webpush","fcm"]},"endpoint":{"type":"string"},"device_label":{"type":"string"},"created_at":{"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{3}(?:Z))$"},"last_success_at":{"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{3}(?:Z))$"},{"type":"null"}]}},"required":["id","kind","endpoint","device_label","created_at","last_success_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"get":{"summary":"List your registered devices","description":"Any valid token.","tags":["Push"],"security":[{"bearer":[]}],"parameters":[],"responses":{"200":{"description":"OK","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)$"},"kind":{"type":"string","enum":["webpush","fcm"]},"endpoint":{"type":"string"},"device_label":{"type":"string"},"created_at":{"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{3}(?:Z))$"},"last_success_at":{"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{3}(?:Z))$"},{"type":"null"}]}},"required":["id","kind","endpoint","device_label","created_at","last_success_at"],"additionalProperties":false}},"next_page_token":{"type":"null"}},"required":["items","next_page_token"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/push/subscriptions/{subscription_id}":{"delete":{"summary":"Remove a device","description":"Any valid token.","tags":["Push"],"security":[{"bearer":[]}],"parameters":[{"name":"subscription_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done."},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/push:test":{"post":{"summary":"Send a test notification to your devices","description":"Any valid token.","tags":["Push"],"security":[{"bearer":[]}],"parameters":[],"responses":{"204":{"description":"Done."},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/chats":{"get":{"summary":"List chats the caller can see","description":"Needs the `chats.access` permission.","tags":["Chats"],"security":[{"bearer":[]},{"oauth2":["chats.access"]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"name":"page_token","in":"query","required":false,"schema":{"type":"string","maxLength":2048}},{"name":"status","in":"query","required":false,"schema":{"type":"string"}},{"name":"group_id","in":"query","required":false,"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":"assignee_id","in":"query","required":false,"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":"customer_id","in":"query","required":false,"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":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"channel":{"type":"string","enum":["widget","chat_page","api","email","whatsapp","messenger","instagram","telegram","line","zalo","viber","wechat","kakaotalk","sms","x","discord","slack","teams","apple_messages"]},"status":{"type":"string","enum":["queued","pending","active","inactive","archived"]},"customer":{"type":"object","properties":{"id":{"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"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"type":"string","maxLength":254,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]}},"required":["id","name","email"],"additionalProperties":false},"assignee_id":{"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"}]},"group_ids":{"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)$"}},"agent_ids":{"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)$"}},"supervisor_ids":{"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)$"}},"last_thread_id":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},{"type":"null"}]},"last_event_preview":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"last_event_at":{"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{3}(?:Z))$"},{"type":"null"}]},"last_event_author_type":{"anyOf":[{"type":"string","enum":["agent","customer","system"]},{"type":"null"}]},"unread_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"tags":{"type":"array","items":{"type":"string"}},"queue":{"anyOf":[{"type":"object","properties":{"position":{"type":"integer","minimum":1,"maximum":9007199254740991},"wait_time_s":{"type":"integer","minimum":0,"maximum":9007199254740991},"queued_at":{"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{3}(?:Z))$"}},"required":["position","wait_time_s","queued_at"],"additionalProperties":false},{"type":"null"}]},"rating":{"anyOf":[{"type":"string","enum":["good","bad"]},{"type":"null"}]},"close_reason":{"anyOf":[{"type":"string","enum":["closed_by_agent","closed_by_customer","inactivity","customer_left","customer_banned"]},{"type":"null"}]},"created_at":{"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{3}(?:Z))$"}},"required":["id","channel","status","customer","assignee_id","group_ids","agent_ids","supervisor_ids","last_thread_id","last_event_preview","last_event_at","last_event_author_type","unread_count","tags","queue","rating","close_reason","created_at"],"additionalProperties":false}},"next_page_token":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["items","next_page_token"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"post":{"summary":"Start a chat with a known customer","description":"Needs the `chats.access` permission.","tags":["Chats"],"security":[{"bearer":[]},{"oauth2":["chats.access"]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"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)$"},"group_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)$"},"events":{"maxItems":20,"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"message"},"text":{"type":"string","minLength":1,"maxLength":16384},"custom_id":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"visibility":{"default":"all","type":"string","enum":["all","agents"]},"mentions":{"maxItems":20,"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":["type","text"]},{"type":"object","properties":{"type":{"type":"string","const":"file"},"file_key":{"type":"string","maxLength":512},"name":{"type":"string","maxLength":255},"content_type":{"type":"string","maxLength":127},"size":{"type":"integer","minimum":0,"maximum":9007199254740991},"custom_id":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"visibility":{"default":"all","type":"string","enum":["all","agents"]},"width":{"type":"integer","minimum":0,"maximum":9007199254740991},"height":{"type":"integer","minimum":0,"maximum":9007199254740991},"alternative_text":{"type":"string","maxLength":512}},"required":["type","file_key","name","content_type","size"]},{"type":"object","properties":{"type":{"type":"string","const":"rich_message"},"template":{"type":"string","enum":["cards","quick_replies","sticker"]},"elements":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"title":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"subtitle":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"image_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"buttons":{"maxItems":13,"type":"array","items":{"type":"object","properties":{"text":{"type":"string","maxLength":128},"type":{"type":"string","enum":["message","url","webview","phone","cancel"]},"value":{"type":"string","maxLength":2048},"postback_id":{"type":"string","maxLength":64}},"required":["text","type","value","postback_id"]}}},"required":["title","subtitle","image_url","buttons"]}},"custom_id":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"visibility":{"default":"all","type":"string","enum":["all","agents"]}},"required":["type","template","elements"]},{"type":"object","properties":{"type":{"type":"string","const":"form"},"form_id":{"type":"string"},"form_kind":{"type":"string","enum":["prechat","postchat","ask_for_email","custom"]},"fields":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"type":{"type":"string","enum":["name","email","text","textarea","select","checkbox","radio","rating","phone"]},"label":{"type":"string","maxLength":512},"required":{"type":"boolean"},"options":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":256}}},"required":["id","type","label","required","options"]}},"custom_id":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"visibility":{"default":"all","type":"string","enum":["all","agents"]}},"required":["type","form_id","form_kind","fields"]},{"type":"object","properties":{"type":{"type":"string","const":"filled_form"},"form_id":{"type":"string"},"form_kind":{"type":"string","enum":["prechat","postchat","ask_for_email","custom"]},"answers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"answer":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["id","label","answer"]}},"custom_id":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"visibility":{"default":"all","type":"string","enum":["all","agents"]}},"required":["type","form_id","form_kind","answers"]},{"type":"object","properties":{"type":{"type":"string","const":"custom"},"content":{},"custom_id":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"visibility":{"default":"all","type":"string","enum":["all","agents"]}},"required":["type","content"]}]}},"continuous":{"type":"boolean"}},"required":["customer_id"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"event_ids":{"type":"array","items":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"}}},"required":["chat_id","thread_id","event_ids"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/chats/{chat_id}":{"get":{"summary":"A chat with a page of its latest thread's events (or `thread_id`'s)","description":"Needs the `chats.access` permission.","tags":["Chats"],"security":[{"bearer":[]},{"oauth2":["chats.access"]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"default":100,"type":"integer","minimum":1,"maximum":500}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":2048}},{"name":"thread_id","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"chat":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"organization_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)$"},"channel":{"type":"string","enum":["widget","chat_page","api","email","whatsapp","messenger","instagram","telegram","line","zalo","viber","wechat","kakaotalk","sms","x","discord","slack","teams","apple_messages"]},"status":{"type":"string","enum":["queued","pending","active","inactive","archived"]},"customer_id":{"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"}]},"assignee_id":{"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"}]},"users":{"type":"array","items":{"type":"object","properties":{"id":{"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":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-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":{"type":"string","enum":["agent","customer"]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"avatar_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"present":{"type":"boolean"},"events_seen_up_to":{"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{3}(?:Z))$"},{"type":"null"}]},"visibility":{"type":"string","enum":["all","agents"]}},"required":["id","type","name","avatar_url","present","events_seen_up_to","visibility"],"additionalProperties":false}},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"group_ids":{"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)$"}},"thread":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"active":{"type":"boolean"},"user_ids":{"type":"array","items":{"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":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}]}},"events":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"message"},"text":{"type":"string","minLength":1,"maxLength":16384},"postback":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"thread_id":{"type":"string"},"event_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"type":{"type":"string"},"value":{"type":"string"}},"required":["id","thread_id","event_id","type","value"],"additionalProperties":false},{"type":"null"}]}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","text","postback"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"system"},"subtype":{"type":"string","pattern":"^[a-z_]+(\\.[a-z_]+)+$"},"text":{"type":"string","maxLength":1024},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","subtype","text","details"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"file"},"file_key":{"type":"string","maxLength":512},"name":{"type":"string","maxLength":255},"content_type":{"type":"string","maxLength":127},"size":{"type":"integer","minimum":0,"maximum":9007199254740991},"width":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"height":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"alternative_text":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}]}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","file_key","name","content_type","size","width","height","alternative_text"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"rich_message"},"template":{"type":"string","enum":["cards","quick_replies","sticker"]},"elements":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"title":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"subtitle":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"image_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"buttons":{"maxItems":13,"type":"array","items":{"type":"object","properties":{"text":{"type":"string","maxLength":128},"type":{"type":"string","enum":["message","url","webview","phone","cancel"]},"value":{"type":"string","maxLength":2048},"postback_id":{"type":"string","maxLength":64}},"required":["text","type","value","postback_id"],"additionalProperties":false}}},"required":["title","subtitle","image_url","buttons"],"additionalProperties":false}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","template","elements"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"form"},"form_id":{"type":"string"},"form_kind":{"type":"string","enum":["prechat","postchat","ask_for_email","custom"]},"fields":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"type":{"type":"string","enum":["name","email","text","textarea","select","checkbox","radio","rating","phone"]},"label":{"type":"string","maxLength":512},"required":{"type":"boolean"},"options":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":256}}},"required":["id","type","label","required","options"],"additionalProperties":false}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","form_id","form_kind","fields"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"filled_form"},"form_id":{"type":"string"},"form_kind":{"type":"string","enum":["prechat","postchat","ask_for_email","custom"]},"answers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"answer":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["id","label","answer"],"additionalProperties":false}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","form_id","form_kind","answers"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"custom"},"content":{}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","content"],"additionalProperties":false}]}},"next_cursor":{"default":null,"anyOf":[{"type":"string"},{"type":"null"}]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"group_ids":{"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)$"}},"tags":{"type":"array","items":{"type":"string"}},"queue":{"anyOf":[{"type":"object","properties":{"position":{"type":"integer","minimum":1,"maximum":9007199254740991},"wait_time_s":{"type":"integer","minimum":0,"maximum":9007199254740991},"queued_at":{"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{3}(?:Z))$"}},"required":["position","wait_time_s","queued_at"],"additionalProperties":false},{"type":"null"}]},"rating":{"anyOf":[{"type":"object","properties":{"score":{"anyOf":[{"type":"string","enum":["good","bad"]},{"type":"null"}]},"comment":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"rated_at":{"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{3}(?:Z))$"}},"required":["score","comment","rated_at"],"additionalProperties":false},{"type":"null"}]},"close_reason":{"anyOf":[{"type":"string","enum":["closed_by_agent","closed_by_customer","inactivity","customer_left","customer_banned"]},{"type":"null"}]},"previous_thread_id":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},{"type":"null"}]},"next_thread_id":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},{"type":"null"}]},"created_at":{"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{3}(?:Z))$"},"closed_at":{"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{3}(?:Z))$"},{"type":"null"}]}},"required":["id","chat_id","active","user_ids","events","next_cursor","properties","group_ids","tags","queue","rating","close_reason","previous_thread_id","next_thread_id","created_at","closed_at"],"additionalProperties":false},{"type":"null"}]},"created_at":{"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{3}(?:Z))$"}},"required":["id","organization_id","channel","status","customer_id","assignee_id","users","properties","group_ids","thread","created_at"],"additionalProperties":false}},"required":["chat"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/chats/{chat_id}:{action}":{"post":{"summary":"An agent action on the chat: the realtime action's payload without chat_id, answered with its result","description":"Needs the `chats.access` permission.","tags":["Chats"],"security":[{"bearer":[]},{"oauth2":["chats.access"]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"action","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/threads":{"get":{"summary":"A chat's threads, newest first","description":"Needs the `chats.access` permission.","tags":["Chats"],"security":[{"bearer":[]},{"oauth2":["chats.access"]}],"parameters":[{"name":"chat_id","in":"query","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"}},{"name":"page_token","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"threads":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"active":{"type":"boolean"},"user_ids":{"type":"array","items":{"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":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}]}},"events":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"message"},"text":{"type":"string","minLength":1,"maxLength":16384},"postback":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"thread_id":{"type":"string"},"event_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"type":{"type":"string"},"value":{"type":"string"}},"required":["id","thread_id","event_id","type","value"],"additionalProperties":false},{"type":"null"}]}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","text","postback"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"system"},"subtype":{"type":"string","pattern":"^[a-z_]+(\\.[a-z_]+)+$"},"text":{"type":"string","maxLength":1024},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","subtype","text","details"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"file"},"file_key":{"type":"string","maxLength":512},"name":{"type":"string","maxLength":255},"content_type":{"type":"string","maxLength":127},"size":{"type":"integer","minimum":0,"maximum":9007199254740991},"width":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"height":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"alternative_text":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}]}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","file_key","name","content_type","size","width","height","alternative_text"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"rich_message"},"template":{"type":"string","enum":["cards","quick_replies","sticker"]},"elements":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"title":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"subtitle":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"image_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"buttons":{"maxItems":13,"type":"array","items":{"type":"object","properties":{"text":{"type":"string","maxLength":128},"type":{"type":"string","enum":["message","url","webview","phone","cancel"]},"value":{"type":"string","maxLength":2048},"postback_id":{"type":"string","maxLength":64}},"required":["text","type","value","postback_id"],"additionalProperties":false}}},"required":["title","subtitle","image_url","buttons"],"additionalProperties":false}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","template","elements"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"form"},"form_id":{"type":"string"},"form_kind":{"type":"string","enum":["prechat","postchat","ask_for_email","custom"]},"fields":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"type":{"type":"string","enum":["name","email","text","textarea","select","checkbox","radio","rating","phone"]},"label":{"type":"string","maxLength":512},"required":{"type":"boolean"},"options":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":256}}},"required":["id","type","label","required","options"],"additionalProperties":false}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","form_id","form_kind","fields"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"filled_form"},"form_id":{"type":"string"},"form_kind":{"type":"string","enum":["prechat","postchat","ask_for_email","custom"]},"answers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"answer":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["id","label","answer"],"additionalProperties":false}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","form_id","form_kind","answers"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"custom"},"content":{}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","content"],"additionalProperties":false}]}},"next_cursor":{"default":null,"anyOf":[{"type":"string"},{"type":"null"}]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"group_ids":{"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)$"}},"tags":{"type":"array","items":{"type":"string"}},"queue":{"anyOf":[{"type":"object","properties":{"position":{"type":"integer","minimum":1,"maximum":9007199254740991},"wait_time_s":{"type":"integer","minimum":0,"maximum":9007199254740991},"queued_at":{"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{3}(?:Z))$"}},"required":["position","wait_time_s","queued_at"],"additionalProperties":false},{"type":"null"}]},"rating":{"anyOf":[{"type":"object","properties":{"score":{"anyOf":[{"type":"string","enum":["good","bad"]},{"type":"null"}]},"comment":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"rated_at":{"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{3}(?:Z))$"}},"required":["score","comment","rated_at"],"additionalProperties":false},{"type":"null"}]},"close_reason":{"anyOf":[{"type":"string","enum":["closed_by_agent","closed_by_customer","inactivity","customer_left","customer_banned"]},{"type":"null"}]},"previous_thread_id":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},{"type":"null"}]},"next_thread_id":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},{"type":"null"}]},"created_at":{"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{3}(?:Z))$"},"closed_at":{"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{3}(?:Z))$"},{"type":"null"}]}},"required":["id","chat_id","active","user_ids","events","next_cursor","properties","group_ids","tags","queue","rating","close_reason","previous_thread_id","next_thread_id","created_at","closed_at"],"additionalProperties":false}},"next_page_token":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["threads","next_page_token"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/threads/{thread_id}":{"get":{"summary":"One thread of a chat, with a page of its events","description":"Needs the `chats.access` permission.","tags":["Chats"],"security":[{"bearer":[]},{"oauth2":["chats.access"]}],"parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"default":100,"type":"integer","minimum":1,"maximum":500}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":2048}},{"name":"chat_id","in":"query","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"thread":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"active":{"type":"boolean"},"user_ids":{"type":"array","items":{"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":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}]}},"events":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"message"},"text":{"type":"string","minLength":1,"maxLength":16384},"postback":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"thread_id":{"type":"string"},"event_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"type":{"type":"string"},"value":{"type":"string"}},"required":["id","thread_id","event_id","type","value"],"additionalProperties":false},{"type":"null"}]}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","text","postback"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"system"},"subtype":{"type":"string","pattern":"^[a-z_]+(\\.[a-z_]+)+$"},"text":{"type":"string","maxLength":1024},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","subtype","text","details"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"file"},"file_key":{"type":"string","maxLength":512},"name":{"type":"string","maxLength":255},"content_type":{"type":"string","maxLength":127},"size":{"type":"integer","minimum":0,"maximum":9007199254740991},"width":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"height":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"alternative_text":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}]}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","file_key","name","content_type","size","width","height","alternative_text"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"rich_message"},"template":{"type":"string","enum":["cards","quick_replies","sticker"]},"elements":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"title":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"subtitle":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"image_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"buttons":{"maxItems":13,"type":"array","items":{"type":"object","properties":{"text":{"type":"string","maxLength":128},"type":{"type":"string","enum":["message","url","webview","phone","cancel"]},"value":{"type":"string","maxLength":2048},"postback_id":{"type":"string","maxLength":64}},"required":["text","type","value","postback_id"],"additionalProperties":false}}},"required":["title","subtitle","image_url","buttons"],"additionalProperties":false}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","template","elements"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"form"},"form_id":{"type":"string"},"form_kind":{"type":"string","enum":["prechat","postchat","ask_for_email","custom"]},"fields":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"type":{"type":"string","enum":["name","email","text","textarea","select","checkbox","radio","rating","phone"]},"label":{"type":"string","maxLength":512},"required":{"type":"boolean"},"options":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":256}}},"required":["id","type","label","required","options"],"additionalProperties":false}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","form_id","form_kind","fields"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"filled_form"},"form_id":{"type":"string"},"form_kind":{"type":"string","enum":["prechat","postchat","ask_for_email","custom"]},"answers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"answer":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["id","label","answer"],"additionalProperties":false}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","form_id","form_kind","answers"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"custom"},"content":{}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","content"],"additionalProperties":false}]}},"next_cursor":{"default":null,"anyOf":[{"type":"string"},{"type":"null"}]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"group_ids":{"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)$"}},"tags":{"type":"array","items":{"type":"string"}},"queue":{"anyOf":[{"type":"object","properties":{"position":{"type":"integer","minimum":1,"maximum":9007199254740991},"wait_time_s":{"type":"integer","minimum":0,"maximum":9007199254740991},"queued_at":{"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{3}(?:Z))$"}},"required":["position","wait_time_s","queued_at"],"additionalProperties":false},{"type":"null"}]},"rating":{"anyOf":[{"type":"object","properties":{"score":{"anyOf":[{"type":"string","enum":["good","bad"]},{"type":"null"}]},"comment":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"rated_at":{"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{3}(?:Z))$"}},"required":["score","comment","rated_at"],"additionalProperties":false},{"type":"null"}]},"close_reason":{"anyOf":[{"type":"string","enum":["closed_by_agent","closed_by_customer","inactivity","customer_left","customer_banned"]},{"type":"null"}]},"previous_thread_id":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},{"type":"null"}]},"next_thread_id":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},{"type":"null"}]},"created_at":{"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{3}(?:Z))$"},"closed_at":{"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{3}(?:Z))$"},{"type":"null"}]}},"required":["id","chat_id","active","user_ids","events","next_cursor","properties","group_ids","tags","queue","rating","close_reason","previous_thread_id","next_thread_id","created_at","closed_at"],"additionalProperties":false}},"required":["thread"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/routing/statuses":{"get":{"summary":"Who takes chats now and how loaded they are","description":"Needs the `team.read` permission.","tags":["Routing"],"security":[{"bearer":[]},{"oauth2":["team.read"]}],"parameters":[{"name":"group_ids","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"statuses":{"type":"array","items":{"type":"object","properties":{"agent_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":["accepting_chats","not_accepting_chats","offline"]},"connected":{"type":"boolean"},"active_chats":{"type":"integer","minimum":0,"maximum":9007199254740991},"max_chats":{"type":"integer","minimum":0,"maximum":9007199254740991},"group_ids":{"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":["agent_id","status","connected","active_chats","max_chats","group_ids"],"additionalProperties":false}}},"required":["statuses"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/routing/statuses/{agent_id}":{"put":{"summary":"Set an agent's routing status; another agent's needs team.manage","description":"Needs the `chats.access` permission.","tags":["Routing"],"security":[{"bearer":[]},{"oauth2":["chats.access"]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["accepting_chats","not_accepting_chats","offline"]}},"required":["status"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/routing/queue":{"get":{"summary":"Chats waiting for an agent","description":"Needs the `chats.access` permission.","tags":["Routing"],"security":[{"bearer":[]},{"oauth2":["chats.access"]}],"parameters":[{"name":"group_ids","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"chats":{"type":"array","items":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"group_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":["queued","pending"]},"position":{"type":"integer","minimum":1,"maximum":9007199254740991},"wait_time_s":{"type":"integer","minimum":0,"maximum":9007199254740991},"queued_at":{"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{3}(?:Z))$"}},"required":["chat_id","thread_id","group_id","status","position","wait_time_s","queued_at"],"additionalProperties":false}}},"required":["chats"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/routing/config:sync":{"post":{"summary":"Reload routing's view of agents, groups and rules now","description":"Needs the `team.manage` permission.","tags":["Routing"],"security":[{"bearer":[]},{"oauth2":["team.manage"]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/tickets":{"get":{"summary":"List tickets, newest-updated first","description":"Needs the `chats.access` permission.","tags":["Tickets"],"security":[{"bearer":[]},{"oauth2":["chats.access"]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"name":"page_token","in":"query","required":false,"schema":{"type":"string","maxLength":2048}},{"name":"status","in":"query","required":false,"schema":{"type":"string"}},{"name":"priority","in":"query","required":false,"schema":{"type":"string","enum":["low","normal","high","urgent"]}},{"name":"assignee_agent_id","in":"query","required":false,"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":"unassigned","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}},{"name":"group_id","in":"query","required":false,"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":"chat_id","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}}],"responses":{"200":{"description":"OK","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)$"},"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"status":{"type":"string","enum":["open","pending","solved","spam"]},"subject":{"type":"string","maxLength":255},"assignee_agent_id":{"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"}]},"group_id":{"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"}]},"requester_customer_id":{"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"}]},"priority":{"type":"string","enum":["low","normal","high","urgent"]},"created_at":{"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{3}(?:Z))$"},"updated_at":{"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{3}(?:Z))$"},"solved_at":{"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{3}(?:Z))$"},{"type":"null"}]}},"required":["id","chat_id","status","subject","assignee_agent_id","group_id","requester_customer_id","priority","created_at","updated_at","solved_at"],"additionalProperties":false}},"next_page_token":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["items","next_page_token"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"post":{"summary":"Open a ticket on a chat","description":"Needs the `chats.access` permission.","tags":["Tickets"],"security":[{"bearer":[]},{"oauth2":["chats.access"]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"subject":{"default":"","type":"string","maxLength":255},"priority":{"default":"normal","type":"string","enum":["low","normal","high","urgent"]},"assignee_agent_id":{"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"}]},"group_id":{"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"}]}},"required":["chat_id"]}}}},"responses":{"201":{"description":"Created","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)$"},"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"status":{"type":"string","enum":["open","pending","solved","spam"]},"subject":{"type":"string","maxLength":255},"assignee_agent_id":{"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"}]},"group_id":{"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"}]},"requester_customer_id":{"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"}]},"priority":{"type":"string","enum":["low","normal","high","urgent"]},"created_at":{"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{3}(?:Z))$"},"updated_at":{"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{3}(?:Z))$"},"solved_at":{"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{3}(?:Z))$"},{"type":"null"}]}},"required":["id","chat_id","status","subject","assignee_agent_id","group_id","requester_customer_id","priority","created_at","updated_at","solved_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/tickets/{ticket_id}":{"get":{"summary":"One ticket","description":"Needs the `chats.access` permission.","tags":["Tickets"],"security":[{"bearer":[]},{"oauth2":["chats.access"]}],"parameters":[{"name":"ticket_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","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)$"},"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"status":{"type":"string","enum":["open","pending","solved","spam"]},"subject":{"type":"string","maxLength":255},"assignee_agent_id":{"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"}]},"group_id":{"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"}]},"requester_customer_id":{"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"}]},"priority":{"type":"string","enum":["low","normal","high","urgent"]},"created_at":{"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{3}(?:Z))$"},"updated_at":{"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{3}(?:Z))$"},"solved_at":{"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{3}(?:Z))$"},{"type":"null"}]}},"required":["id","chat_id","status","subject","assignee_agent_id","group_id","requester_customer_id","priority","created_at","updated_at","solved_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"patch":{"summary":"Change a ticket's status, subject, priority, assignee or group","description":"Needs the `chats.access` permission.","tags":["Tickets"],"security":[{"bearer":[]},{"oauth2":["chats.access"]}],"parameters":[{"name":"ticket_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["open","pending","solved","spam"]},"subject":{"type":"string","maxLength":255},"priority":{"type":"string","enum":["low","normal","high","urgent"]},"assignee_agent_id":{"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"}]},"group_id":{"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"}]}}}}}},"responses":{"200":{"description":"OK","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)$"},"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"status":{"type":"string","enum":["open","pending","solved","spam"]},"subject":{"type":"string","maxLength":255},"assignee_agent_id":{"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"}]},"group_id":{"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"}]},"requester_customer_id":{"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"}]},"priority":{"type":"string","enum":["low","normal","high","urgent"]},"created_at":{"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{3}(?:Z))$"},"updated_at":{"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{3}(?:Z))$"},"solved_at":{"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{3}(?:Z))$"},{"type":"null"}]}},"required":["id","chat_id","status","subject","assignee_agent_id","group_id","requester_customer_id","priority","created_at","updated_at","solved_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/tickets/{ticket_id}:reply":{"post":{"summary":"Reply to the requester in the ticket's chat; a closed chat is reopened with the reply","description":"Needs the `chats.access` permission.","tags":["Tickets"],"security":[{"bearer":[]},{"oauth2":["chats.access"]}],"parameters":[{"name":"ticket_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":16384}},"required":["text"]}}}},"responses":{"200":{"description":"OK","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)$"},"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"status":{"type":"string","enum":["open","pending","solved","spam"]},"subject":{"type":"string","maxLength":255},"assignee_agent_id":{"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"}]},"group_id":{"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"}]},"requester_customer_id":{"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"}]},"priority":{"type":"string","enum":["low","normal","high","urgent"]},"created_at":{"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{3}(?:Z))$"},"updated_at":{"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{3}(?:Z))$"},"solved_at":{"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{3}(?:Z))$"},{"type":"null"}]}},"required":["id","chat_id","status","subject","assignee_agent_id","group_id","requester_customer_id","priority","created_at","updated_at","solved_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/tickets/{ticket_id}:note":{"post":{"summary":"Add an agents-only note to the ticket's chat","description":"Needs the `chats.access` permission.","tags":["Tickets"],"security":[{"bearer":[]},{"oauth2":["chats.access"]}],"parameters":[{"name":"ticket_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":1024}},"required":["text"]}}}},"responses":{"200":{"description":"OK","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)$"},"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"status":{"type":"string","enum":["open","pending","solved","spam"]},"subject":{"type":"string","maxLength":255},"assignee_agent_id":{"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"}]},"group_id":{"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"}]},"requester_customer_id":{"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"}]},"priority":{"type":"string","enum":["low","normal","high","urgent"]},"created_at":{"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{3}(?:Z))$"},"updated_at":{"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{3}(?:Z))$"},"solved_at":{"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{3}(?:Z))$"},{"type":"null"}]}},"required":["id","chat_id","status","subject","assignee_agent_id","group_id","requester_customer_id","priority","created_at","updated_at","solved_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/reports/views":{"get":{"summary":"List your saved report views","description":"Needs the `reports.read` permission.","tags":["Reports"],"security":[{"bearer":[]},{"oauth2":["reports.read"]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"report":{"type":"string","enum":["summary","dashboard","total-chats","chat-engagement","missed-chats","campaigns","tags-usage","chat-ratings","availability","chat-forms","chat-duration","agent-performance","response-times","staffing-prediction","activity","queued-customers","queue-abandonment","goals","sales","chat-topics","transfers","channels","chat-to-ticket","satisfaction-comments","reviews","sentiment","unique-visitors"]},"filters":{"type":"object","properties":{"range":{"default":"last_7_days","type":"string","enum":["today","yesterday","last_7_days","last_30_days","this_month","last_month","custom"]},"from":{"type":"string","format":"date","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])))$"},"to":{"type":"string","format":"date","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])))$"},"granularity":{"type":"string","enum":["hour","day","week","month","hour_of_day"]},"agent_ids":{"maxItems":100,"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)$"}},"group_ids":{"maxItems":100,"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)$"}},"tags":{"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}},"channels":{"maxItems":100,"type":"array","items":{"type":"string","enum":["widget","chat_page","api","email","whatsapp","messenger","instagram","telegram","line","zalo","viber","wechat","kakaotalk","sms","x","discord","slack","teams","apple_messages"]}}},"required":["range"],"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)$"},"created_at":{"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{3}(?:Z))$"},"updated_at":{"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{3}(?:Z))$"}},"required":["name","report","filters","id","created_at","updated_at"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"post":{"summary":"Save a report view","description":"Needs the `reports.read` permission.","tags":["Reports"],"security":[{"bearer":[]},{"oauth2":["reports.read"]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"report":{"type":"string","enum":["summary","dashboard","total-chats","chat-engagement","missed-chats","campaigns","tags-usage","chat-ratings","availability","chat-forms","chat-duration","agent-performance","response-times","staffing-prediction","activity","queued-customers","queue-abandonment","goals","sales","chat-topics","transfers","channels","chat-to-ticket","satisfaction-comments","reviews","sentiment","unique-visitors"]},"filters":{"type":"object","properties":{"range":{"default":"last_7_days","type":"string","enum":["today","yesterday","last_7_days","last_30_days","this_month","last_month","custom"]},"from":{"type":"string","format":"date","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])))$"},"to":{"type":"string","format":"date","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])))$"},"granularity":{"type":"string","enum":["hour","day","week","month","hour_of_day"]},"agent_ids":{"maxItems":100,"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)$"}},"group_ids":{"maxItems":100,"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)$"}},"tags":{"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}},"channels":{"maxItems":100,"type":"array","items":{"type":"string","enum":["widget","chat_page","api","email","whatsapp","messenger","instagram","telegram","line","zalo","viber","wechat","kakaotalk","sms","x","discord","slack","teams","apple_messages"]}}}}},"required":["name","report","filters"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"report":{"type":"string","enum":["summary","dashboard","total-chats","chat-engagement","missed-chats","campaigns","tags-usage","chat-ratings","availability","chat-forms","chat-duration","agent-performance","response-times","staffing-prediction","activity","queued-customers","queue-abandonment","goals","sales","chat-topics","transfers","channels","chat-to-ticket","satisfaction-comments","reviews","sentiment","unique-visitors"]},"filters":{"type":"object","properties":{"range":{"default":"last_7_days","type":"string","enum":["today","yesterday","last_7_days","last_30_days","this_month","last_month","custom"]},"from":{"type":"string","format":"date","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])))$"},"to":{"type":"string","format":"date","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])))$"},"granularity":{"type":"string","enum":["hour","day","week","month","hour_of_day"]},"agent_ids":{"maxItems":100,"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)$"}},"group_ids":{"maxItems":100,"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)$"}},"tags":{"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}},"channels":{"maxItems":100,"type":"array","items":{"type":"string","enum":["widget","chat_page","api","email","whatsapp","messenger","instagram","telegram","line","zalo","viber","wechat","kakaotalk","sms","x","discord","slack","teams","apple_messages"]}}},"required":["range"],"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)$"},"created_at":{"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{3}(?:Z))$"},"updated_at":{"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{3}(?:Z))$"}},"required":["name","report","filters","id","created_at","updated_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/reports/views/{id}":{"patch":{"summary":"Rename or change a saved view","description":"Needs the `reports.read` permission.","tags":["Reports"],"security":[{"bearer":[]},{"oauth2":["reports.read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"report":{"type":"string","enum":["summary","dashboard","total-chats","chat-engagement","missed-chats","campaigns","tags-usage","chat-ratings","availability","chat-forms","chat-duration","agent-performance","response-times","staffing-prediction","activity","queued-customers","queue-abandonment","goals","sales","chat-topics","transfers","channels","chat-to-ticket","satisfaction-comments","reviews","sentiment","unique-visitors"]},"filters":{"type":"object","properties":{"range":{"default":"last_7_days","type":"string","enum":["today","yesterday","last_7_days","last_30_days","this_month","last_month","custom"]},"from":{"type":"string","format":"date","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])))$"},"to":{"type":"string","format":"date","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])))$"},"granularity":{"type":"string","enum":["hour","day","week","month","hour_of_day"]},"agent_ids":{"maxItems":100,"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)$"}},"group_ids":{"maxItems":100,"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)$"}},"tags":{"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}},"channels":{"maxItems":100,"type":"array","items":{"type":"string","enum":["widget","chat_page","api","email","whatsapp","messenger","instagram","telegram","line","zalo","viber","wechat","kakaotalk","sms","x","discord","slack","teams","apple_messages"]}}}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"report":{"type":"string","enum":["summary","dashboard","total-chats","chat-engagement","missed-chats","campaigns","tags-usage","chat-ratings","availability","chat-forms","chat-duration","agent-performance","response-times","staffing-prediction","activity","queued-customers","queue-abandonment","goals","sales","chat-topics","transfers","channels","chat-to-ticket","satisfaction-comments","reviews","sentiment","unique-visitors"]},"filters":{"type":"object","properties":{"range":{"default":"last_7_days","type":"string","enum":["today","yesterday","last_7_days","last_30_days","this_month","last_month","custom"]},"from":{"type":"string","format":"date","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])))$"},"to":{"type":"string","format":"date","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])))$"},"granularity":{"type":"string","enum":["hour","day","week","month","hour_of_day"]},"agent_ids":{"maxItems":100,"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)$"}},"group_ids":{"maxItems":100,"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)$"}},"tags":{"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}},"channels":{"maxItems":100,"type":"array","items":{"type":"string","enum":["widget","chat_page","api","email","whatsapp","messenger","instagram","telegram","line","zalo","viber","wechat","kakaotalk","sms","x","discord","slack","teams","apple_messages"]}}},"required":["range"],"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)$"},"created_at":{"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{3}(?:Z))$"},"updated_at":{"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{3}(?:Z))$"}},"required":["name","report","filters","id","created_at","updated_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"delete":{"summary":"Delete a saved view","description":"Needs the `reports.read` permission.","tags":["Reports"],"security":[{"bearer":[]},{"oauth2":["reports.read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done."},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/reports/schedules":{"get":{"summary":"List scheduled report emails","description":"Needs the `reports.read` permission.","tags":["Reports"],"security":[{"bearer":[]},{"oauth2":["reports.read"]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"report":{"type":"string","enum":["summary","dashboard","total-chats","chat-engagement","missed-chats","campaigns","tags-usage","chat-ratings","availability","chat-forms","chat-duration","agent-performance","response-times","staffing-prediction","activity","queued-customers","queue-abandonment","goals","sales","chat-topics","transfers","channels","chat-to-ticket","satisfaction-comments","reviews","sentiment","unique-visitors"]},"frequency":{"type":"string","enum":["daily","weekly","monthly"]},"timezone":{"type":"string","minLength":1,"maxLength":64},"send_hour":{"default":8,"type":"integer","minimum":0,"maximum":23},"weekday":{"default":null,"anyOf":[{"type":"integer","minimum":1,"maximum":7},{"type":"null"}]},"filters":{"default":{},"type":"object","properties":{"agent_ids":{"maxItems":100,"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)$"}},"group_ids":{"maxItems":100,"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)$"}},"tags":{"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}},"channels":{"maxItems":100,"type":"array","items":{"type":"string","enum":["widget","chat_page","api","email","whatsapp","messenger","instagram","telegram","line","zalo","viber","wechat","kakaotalk","sms","x","discord","slack","teams","apple_messages"]}}},"additionalProperties":false},"recipient_agent_ids":{"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)$"}},"enabled":{"default":true,"type":"boolean"},"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)$"},"next_run_at":{"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{3}(?:Z))$"},"last_run_at":{"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{3}(?:Z))$"},{"type":"null"}]},"last_status":{"anyOf":[{"type":"string","enum":["sent","failed"]},{"type":"null"}]},"created_at":{"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{3}(?:Z))$"},"updated_at":{"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{3}(?:Z))$"}},"required":["name","report","frequency","timezone","send_hour","weekday","filters","recipient_agent_ids","enabled","id","next_run_at","last_run_at","last_status","created_at","updated_at"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"post":{"summary":"Schedule a report email","description":"Needs the `settings.manage` permission.","tags":["Reports"],"security":[{"bearer":[]},{"oauth2":["settings.manage"]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"report":{"type":"string","enum":["summary","dashboard","total-chats","chat-engagement","missed-chats","campaigns","tags-usage","chat-ratings","availability","chat-forms","chat-duration","agent-performance","response-times","staffing-prediction","activity","queued-customers","queue-abandonment","goals","sales","chat-topics","transfers","channels","chat-to-ticket","satisfaction-comments","reviews","sentiment","unique-visitors"]},"frequency":{"type":"string","enum":["daily","weekly","monthly"]},"timezone":{"type":"string","minLength":1,"maxLength":64},"send_hour":{"default":8,"type":"integer","minimum":0,"maximum":23},"weekday":{"default":null,"anyOf":[{"type":"integer","minimum":1,"maximum":7},{"type":"null"}]},"filters":{"default":{},"type":"object","properties":{"agent_ids":{"maxItems":100,"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)$"}},"group_ids":{"maxItems":100,"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)$"}},"tags":{"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}},"channels":{"maxItems":100,"type":"array","items":{"type":"string","enum":["widget","chat_page","api","email","whatsapp","messenger","instagram","telegram","line","zalo","viber","wechat","kakaotalk","sms","x","discord","slack","teams","apple_messages"]}}}},"recipient_agent_ids":{"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)$"}},"enabled":{"default":true,"type":"boolean"}},"required":["name","report","frequency","timezone","recipient_agent_ids"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"report":{"type":"string","enum":["summary","dashboard","total-chats","chat-engagement","missed-chats","campaigns","tags-usage","chat-ratings","availability","chat-forms","chat-duration","agent-performance","response-times","staffing-prediction","activity","queued-customers","queue-abandonment","goals","sales","chat-topics","transfers","channels","chat-to-ticket","satisfaction-comments","reviews","sentiment","unique-visitors"]},"frequency":{"type":"string","enum":["daily","weekly","monthly"]},"timezone":{"type":"string","minLength":1,"maxLength":64},"send_hour":{"default":8,"type":"integer","minimum":0,"maximum":23},"weekday":{"default":null,"anyOf":[{"type":"integer","minimum":1,"maximum":7},{"type":"null"}]},"filters":{"default":{},"type":"object","properties":{"agent_ids":{"maxItems":100,"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)$"}},"group_ids":{"maxItems":100,"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)$"}},"tags":{"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}},"channels":{"maxItems":100,"type":"array","items":{"type":"string","enum":["widget","chat_page","api","email","whatsapp","messenger","instagram","telegram","line","zalo","viber","wechat","kakaotalk","sms","x","discord","slack","teams","apple_messages"]}}},"additionalProperties":false},"recipient_agent_ids":{"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)$"}},"enabled":{"default":true,"type":"boolean"},"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)$"},"next_run_at":{"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{3}(?:Z))$"},"last_run_at":{"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{3}(?:Z))$"},{"type":"null"}]},"last_status":{"anyOf":[{"type":"string","enum":["sent","failed"]},{"type":"null"}]},"created_at":{"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{3}(?:Z))$"},"updated_at":{"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{3}(?:Z))$"}},"required":["name","report","frequency","timezone","send_hour","weekday","filters","recipient_agent_ids","enabled","id","next_run_at","last_run_at","last_status","created_at","updated_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/reports/schedules/{id}":{"patch":{"summary":"Change a scheduled report email","description":"Needs the `settings.manage` permission.","tags":["Reports"],"security":[{"bearer":[]},{"oauth2":["settings.manage"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"report":{"type":"string","enum":["summary","dashboard","total-chats","chat-engagement","missed-chats","campaigns","tags-usage","chat-ratings","availability","chat-forms","chat-duration","agent-performance","response-times","staffing-prediction","activity","queued-customers","queue-abandonment","goals","sales","chat-topics","transfers","channels","chat-to-ticket","satisfaction-comments","reviews","sentiment","unique-visitors"]},"frequency":{"type":"string","enum":["daily","weekly","monthly"]},"timezone":{"type":"string","minLength":1,"maxLength":64},"send_hour":{"type":"integer","minimum":0,"maximum":23},"weekday":{"anyOf":[{"type":"integer","minimum":1,"maximum":7},{"type":"null"}]},"filters":{"type":"object","properties":{"agent_ids":{"maxItems":100,"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)$"}},"group_ids":{"maxItems":100,"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)$"}},"tags":{"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}},"channels":{"maxItems":100,"type":"array","items":{"type":"string","enum":["widget","chat_page","api","email","whatsapp","messenger","instagram","telegram","line","zalo","viber","wechat","kakaotalk","sms","x","discord","slack","teams","apple_messages"]}}}},"recipient_agent_ids":{"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)$"}},"enabled":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"report":{"type":"string","enum":["summary","dashboard","total-chats","chat-engagement","missed-chats","campaigns","tags-usage","chat-ratings","availability","chat-forms","chat-duration","agent-performance","response-times","staffing-prediction","activity","queued-customers","queue-abandonment","goals","sales","chat-topics","transfers","channels","chat-to-ticket","satisfaction-comments","reviews","sentiment","unique-visitors"]},"frequency":{"type":"string","enum":["daily","weekly","monthly"]},"timezone":{"type":"string","minLength":1,"maxLength":64},"send_hour":{"default":8,"type":"integer","minimum":0,"maximum":23},"weekday":{"default":null,"anyOf":[{"type":"integer","minimum":1,"maximum":7},{"type":"null"}]},"filters":{"default":{},"type":"object","properties":{"agent_ids":{"maxItems":100,"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)$"}},"group_ids":{"maxItems":100,"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)$"}},"tags":{"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}},"channels":{"maxItems":100,"type":"array","items":{"type":"string","enum":["widget","chat_page","api","email","whatsapp","messenger","instagram","telegram","line","zalo","viber","wechat","kakaotalk","sms","x","discord","slack","teams","apple_messages"]}}},"additionalProperties":false},"recipient_agent_ids":{"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)$"}},"enabled":{"default":true,"type":"boolean"},"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)$"},"next_run_at":{"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{3}(?:Z))$"},"last_run_at":{"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{3}(?:Z))$"},{"type":"null"}]},"last_status":{"anyOf":[{"type":"string","enum":["sent","failed"]},{"type":"null"}]},"created_at":{"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{3}(?:Z))$"},"updated_at":{"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{3}(?:Z))$"}},"required":["name","report","frequency","timezone","send_hour","weekday","filters","recipient_agent_ids","enabled","id","next_run_at","last_run_at","last_status","created_at","updated_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"delete":{"summary":"Delete a scheduled report email","description":"Needs the `settings.manage` permission.","tags":["Reports"],"security":[{"bearer":[]},{"oauth2":["settings.manage"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done."},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/reports/{report}":{"get":{"summary":"Run a report: summary, dashboard, total-chats, chat-engagement, missed-chats, campaigns, tags-usage, chat-ratings, availability, chat-forms, chat-duration, agent-performance, response-times, staffing-prediction, activity, queued-customers, queue-abandonment, goals, sales, chat-topics, transfers, channels, chat-to-ticket, satisfaction-comments, reviews, sentiment, unique-visitors. format=csv downloads it.","description":"Needs the `reports.read` permission.","tags":["Reports"],"security":[{"bearer":[]},{"oauth2":["reports.read"]}],"parameters":[{"name":"report","in":"path","required":true,"schema":{"type":"string"}},{"name":"from","in":"query","required":true,"schema":{"type":"string","format":"date","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])))$"}},{"name":"to","in":"query","required":true,"schema":{"type":"string","format":"date","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])))$"}},{"name":"timezone","in":"query","required":false,"schema":{"default":"UTC","type":"string","minLength":1,"maxLength":64}},{"name":"granularity","in":"query","required":false,"schema":{"default":"day","type":"string","enum":["hour","day","week","month","hour_of_day"]}},{"name":"compare_from","in":"query","required":false,"schema":{"type":"string","format":"date","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])))$"}},{"name":"compare_to","in":"query","required":false,"schema":{"type":"string","format":"date","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])))$"}},{"name":"agent_ids","in":"query","required":false,"schema":{"maxItems":100,"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)$"}}},{"name":"group_ids","in":"query","required":false,"schema":{"maxItems":100,"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)$"}}},{"name":"tags","in":"query","required":false,"schema":{"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}}},{"name":"channels","in":"query","required":false,"schema":{"maxItems":100,"type":"array","items":{"type":"string","enum":["widget","chat_page","api","email","whatsapp","messenger","instagram","telegram","line","zalo","viber","wechat","kakaotalk","sms","x","discord","slack","teams","apple_messages"]}}},{"name":"page","in":"query","required":false,"schema":{"default":1,"type":"integer","minimum":1,"maximum":10000}},{"name":"chats_per_agent","in":"query","required":false,"schema":{"default":3,"type":"integer","minimum":1,"maximum":100}},{"name":"format","in":"query","required":false,"schema":{"default":"json","type":"string","enum":["json","csv"]}},{"name":"part","in":"query","required":false,"schema":{"default":"series","type":"string","enum":["series","breakdown","heatmap"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"report":{"type":"string","enum":["summary","dashboard","total-chats","chat-engagement","missed-chats","campaigns","tags-usage","chat-ratings","availability","chat-forms","chat-duration","agent-performance","response-times","staffing-prediction","activity","queued-customers","queue-abandonment","goals","sales","chat-topics","transfers","channels","chat-to-ticket","satisfaction-comments","reviews","sentiment","unique-visitors"]},"generated_at":{"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{3}(?:Z))$"},"from":{"type":"string","format":"date","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])))$"},"to":{"type":"string","format":"date","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])))$"},"timezone":{"type":"string"},"granularity":{"type":"string","enum":["hour","day","week","month","hour_of_day"]},"summary":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"unit":{"type":"string","enum":["count","percent","seconds","hours","currency","text","id","score"]},"value":{"anyOf":[{"type":"number"},{"type":"null"}]},"currency":{"type":"string"}},"required":["key","unit","value"],"additionalProperties":false}},"series":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"unit":{"type":"string","enum":["count","percent","seconds","hours","currency","text","id","score"]},"points":{"type":"array","items":{"type":"object","properties":{"bucket":{"type":"string"},"value":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["bucket","value"],"additionalProperties":false}}},"required":["key","unit","points"],"additionalProperties":false}},"breakdown":{"anyOf":[{"type":"object","properties":{"columns":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"unit":{"type":"string","enum":["count","percent","seconds","hours","currency","text","id","score"]}},"required":["key","unit"],"additionalProperties":false}},"rows":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"null"}]}}},"next_page":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["columns","rows","next_page"],"additionalProperties":false},{"type":"null"}]},"heatmap":{"anyOf":[{"type":"object","properties":{"cells":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string"},"hour":{"type":"integer","minimum":0,"maximum":23},"value":{"type":"number"}},"required":["day","hour","value"],"additionalProperties":false}}},"required":["cells"],"additionalProperties":false},{"type":"null"}]},"compare":{"anyOf":[{"type":"object","properties":{"from":{"type":"string","format":"date","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])))$"},"to":{"type":"string","format":"date","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])))$"},"summary":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"unit":{"type":"string","enum":["count","percent","seconds","hours","currency","text","id","score"]},"value":{"anyOf":[{"type":"number"},{"type":"null"}]},"currency":{"type":"string"}},"required":["key","unit","value"],"additionalProperties":false}},"series":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"unit":{"type":"string","enum":["count","percent","seconds","hours","currency","text","id","score"]},"points":{"type":"array","items":{"type":"object","properties":{"bucket":{"type":"string"},"value":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["bucket","value"],"additionalProperties":false}}},"required":["key","unit","points"],"additionalProperties":false}}},"required":["from","to","summary","series"],"additionalProperties":false},{"type":"null"}]},"notice":{"anyOf":[{"type":"string","enum":["needs_ai_model","no_greetings","no_goals","no_sales"]},{"type":"null"}]}},"required":["report","generated_at","from","to","timezone","granularity","summary","series","breakdown","heatmap","compare","notice"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/customer-token":{"post":{"summary":"Mint a customer token for the widget (visitor id, tenant identity token, or an email resume link)","description":"No token.","tags":["Customer identity"],"security":[],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"license_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"visitor_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{22,64}$"},"identity_token":{"type":"string","maxLength":4096},"resume":{"type":"string","maxLength":2048}},"required":["license_id","visitor_id"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"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)$"},"visitor_id":{"type":"string","minLength":8,"maxLength":64},"organization_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)$"},"region":{"type":"string","enum":["apac","eu","us"]},"expires_in":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"external_user_id":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}]}},"required":["token","customer_id","visitor_id","organization_id","region","expires_in","external_user_id"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/customer-token/keys":{"get":{"summary":"List the public keys that verify tenant identity tokens","description":"Needs the `settings.manage` permission.","tags":["Customer identity"],"security":[{"bearer":[]},{"oauth2":["settings.manage"]}],"parameters":[],"responses":{"200":{"description":"OK","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)$"},"name":{"type":"string","minLength":1,"maxLength":120},"alg":{"type":"string","enum":["ES256","RS256"]},"public_jwk":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"created_at":{"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{3}(?:Z))$"},"last_used_at":{"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{3}(?:Z))$"},{"type":"null"}]}},"required":["id","name","alg","public_jwk","created_at","last_used_at"],"additionalProperties":false}},"next_page_token":{"type":"null"}},"required":["items","next_page_token"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"post":{"summary":"Add a public key (ES256 or RS256 JWK) for tenant identity tokens","description":"Needs the `settings.manage` permission.","tags":["Customer identity"],"security":[{"bearer":[]},{"oauth2":["settings.manage"]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"alg":{"type":"string","enum":["ES256","RS256"]},"public_jwk":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["name","alg","public_jwk"]}}}},"responses":{"201":{"description":"Created","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)$"},"name":{"type":"string","minLength":1,"maxLength":120},"alg":{"type":"string","enum":["ES256","RS256"]},"public_jwk":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"created_at":{"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{3}(?:Z))$"},"last_used_at":{"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{3}(?:Z))$"},{"type":"null"}]}},"required":["id","name","alg","public_jwk","created_at","last_used_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/customer-token/keys/{id}":{"delete":{"summary":"Remove an identity key","description":"Needs the `settings.manage` permission.","tags":["Customer identity"],"security":[{"bearer":[]},{"oauth2":["settings.manage"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done."},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/traffic":{"get":{"summary":"Visitors on the website now, with segment counts","description":"Needs the `traffic.read` permission.","tags":["Traffic"],"security":[{"bearer":[]},{"oauth2":["traffic.read"]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"name":"page_token","in":"query","required":false,"schema":{"type":"string","maxLength":2048}},{"name":"segment","in":"query","required":false,"schema":{"default":"all","type":"string","enum":["all","chatting","supervised","queued","waiting_for_reply","invited","browsing"]}},{"name":"filter","in":"query","required":false,"schema":{"type":"string","maxLength":8192}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","maxLength":256}},{"name":"group_id","in":"query","required":false,"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":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"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)$"},"visitor_id":{"type":"string","minLength":8,"maxLength":64},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"ip":{"anyOf":[{"type":"string"},{"type":"null"}]},"state":{"type":"string","enum":["browsing","invited","queued","chatting","waiting_for_reply","supervised"]},"chat_id":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},{"type":"null"}]},"thread_id":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},{"type":"null"}]},"agents":{"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)$"},"name":{"type":"string","minLength":1,"maxLength":120},"avatar_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]}},"required":["id","name","avatar_url"],"additionalProperties":false}},"group_id":{"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"}]},"url":{"type":"string"},"title":{"type":"string"},"landing_url":{"type":"string"},"referrer":{"anyOf":[{"type":"string"},{"type":"null"}]},"utm":{"anyOf":[{"type":"object","properties":{"source":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"medium":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"campaign":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"term":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"content":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]}},"required":["source","medium","campaign","term","content"],"additionalProperties":false},{"type":"null"}]},"country":{"anyOf":[{"type":"string"},{"type":"null"}]},"region":{"anyOf":[{"type":"string"},{"type":"null"}]},"city":{"anyOf":[{"type":"string"},{"type":"null"}]},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}]},"device":{"type":"string","enum":["desktop","mobile","tablet","other"]},"browser":{"anyOf":[{"type":"string"},{"type":"null"}]},"os":{"anyOf":[{"type":"string"},{"type":"null"}]},"language":{"anyOf":[{"type":"string"},{"type":"null"}]},"first_seen_at":{"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{3}(?:Z))$"},"visit_started_at":{"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{3}(?:Z))$"},"page_opened_at":{"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{3}(?:Z))$"},"last_seen_at":{"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{3}(?:Z))$"},"visits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"pageviews":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"chats":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"returning":{"type":"boolean"},"greetings":{"type":"object","properties":{"sent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"accepted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"ignored":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["sent","accepted","ignored"],"additionalProperties":false},"last_greeting":{"anyOf":[{"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)$"},"name":{"type":"string"},"at":{"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{3}(?:Z))$"}},"required":["id","name","at"],"additionalProperties":false},{"type":"null"}]},"session_fields":{"maxItems":50,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","minLength":1,"maxLength":64},{"type":"string","maxLength":512}]}},"cart":{"anyOf":[{"type":"object","properties":{"value_cents":{"type":"integer","minimum":0,"maximum":10000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"items":{"type":"integer","minimum":0,"maximum":10000}},"required":["value_cents","currency","items"],"additionalProperties":false},{"type":"null"}]},"tabs":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["customer_id","visitor_id","name","email","ip","state","chat_id","thread_id","agents","group_id","url","title","landing_url","referrer","utm","country","region","city","timezone","device","browser","os","language","first_seen_at","visit_started_at","page_opened_at","last_seen_at","visits","pageviews","chats","returning","greetings","last_greeting","session_fields","cart","tabs"],"additionalProperties":false}},"counts":{"type":"object","propertyNames":{"type":"string","enum":["all","chatting","supervised","queued","waiting_for_reply","invited","browsing"]},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"required":["all","chatting","supervised","queued","waiting_for_reply","invited","browsing"]},"next_page_token":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["items","counts","next_page_token"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/traffic/counts":{"get":{"summary":"Visitor counts per segment","description":"Needs the `traffic.read` permission.","tags":["Traffic"],"security":[{"bearer":[]},{"oauth2":["traffic.read"]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"counts":{"type":"object","propertyNames":{"type":"string","enum":["all","chatting","supervised","queued","waiting_for_reply","invited","browsing"]},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"required":["all","chatting","supervised","queued","waiting_for_reply","invited","browsing"]}},"required":["counts"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/traffic/visitors/{customer_id}:invite":{"post":{"summary":"Send a visitor a message or start a chat with them (needs traffic.read too)","description":"Needs the `chats.access` permission.","tags":["Traffic"],"security":[{"bearer":[]},{"oauth2":["chats.access"]}],"parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":1024},"greeting_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)$"},"open_chat":{"default":false,"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"invited":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skipped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["invited","skipped"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/traffic:invite":{"post":{"summary":"Message every visitor of a segment, or a list of visitors (needs traffic.read too)","description":"Needs the `chats.access` permission.","tags":["Traffic"],"security":[{"bearer":[]},{"oauth2":["chats.access"]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":1024},"greeting_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)$"},"open_chat":{"default":false,"type":"boolean"},"customer_ids":{"minItems":1,"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)$"}},"segment":{"type":"string","enum":["all","chatting","supervised","queued","waiting_for_reply","invited","browsing"]},"filter":{"type":"object","properties":{"match":{"default":"all","type":"string","enum":["all","any"]},"conditions":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","enum":["name","email","ip","state","url","title","landing_url","referrer","country","region","city","device","browser","os","language","visits","pageviews","chats","time_on_site","group","agent","returning","session_field","greetings_sent","greetings_accepted","greetings_ignored","last_greeting","utm_source","utm_medium","utm_campaign","cart_value"]},"operator":{"type":"string","enum":["is","is_not","contains","not_contains","starts_with","ends_with","matches","gt","lt","exists","not_exists","in","not_in"]},"value":{"anyOf":[{"anyOf":[{"type":"string","maxLength":2048},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":2048}}]},{"type":"null"}]},"key":{"type":"string","maxLength":64}},"required":["field","operator","value"]}}}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"invited":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skipped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["invited","skipped"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/traffic/segments":{"get":{"summary":"List saved Traffic segments","description":"Needs the `traffic.read` permission.","tags":["Traffic"],"security":[{"bearer":[]},{"oauth2":["traffic.read"]}],"parameters":[],"responses":{"200":{"description":"OK","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)$"},"name":{"type":"string","minLength":1,"maxLength":64},"filter":{"type":"object","properties":{"match":{"default":"all","type":"string","enum":["all","any"]},"conditions":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","enum":["name","email","ip","state","url","title","landing_url","referrer","country","region","city","device","browser","os","language","visits","pageviews","chats","time_on_site","group","agent","returning","session_field","greetings_sent","greetings_accepted","greetings_ignored","last_greeting","utm_source","utm_medium","utm_campaign","cart_value"]},"operator":{"type":"string","enum":["is","is_not","contains","not_contains","starts_with","ends_with","matches","gt","lt","exists","not_exists","in","not_in"]},"value":{"anyOf":[{"anyOf":[{"type":"string","maxLength":2048},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":2048}}]},{"type":"null"}]},"key":{"type":"string","maxLength":64}},"required":["field","operator","value"],"additionalProperties":false}}},"required":["match","conditions"],"additionalProperties":false},"created_by":{"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"}]},"created_at":{"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{3}(?:Z))$"},"updated_at":{"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{3}(?:Z))$"}},"required":["id","name","filter","created_by","created_at","updated_at"],"additionalProperties":false}},"next_page_token":{"type":"null"}},"required":["items","next_page_token"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"post":{"summary":"Save a Traffic segment","description":"Needs the `traffic.read` permission.","tags":["Traffic"],"security":[{"bearer":[]},{"oauth2":["traffic.read"]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64},"filter":{"type":"object","properties":{"match":{"default":"all","type":"string","enum":["all","any"]},"conditions":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","enum":["name","email","ip","state","url","title","landing_url","referrer","country","region","city","device","browser","os","language","visits","pageviews","chats","time_on_site","group","agent","returning","session_field","greetings_sent","greetings_accepted","greetings_ignored","last_greeting","utm_source","utm_medium","utm_campaign","cart_value"]},"operator":{"type":"string","enum":["is","is_not","contains","not_contains","starts_with","ends_with","matches","gt","lt","exists","not_exists","in","not_in"]},"value":{"anyOf":[{"anyOf":[{"type":"string","maxLength":2048},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":2048}}]},{"type":"null"}]},"key":{"type":"string","maxLength":64}},"required":["field","operator","value"]}}}}},"required":["name","filter"]}}}},"responses":{"201":{"description":"Created","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)$"},"name":{"type":"string","minLength":1,"maxLength":64},"filter":{"type":"object","properties":{"match":{"default":"all","type":"string","enum":["all","any"]},"conditions":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","enum":["name","email","ip","state","url","title","landing_url","referrer","country","region","city","device","browser","os","language","visits","pageviews","chats","time_on_site","group","agent","returning","session_field","greetings_sent","greetings_accepted","greetings_ignored","last_greeting","utm_source","utm_medium","utm_campaign","cart_value"]},"operator":{"type":"string","enum":["is","is_not","contains","not_contains","starts_with","ends_with","matches","gt","lt","exists","not_exists","in","not_in"]},"value":{"anyOf":[{"anyOf":[{"type":"string","maxLength":2048},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":2048}}]},{"type":"null"}]},"key":{"type":"string","maxLength":64}},"required":["field","operator","value"],"additionalProperties":false}}},"required":["match","conditions"],"additionalProperties":false},"created_by":{"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"}]},"created_at":{"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{3}(?:Z))$"},"updated_at":{"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{3}(?:Z))$"}},"required":["id","name","filter","created_by","created_at","updated_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/traffic/segments/{id}":{"patch":{"summary":"Change a saved segment","description":"Needs the `traffic.read` permission.","tags":["Traffic"],"security":[{"bearer":[]},{"oauth2":["traffic.read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64},"filter":{"type":"object","properties":{"match":{"default":"all","type":"string","enum":["all","any"]},"conditions":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","enum":["name","email","ip","state","url","title","landing_url","referrer","country","region","city","device","browser","os","language","visits","pageviews","chats","time_on_site","group","agent","returning","session_field","greetings_sent","greetings_accepted","greetings_ignored","last_greeting","utm_source","utm_medium","utm_campaign","cart_value"]},"operator":{"type":"string","enum":["is","is_not","contains","not_contains","starts_with","ends_with","matches","gt","lt","exists","not_exists","in","not_in"]},"value":{"anyOf":[{"anyOf":[{"type":"string","maxLength":2048},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":2048}}]},{"type":"null"}]},"key":{"type":"string","maxLength":64}},"required":["field","operator","value"]}}}}}}}}},"responses":{"200":{"description":"OK","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)$"},"name":{"type":"string","minLength":1,"maxLength":64},"filter":{"type":"object","properties":{"match":{"default":"all","type":"string","enum":["all","any"]},"conditions":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","enum":["name","email","ip","state","url","title","landing_url","referrer","country","region","city","device","browser","os","language","visits","pageviews","chats","time_on_site","group","agent","returning","session_field","greetings_sent","greetings_accepted","greetings_ignored","last_greeting","utm_source","utm_medium","utm_campaign","cart_value"]},"operator":{"type":"string","enum":["is","is_not","contains","not_contains","starts_with","ends_with","matches","gt","lt","exists","not_exists","in","not_in"]},"value":{"anyOf":[{"anyOf":[{"type":"string","maxLength":2048},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":2048}}]},{"type":"null"}]},"key":{"type":"string","maxLength":64}},"required":["field","operator","value"],"additionalProperties":false}}},"required":["match","conditions"],"additionalProperties":false},"created_by":{"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"}]},"created_at":{"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{3}(?:Z))$"},"updated_at":{"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{3}(?:Z))$"}},"required":["id","name","filter","created_by","created_at","updated_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"delete":{"summary":"Delete a saved segment","description":"Needs the `traffic.read` permission.","tags":["Traffic"],"security":[{"bearer":[]},{"oauth2":["traffic.read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done."},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/traffic/preferences":{"get":{"summary":"Your Traffic columns and sort","description":"Needs the `traffic.read` permission.","tags":["Traffic"],"security":[{"bearer":[]},{"oauth2":["traffic.read"]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"columns":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","enum":["name","email","actions","activity","chatting_with","time_on_site","country","region","city","came_from","device","last_seen","visits","last_page","chats","greetings_sent","greetings_accepted","greetings_ignored","groups","last_greeting"]},"visible":{"type":"boolean"},"width":{"anyOf":[{"type":"integer","minimum":60,"maximum":800},{"type":"null"}]}},"required":["id","visible","width"],"additionalProperties":false}},"sort":{"type":"object","properties":{"by":{"default":"time_on_site","type":"string","enum":["name","email","state","time_on_site","country","city","visits","chats","pageviews","last_seen_at","url","referrer","device"]},"dir":{"default":"desc","type":"string","enum":["asc","desc"]}},"required":["by","dir"],"additionalProperties":false}},"required":["columns","sort"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"put":{"summary":"Save your Traffic columns and sort","description":"Needs the `traffic.read` permission.","tags":["Traffic"],"security":[{"bearer":[]},{"oauth2":["traffic.read"]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"columns":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","enum":["name","email","actions","activity","chatting_with","time_on_site","country","region","city","came_from","device","last_seen","visits","last_page","chats","greetings_sent","greetings_accepted","greetings_ignored","groups","last_greeting"]},"visible":{"type":"boolean"},"width":{"anyOf":[{"type":"integer","minimum":60,"maximum":800},{"type":"null"}]}},"required":["id","visible","width"]}},"sort":{"type":"object","properties":{"by":{"default":"time_on_site","type":"string","enum":["name","email","state","time_on_site","country","city","visits","chats","pageviews","last_seen_at","url","referrer","device"]},"dir":{"default":"desc","type":"string","enum":["asc","desc"]}}}},"required":["columns","sort"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"columns":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","enum":["name","email","actions","activity","chatting_with","time_on_site","country","region","city","came_from","device","last_seen","visits","last_page","chats","greetings_sent","greetings_accepted","greetings_ignored","groups","last_greeting"]},"visible":{"type":"boolean"},"width":{"anyOf":[{"type":"integer","minimum":60,"maximum":800},{"type":"null"}]}},"required":["id","visible","width"],"additionalProperties":false}},"sort":{"type":"object","properties":{"by":{"default":"time_on_site","type":"string","enum":["name","email","state","time_on_site","country","city","visits","chats","pageviews","last_seen_at","url","referrer","device"]},"dir":{"default":"desc","type":"string","enum":["asc","desc"]}},"required":["by","dir"],"additionalProperties":false}},"required":["columns","sort"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/visitors/hosts":{"get":{"summary":"Hosts the widget loaded on in the last 90 days, newest first","description":"Needs the `traffic.read` permission.","tags":["Visitors"],"security":[{"bearer":[]},{"oauth2":["traffic.read"]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"host":{"type":"string"},"last_seen_at":{"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{3}(?:Z))$"}},"required":["host","last_seen_at"],"additionalProperties":false}},"next_page_token":{"type":"null"}},"required":["items","next_page_token"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/visitors/install-status":{"get":{"summary":"Whether the widget is installed: the last visitor login and its host","description":"Needs the `traffic.read` permission.","tags":["Visitors"],"security":[{"bearer":[]},{"oauth2":["traffic.read"]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"installed":{"type":"boolean"},"last_seen_at":{"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{3}(?:Z))$"},{"type":"null"}]},"last_seen_host":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["installed","last_seen_at","last_seen_host"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/visitors/{customer_id}":{"get":{"summary":"A visitor's live detail: current visit, pages, session variables, goals","description":"Needs the `customers.read` permission.","tags":["Visitors"],"security":[{"bearer":[]},{"oauth2":["customers.read"]}],"parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"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)$"},"visitor_id":{"type":"string","minLength":8,"maxLength":64},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"ip":{"anyOf":[{"type":"string"},{"type":"null"}]},"state":{"type":"string","enum":["browsing","invited","queued","chatting","waiting_for_reply","supervised"]},"chat_id":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},{"type":"null"}]},"thread_id":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},{"type":"null"}]},"agents":{"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)$"},"name":{"type":"string","minLength":1,"maxLength":120},"avatar_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]}},"required":["id","name","avatar_url"],"additionalProperties":false}},"group_id":{"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"}]},"url":{"type":"string"},"title":{"type":"string"},"landing_url":{"type":"string"},"referrer":{"anyOf":[{"type":"string"},{"type":"null"}]},"utm":{"anyOf":[{"type":"object","properties":{"source":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"medium":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"campaign":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"term":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"content":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]}},"required":["source","medium","campaign","term","content"],"additionalProperties":false},{"type":"null"}]},"country":{"anyOf":[{"type":"string"},{"type":"null"}]},"region":{"anyOf":[{"type":"string"},{"type":"null"}]},"city":{"anyOf":[{"type":"string"},{"type":"null"}]},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}]},"device":{"type":"string","enum":["desktop","mobile","tablet","other"]},"browser":{"anyOf":[{"type":"string"},{"type":"null"}]},"os":{"anyOf":[{"type":"string"},{"type":"null"}]},"language":{"anyOf":[{"type":"string"},{"type":"null"}]},"first_seen_at":{"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{3}(?:Z))$"},"visit_started_at":{"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{3}(?:Z))$"},"page_opened_at":{"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{3}(?:Z))$"},"last_seen_at":{"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{3}(?:Z))$"},"visits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"pageviews":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"chats":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"returning":{"type":"boolean"},"greetings":{"type":"object","properties":{"sent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"accepted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"ignored":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["sent","accepted","ignored"],"additionalProperties":false},"last_greeting":{"anyOf":[{"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)$"},"name":{"type":"string"},"at":{"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{3}(?:Z))$"}},"required":["id","name","at"],"additionalProperties":false},{"type":"null"}]},"session_fields":{"maxItems":50,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","minLength":1,"maxLength":64},{"type":"string","maxLength":512}]}},"cart":{"anyOf":[{"type":"object","properties":{"value_cents":{"type":"integer","minimum":0,"maximum":10000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"items":{"type":"integer","minimum":0,"maximum":10000}},"required":["value_cents","currency","items"],"additionalProperties":false},{"type":"null"}]},"tabs":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"online":{"type":"boolean"},"user_agent":{"anyOf":[{"type":"string"},{"type":"null"}]},"external_user_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"pages":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"title":{"type":"string"},"opened_at":{"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{3}(?:Z))$"}},"required":["url","title","opened_at"],"additionalProperties":false}},"goals":{"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)$"}},"last_visit_at":{"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{3}(?:Z))$"},{"type":"null"}]}},"required":["customer_id","visitor_id","name","email","ip","state","chat_id","thread_id","agents","group_id","url","title","landing_url","referrer","utm","country","region","city","timezone","device","browser","os","language","first_seen_at","visit_started_at","page_opened_at","last_seen_at","visits","pageviews","chats","returning","greetings","last_greeting","session_fields","cart","tabs","online","user_agent","external_user_id","pages","goals","last_visit_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/visitors/{customer_id}/stats":{"get":{"summary":"A customer's visit and chat counts and last visit","description":"Needs the `customers.read` permission.","tags":["Visitors"],"security":[{"bearer":[]},{"oauth2":["customers.read"]}],"parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"visits_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"chats_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last_visit_at":{"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{3}(?:Z))$"},{"type":"null"}]}},"required":["visits_count","chats_count","last_visit_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/greetings":{"get":{"summary":"List campaigns with their last 7 days of stats","description":"Needs the `campaigns.manage` permission.","tags":["Campaigns"],"security":[{"bearer":[]},{"oauth2":["campaigns.manage"]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"name":"page_token","in":"query","required":false,"schema":{"type":"string","maxLength":2048}},{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["recurring","one_time"]}}],"responses":{"200":{"description":"OK","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)$"},"name":{"type":"string","minLength":1,"maxLength":120},"kind":{"type":"string","enum":["recurring","one_time"]},"enabled":{"type":"boolean"},"priority":{"type":"integer","minimum":-1000,"maximum":1000},"group_id":{"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"}]},"agent_id":{"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"}]},"rules":{"type":"object","properties":{"audience":{"default":"all","type":"string","enum":["all","new","returning"]},"device":{"default":"all","type":"string","enum":["all","desktop","mobile"]},"trigger":{"default":"page","type":"string","enum":["page","exit_intent"]},"time_on_page_s":{"default":5,"anyOf":[{"type":"integer","minimum":0,"maximum":86400},{"type":"null"}]},"match":{"default":"all","type":"string","enum":["all","any"]},"conditions":{"default":[],"maxItems":30,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","enum":["activity","url","title","any_page","pages_in_order","referrer","country","region","city","time_on_site","time_on_page","pageviews","visits","session_field","device","browser","os","language","cart_value","goal","utm_source","utm_medium","utm_campaign","group"]},"operator":{"type":"string","enum":["is","is_not","contains","not_contains","starts_with","ends_with","matches","gt","lt","exists","not_exists","in","not_in"]},"value":{"anyOf":[{"anyOf":[{"type":"string","maxLength":2048},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":2048}}]},{"type":"null"}]},"key":{"type":"string","maxLength":64}},"required":["field","operator","value"],"additionalProperties":false}}},"required":["audience","device","trigger","time_on_page_s","match","conditions"],"additionalProperties":false},"content":{"type":"object","properties":{"desktop":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"text"},"text":{"type":"string","minLength":1,"maxLength":1024},"message_input":{"default":true,"type":"boolean"}},"required":["type","text","message_input"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"card"},"image_url":{"default":null,"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"title":{"type":"string","minLength":1,"maxLength":256},"subtitle":{"default":null,"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"buttons":{"default":[],"maxItems":4,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"text":{"type":"string","minLength":1,"maxLength":64},"action":{"type":"string","enum":["start_chat","message","url","cancel"]},"value":{"default":"","type":"string","maxLength":2048},"style":{"default":"primary","type":"string","enum":["primary","secondary"]}},"required":["id","text","action","value","style"],"additionalProperties":false}},"message_input":{"default":true,"type":"boolean"}},"required":["type","image_url","title","subtitle","buttons","message_input"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"product"},"image_url":{"default":null,"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"title":{"type":"string","minLength":1,"maxLength":256},"subtitle":{"default":null,"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"price":{"default":null,"anyOf":[{"type":"object","properties":{"amount_cents":{"type":"integer","minimum":0,"maximum":10000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["amount_cents","currency"],"additionalProperties":false},{"type":"null"}]},"url":{"type":"string","format":"uri"},"buttons":{"default":[],"maxItems":4,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"text":{"type":"string","minLength":1,"maxLength":64},"action":{"type":"string","enum":["start_chat","message","url","cancel"]},"value":{"default":"","type":"string","maxLength":2048},"style":{"default":"primary","type":"string","enum":["primary","secondary"]}},"required":["id","text","action","value","style"],"additionalProperties":false}},"message_input":{"default":true,"type":"boolean"}},"required":["type","image_url","title","subtitle","price","url","buttons","message_input"],"additionalProperties":false}]},"mobile":{"default":null,"anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"text"},"text":{"type":"string","minLength":1,"maxLength":1024},"message_input":{"default":true,"type":"boolean"}},"required":["type","text","message_input"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"card"},"image_url":{"default":null,"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"title":{"type":"string","minLength":1,"maxLength":256},"subtitle":{"default":null,"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"buttons":{"default":[],"maxItems":4,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"text":{"type":"string","minLength":1,"maxLength":64},"action":{"type":"string","enum":["start_chat","message","url","cancel"]},"value":{"default":"","type":"string","maxLength":2048},"style":{"default":"primary","type":"string","enum":["primary","secondary"]}},"required":["id","text","action","value","style"],"additionalProperties":false}},"message_input":{"default":true,"type":"boolean"}},"required":["type","image_url","title","subtitle","buttons","message_input"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"product"},"image_url":{"default":null,"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"title":{"type":"string","minLength":1,"maxLength":256},"subtitle":{"default":null,"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"price":{"default":null,"anyOf":[{"type":"object","properties":{"amount_cents":{"type":"integer","minimum":0,"maximum":10000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["amount_cents","currency"],"additionalProperties":false},{"type":"null"}]},"url":{"type":"string","format":"uri"},"buttons":{"default":[],"maxItems":4,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"text":{"type":"string","minLength":1,"maxLength":64},"action":{"type":"string","enum":["start_chat","message","url","cancel"]},"value":{"default":"","type":"string","maxLength":2048},"style":{"default":"primary","type":"string","enum":["primary","secondary"]}},"required":["id","text","action","value","style"],"additionalProperties":false}},"message_input":{"default":true,"type":"boolean"}},"required":["type","image_url","title","subtitle","price","url","buttons","message_input"],"additionalProperties":false}]},{"type":"null"}]}},"required":["desktop","mobile"],"additionalProperties":false},"schedule":{"type":"object","properties":{"starts_at":{"default":null,"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{3}(?:Z))$"},{"type":"null"}]},"ends_at":{"default":null,"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{3}(?:Z))$"},{"type":"null"}]},"timezone":{"default":"UTC","type":"string","minLength":1,"maxLength":64},"hours":{"default":[],"maxItems":28,"type":"array","items":{"type":"object","properties":{"day":{"type":"integer","minimum":0,"maximum":6},"from":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"to":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["day","from","to"],"additionalProperties":false}}},"required":["starts_at","ends_at","timezone","hours"],"additionalProperties":false},"limits":{"type":"object","properties":{"max_per_visitor":{"default":0,"type":"integer","minimum":0,"maximum":1000},"once_per_visit":{"default":true,"type":"boolean"}},"required":["max_per_visitor","once_per_visit"],"additionalProperties":false},"template":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"created_by":{"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"}]},"created_at":{"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{3}(?:Z))$"},"updated_at":{"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{3}(?:Z))$"},"stats":{"type":"object","properties":{"sent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"displayed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"accepted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"canceled":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"ignored":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"chats":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"conversions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"conversion_rate":{"type":"number"}},"required":["sent","displayed","accepted","canceled","ignored","chats","conversions","conversion_rate"],"additionalProperties":false}},"required":["id","name","kind","enabled","priority","group_id","agent_id","rules","content","schedule","limits","template","created_by","created_at","updated_at","stats"],"additionalProperties":false}},"next_page_token":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["items","next_page_token"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"post":{"summary":"Create a campaign","description":"Needs the `campaigns.manage` permission.","tags":["Campaigns"],"security":[{"bearer":[]},{"oauth2":["campaigns.manage"]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"kind":{"default":"recurring","type":"string","enum":["recurring","one_time"]},"enabled":{"default":true,"type":"boolean"},"priority":{"default":0,"type":"integer","minimum":-1000,"maximum":1000},"group_id":{"default":null,"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"}]},"agent_id":{"default":null,"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"}]},"rules":{"default":{"audience":"all","device":"all","trigger":"page","time_on_page_s":5,"match":"all","conditions":[]},"type":"object","properties":{"audience":{"default":"all","type":"string","enum":["all","new","returning"]},"device":{"default":"all","type":"string","enum":["all","desktop","mobile"]},"trigger":{"default":"page","type":"string","enum":["page","exit_intent"]},"time_on_page_s":{"default":5,"anyOf":[{"type":"integer","minimum":0,"maximum":86400},{"type":"null"}]},"match":{"default":"all","type":"string","enum":["all","any"]},"conditions":{"default":[],"maxItems":30,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","enum":["activity","url","title","any_page","pages_in_order","referrer","country","region","city","time_on_site","time_on_page","pageviews","visits","session_field","device","browser","os","language","cart_value","goal","utm_source","utm_medium","utm_campaign","group"]},"operator":{"type":"string","enum":["is","is_not","contains","not_contains","starts_with","ends_with","matches","gt","lt","exists","not_exists","in","not_in"]},"value":{"anyOf":[{"anyOf":[{"type":"string","maxLength":2048},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":2048}}]},{"type":"null"}]},"key":{"type":"string","maxLength":64}},"required":["field","operator","value"]}}}},"content":{"type":"object","properties":{"desktop":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"text"},"text":{"type":"string","minLength":1,"maxLength":1024},"message_input":{"default":true,"type":"boolean"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","const":"card"},"image_url":{"default":null,"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"title":{"type":"string","minLength":1,"maxLength":256},"subtitle":{"default":null,"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"buttons":{"default":[],"maxItems":4,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"text":{"type":"string","minLength":1,"maxLength":64},"action":{"type":"string","enum":["start_chat","message","url","cancel"]},"value":{"default":"","type":"string","maxLength":2048},"style":{"default":"primary","type":"string","enum":["primary","secondary"]}},"required":["id","text","action"]}},"message_input":{"default":true,"type":"boolean"}},"required":["type","title"]},{"type":"object","properties":{"type":{"type":"string","const":"product"},"image_url":{"default":null,"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"title":{"type":"string","minLength":1,"maxLength":256},"subtitle":{"default":null,"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"price":{"default":null,"anyOf":[{"type":"object","properties":{"amount_cents":{"type":"integer","minimum":0,"maximum":10000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["amount_cents","currency"]},{"type":"null"}]},"url":{"type":"string","format":"uri"},"buttons":{"default":[],"maxItems":4,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"text":{"type":"string","minLength":1,"maxLength":64},"action":{"type":"string","enum":["start_chat","message","url","cancel"]},"value":{"default":"","type":"string","maxLength":2048},"style":{"default":"primary","type":"string","enum":["primary","secondary"]}},"required":["id","text","action"]}},"message_input":{"default":true,"type":"boolean"}},"required":["type","title","url"]}]},"mobile":{"default":null,"anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"text"},"text":{"type":"string","minLength":1,"maxLength":1024},"message_input":{"default":true,"type":"boolean"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","const":"card"},"image_url":{"default":null,"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"title":{"type":"string","minLength":1,"maxLength":256},"subtitle":{"default":null,"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"buttons":{"default":[],"maxItems":4,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"text":{"type":"string","minLength":1,"maxLength":64},"action":{"type":"string","enum":["start_chat","message","url","cancel"]},"value":{"default":"","type":"string","maxLength":2048},"style":{"default":"primary","type":"string","enum":["primary","secondary"]}},"required":["id","text","action"]}},"message_input":{"default":true,"type":"boolean"}},"required":["type","title"]},{"type":"object","properties":{"type":{"type":"string","const":"product"},"image_url":{"default":null,"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"title":{"type":"string","minLength":1,"maxLength":256},"subtitle":{"default":null,"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"price":{"default":null,"anyOf":[{"type":"object","properties":{"amount_cents":{"type":"integer","minimum":0,"maximum":10000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["amount_cents","currency"]},{"type":"null"}]},"url":{"type":"string","format":"uri"},"buttons":{"default":[],"maxItems":4,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"text":{"type":"string","minLength":1,"maxLength":64},"action":{"type":"string","enum":["start_chat","message","url","cancel"]},"value":{"default":"","type":"string","maxLength":2048},"style":{"default":"primary","type":"string","enum":["primary","secondary"]}},"required":["id","text","action"]}},"message_input":{"default":true,"type":"boolean"}},"required":["type","title","url"]}]},{"type":"null"}]}},"required":["desktop"]},"schedule":{"default":{"starts_at":null,"ends_at":null,"timezone":"UTC","hours":[]},"type":"object","properties":{"starts_at":{"default":null,"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{3}(?:Z))$"},{"type":"null"}]},"ends_at":{"default":null,"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{3}(?:Z))$"},{"type":"null"}]},"timezone":{"default":"UTC","type":"string","minLength":1,"maxLength":64},"hours":{"default":[],"maxItems":28,"type":"array","items":{"type":"object","properties":{"day":{"type":"integer","minimum":0,"maximum":6},"from":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"to":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["day","from","to"]}}}},"limits":{"default":{"max_per_visitor":0,"once_per_visit":true},"type":"object","properties":{"max_per_visitor":{"default":0,"type":"integer","minimum":0,"maximum":1000},"once_per_visit":{"default":true,"type":"boolean"}}},"template":{"default":null,"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]}},"required":["name","content"]}}}},"responses":{"201":{"description":"Created","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)$"},"name":{"type":"string","minLength":1,"maxLength":120},"kind":{"type":"string","enum":["recurring","one_time"]},"enabled":{"type":"boolean"},"priority":{"type":"integer","minimum":-1000,"maximum":1000},"group_id":{"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"}]},"agent_id":{"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"}]},"rules":{"type":"object","properties":{"audience":{"default":"all","type":"string","enum":["all","new","returning"]},"device":{"default":"all","type":"string","enum":["all","desktop","mobile"]},"trigger":{"default":"page","type":"string","enum":["page","exit_intent"]},"time_on_page_s":{"default":5,"anyOf":[{"type":"integer","minimum":0,"maximum":86400},{"type":"null"}]},"match":{"default":"all","type":"string","enum":["all","any"]},"conditions":{"default":[],"maxItems":30,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","enum":["activity","url","title","any_page","pages_in_order","referrer","country","region","city","time_on_site","time_on_page","pageviews","visits","session_field","device","browser","os","language","cart_value","goal","utm_source","utm_medium","utm_campaign","group"]},"operator":{"type":"string","enum":["is","is_not","contains","not_contains","starts_with","ends_with","matches","gt","lt","exists","not_exists","in","not_in"]},"value":{"anyOf":[{"anyOf":[{"type":"string","maxLength":2048},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":2048}}]},{"type":"null"}]},"key":{"type":"string","maxLength":64}},"required":["field","operator","value"],"additionalProperties":false}}},"required":["audience","device","trigger","time_on_page_s","match","conditions"],"additionalProperties":false},"content":{"type":"object","properties":{"desktop":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"text"},"text":{"type":"string","minLength":1,"maxLength":1024},"message_input":{"default":true,"type":"boolean"}},"required":["type","text","message_input"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"card"},"image_url":{"default":null,"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"title":{"type":"string","minLength":1,"maxLength":256},"subtitle":{"default":null,"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"buttons":{"default":[],"maxItems":4,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"text":{"type":"string","minLength":1,"maxLength":64},"action":{"type":"string","enum":["start_chat","message","url","cancel"]},"value":{"default":"","type":"string","maxLength":2048},"style":{"default":"primary","type":"string","enum":["primary","secondary"]}},"required":["id","text","action","value","style"],"additionalProperties":false}},"message_input":{"default":true,"type":"boolean"}},"required":["type","image_url","title","subtitle","buttons","message_input"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"product"},"image_url":{"default":null,"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"title":{"type":"string","minLength":1,"maxLength":256},"subtitle":{"default":null,"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"price":{"default":null,"anyOf":[{"type":"object","properties":{"amount_cents":{"type":"integer","minimum":0,"maximum":10000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["amount_cents","currency"],"additionalProperties":false},{"type":"null"}]},"url":{"type":"string","format":"uri"},"buttons":{"default":[],"maxItems":4,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"text":{"type":"string","minLength":1,"maxLength":64},"action":{"type":"string","enum":["start_chat","message","url","cancel"]},"value":{"default":"","type":"string","maxLength":2048},"style":{"default":"primary","type":"string","enum":["primary","secondary"]}},"required":["id","text","action","value","style"],"additionalProperties":false}},"message_input":{"default":true,"type":"boolean"}},"required":["type","image_url","title","subtitle","price","url","buttons","message_input"],"additionalProperties":false}]},"mobile":{"default":null,"anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"text"},"text":{"type":"string","minLength":1,"maxLength":1024},"message_input":{"default":true,"type":"boolean"}},"required":["type","text","message_input"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"card"},"image_url":{"default":null,"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"title":{"type":"string","minLength":1,"maxLength":256},"subtitle":{"default":null,"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"buttons":{"default":[],"maxItems":4,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"text":{"type":"string","minLength":1,"maxLength":64},"action":{"type":"string","enum":["start_chat","message","url","cancel"]},"value":{"default":"","type":"string","maxLength":2048},"style":{"default":"primary","type":"string","enum":["primary","secondary"]}},"required":["id","text","action","value","style"],"additionalProperties":false}},"message_input":{"default":true,"type":"boolean"}},"required":["type","image_url","title","subtitle","buttons","message_input"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"product"},"image_url":{"default":null,"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"title":{"type":"string","minLength":1,"maxLength":256},"subtitle":{"default":null,"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"price":{"default":null,"anyOf":[{"type":"object","properties":{"amount_cents":{"type":"integer","minimum":0,"maximum":10000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["amount_cents","currency"],"additionalProperties":false},{"type":"null"}]},"url":{"type":"string","format":"uri"},"buttons":{"default":[],"maxItems":4,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"text":{"type":"string","minLength":1,"maxLength":64},"action":{"type":"string","enum":["start_chat","message","url","cancel"]},"value":{"default":"","type":"string","maxLength":2048},"style":{"default":"primary","type":"string","enum":["primary","secondary"]}},"required":["id","text","action","value","style"],"additionalProperties":false}},"message_input":{"default":true,"type":"boolean"}},"required":["type","image_url","title","subtitle","price","url","buttons","message_input"],"additionalProperties":false}]},{"type":"null"}]}},"required":["desktop","mobile"],"additionalProperties":false},"schedule":{"type":"object","properties":{"starts_at":{"default":null,"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{3}(?:Z))$"},{"type":"null"}]},"ends_at":{"default":null,"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{3}(?:Z))$"},{"type":"null"}]},"timezone":{"default":"UTC","type":"string","minLength":1,"maxLength":64},"hours":{"default":[],"maxItems":28,"type":"array","items":{"type":"object","properties":{"day":{"type":"integer","minimum":0,"maximum":6},"from":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"to":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["day","from","to"],"additionalProperties":false}}},"required":["starts_at","ends_at","timezone","hours"],"additionalProperties":false},"limits":{"type":"object","properties":{"max_per_visitor":{"default":0,"type":"integer","minimum":0,"maximum":1000},"once_per_visit":{"default":true,"type":"boolean"}},"required":["max_per_visitor","once_per_visit"],"additionalProperties":false},"template":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"created_by":{"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"}]},"created_at":{"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{3}(?:Z))$"},"updated_at":{"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{3}(?:Z))$"}},"required":["id","name","kind","enabled","priority","group_id","agent_id","rules","content","schedule","limits","template","created_by","created_at","updated_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/greetings/{id}":{"get":{"summary":"Get a campaign","description":"Needs the `campaigns.manage` permission.","tags":["Campaigns"],"security":[{"bearer":[]},{"oauth2":["campaigns.manage"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","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)$"},"name":{"type":"string","minLength":1,"maxLength":120},"kind":{"type":"string","enum":["recurring","one_time"]},"enabled":{"type":"boolean"},"priority":{"type":"integer","minimum":-1000,"maximum":1000},"group_id":{"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"}]},"agent_id":{"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"}]},"rules":{"type":"object","properties":{"audience":{"default":"all","type":"string","enum":["all","new","returning"]},"device":{"default":"all","type":"string","enum":["all","desktop","mobile"]},"trigger":{"default":"page","type":"string","enum":["page","exit_intent"]},"time_on_page_s":{"default":5,"anyOf":[{"type":"integer","minimum":0,"maximum":86400},{"type":"null"}]},"match":{"default":"all","type":"string","enum":["all","any"]},"conditions":{"default":[],"maxItems":30,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","enum":["activity","url","title","any_page","pages_in_order","referrer","country","region","city","time_on_site","time_on_page","pageviews","visits","session_field","device","browser","os","language","cart_value","goal","utm_source","utm_medium","utm_campaign","group"]},"operator":{"type":"string","enum":["is","is_not","contains","not_contains","starts_with","ends_with","matches","gt","lt","exists","not_exists","in","not_in"]},"value":{"anyOf":[{"anyOf":[{"type":"string","maxLength":2048},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":2048}}]},{"type":"null"}]},"key":{"type":"string","maxLength":64}},"required":["field","operator","value"],"additionalProperties":false}}},"required":["audience","device","trigger","time_on_page_s","match","conditions"],"additionalProperties":false},"content":{"type":"object","properties":{"desktop":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"text"},"text":{"type":"string","minLength":1,"maxLength":1024},"message_input":{"default":true,"type":"boolean"}},"required":["type","text","message_input"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"card"},"image_url":{"default":null,"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"title":{"type":"string","minLength":1,"maxLength":256},"subtitle":{"default":null,"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"buttons":{"default":[],"maxItems":4,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"text":{"type":"string","minLength":1,"maxLength":64},"action":{"type":"string","enum":["start_chat","message","url","cancel"]},"value":{"default":"","type":"string","maxLength":2048},"style":{"default":"primary","type":"string","enum":["primary","secondary"]}},"required":["id","text","action","value","style"],"additionalProperties":false}},"message_input":{"default":true,"type":"boolean"}},"required":["type","image_url","title","subtitle","buttons","message_input"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"product"},"image_url":{"default":null,"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"title":{"type":"string","minLength":1,"maxLength":256},"subtitle":{"default":null,"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"price":{"default":null,"anyOf":[{"type":"object","properties":{"amount_cents":{"type":"integer","minimum":0,"maximum":10000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["amount_cents","currency"],"additionalProperties":false},{"type":"null"}]},"url":{"type":"string","format":"uri"},"buttons":{"default":[],"maxItems":4,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"text":{"type":"string","minLength":1,"maxLength":64},"action":{"type":"string","enum":["start_chat","message","url","cancel"]},"value":{"default":"","type":"string","maxLength":2048},"style":{"default":"primary","type":"string","enum":["primary","secondary"]}},"required":["id","text","action","value","style"],"additionalProperties":false}},"message_input":{"default":true,"type":"boolean"}},"required":["type","image_url","title","subtitle","price","url","buttons","message_input"],"additionalProperties":false}]},"mobile":{"default":null,"anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"text"},"text":{"type":"string","minLength":1,"maxLength":1024},"message_input":{"default":true,"type":"boolean"}},"required":["type","text","message_input"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"card"},"image_url":{"default":null,"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"title":{"type":"string","minLength":1,"maxLength":256},"subtitle":{"default":null,"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"buttons":{"default":[],"maxItems":4,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"text":{"type":"string","minLength":1,"maxLength":64},"action":{"type":"string","enum":["start_chat","message","url","cancel"]},"value":{"default":"","type":"string","maxLength":2048},"style":{"default":"primary","type":"string","enum":["primary","secondary"]}},"required":["id","text","action","value","style"],"additionalProperties":false}},"message_input":{"default":true,"type":"boolean"}},"required":["type","image_url","title","subtitle","buttons","message_input"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"product"},"image_url":{"default":null,"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"title":{"type":"string","minLength":1,"maxLength":256},"subtitle":{"default":null,"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"price":{"default":null,"anyOf":[{"type":"object","properties":{"amount_cents":{"type":"integer","minimum":0,"maximum":10000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["amount_cents","currency"],"additionalProperties":false},{"type":"null"}]},"url":{"type":"string","format":"uri"},"buttons":{"default":[],"maxItems":4,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"text":{"type":"string","minLength":1,"maxLength":64},"action":{"type":"string","enum":["start_chat","message","url","cancel"]},"value":{"default":"","type":"string","maxLength":2048},"style":{"default":"primary","type":"string","enum":["primary","secondary"]}},"required":["id","text","action","value","style"],"additionalProperties":false}},"message_input":{"default":true,"type":"boolean"}},"required":["type","image_url","title","subtitle","price","url","buttons","message_input"],"additionalProperties":false}]},{"type":"null"}]}},"required":["desktop","mobile"],"additionalProperties":false},"schedule":{"type":"object","properties":{"starts_at":{"default":null,"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{3}(?:Z))$"},{"type":"null"}]},"ends_at":{"default":null,"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{3}(?:Z))$"},{"type":"null"}]},"timezone":{"default":"UTC","type":"string","minLength":1,"maxLength":64},"hours":{"default":[],"maxItems":28,"type":"array","items":{"type":"object","properties":{"day":{"type":"integer","minimum":0,"maximum":6},"from":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"to":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["day","from","to"],"additionalProperties":false}}},"required":["starts_at","ends_at","timezone","hours"],"additionalProperties":false},"limits":{"type":"object","properties":{"max_per_visitor":{"default":0,"type":"integer","minimum":0,"maximum":1000},"once_per_visit":{"default":true,"type":"boolean"}},"required":["max_per_visitor","once_per_visit"],"additionalProperties":false},"template":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"created_by":{"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"}]},"created_at":{"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{3}(?:Z))$"},"updated_at":{"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{3}(?:Z))$"}},"required":["id","name","kind","enabled","priority","group_id","agent_id","rules","content","schedule","limits","template","created_by","created_at","updated_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"patch":{"summary":"Change a campaign","description":"Needs the `campaigns.manage` permission.","tags":["Campaigns"],"security":[{"bearer":[]},{"oauth2":["campaigns.manage"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"kind":{"type":"string","enum":["recurring","one_time"]},"enabled":{"type":"boolean"},"priority":{"type":"integer","minimum":-1000,"maximum":1000},"group_id":{"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"}]},"agent_id":{"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"}]},"rules":{"type":"object","properties":{"audience":{"default":"all","type":"string","enum":["all","new","returning"]},"device":{"default":"all","type":"string","enum":["all","desktop","mobile"]},"trigger":{"default":"page","type":"string","enum":["page","exit_intent"]},"time_on_page_s":{"default":5,"anyOf":[{"type":"integer","minimum":0,"maximum":86400},{"type":"null"}]},"match":{"default":"all","type":"string","enum":["all","any"]},"conditions":{"default":[],"maxItems":30,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","enum":["activity","url","title","any_page","pages_in_order","referrer","country","region","city","time_on_site","time_on_page","pageviews","visits","session_field","device","browser","os","language","cart_value","goal","utm_source","utm_medium","utm_campaign","group"]},"operator":{"type":"string","enum":["is","is_not","contains","not_contains","starts_with","ends_with","matches","gt","lt","exists","not_exists","in","not_in"]},"value":{"anyOf":[{"anyOf":[{"type":"string","maxLength":2048},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":2048}}]},{"type":"null"}]},"key":{"type":"string","maxLength":64}},"required":["field","operator","value"]}}}},"content":{"type":"object","properties":{"desktop":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"text"},"text":{"type":"string","minLength":1,"maxLength":1024},"message_input":{"default":true,"type":"boolean"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","const":"card"},"image_url":{"default":null,"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"title":{"type":"string","minLength":1,"maxLength":256},"subtitle":{"default":null,"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"buttons":{"default":[],"maxItems":4,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"text":{"type":"string","minLength":1,"maxLength":64},"action":{"type":"string","enum":["start_chat","message","url","cancel"]},"value":{"default":"","type":"string","maxLength":2048},"style":{"default":"primary","type":"string","enum":["primary","secondary"]}},"required":["id","text","action"]}},"message_input":{"default":true,"type":"boolean"}},"required":["type","title"]},{"type":"object","properties":{"type":{"type":"string","const":"product"},"image_url":{"default":null,"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"title":{"type":"string","minLength":1,"maxLength":256},"subtitle":{"default":null,"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"price":{"default":null,"anyOf":[{"type":"object","properties":{"amount_cents":{"type":"integer","minimum":0,"maximum":10000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["amount_cents","currency"]},{"type":"null"}]},"url":{"type":"string","format":"uri"},"buttons":{"default":[],"maxItems":4,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"text":{"type":"string","minLength":1,"maxLength":64},"action":{"type":"string","enum":["start_chat","message","url","cancel"]},"value":{"default":"","type":"string","maxLength":2048},"style":{"default":"primary","type":"string","enum":["primary","secondary"]}},"required":["id","text","action"]}},"message_input":{"default":true,"type":"boolean"}},"required":["type","title","url"]}]},"mobile":{"default":null,"anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"text"},"text":{"type":"string","minLength":1,"maxLength":1024},"message_input":{"default":true,"type":"boolean"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","const":"card"},"image_url":{"default":null,"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"title":{"type":"string","minLength":1,"maxLength":256},"subtitle":{"default":null,"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"buttons":{"default":[],"maxItems":4,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"text":{"type":"string","minLength":1,"maxLength":64},"action":{"type":"string","enum":["start_chat","message","url","cancel"]},"value":{"default":"","type":"string","maxLength":2048},"style":{"default":"primary","type":"string","enum":["primary","secondary"]}},"required":["id","text","action"]}},"message_input":{"default":true,"type":"boolean"}},"required":["type","title"]},{"type":"object","properties":{"type":{"type":"string","const":"product"},"image_url":{"default":null,"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"title":{"type":"string","minLength":1,"maxLength":256},"subtitle":{"default":null,"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"price":{"default":null,"anyOf":[{"type":"object","properties":{"amount_cents":{"type":"integer","minimum":0,"maximum":10000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["amount_cents","currency"]},{"type":"null"}]},"url":{"type":"string","format":"uri"},"buttons":{"default":[],"maxItems":4,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"text":{"type":"string","minLength":1,"maxLength":64},"action":{"type":"string","enum":["start_chat","message","url","cancel"]},"value":{"default":"","type":"string","maxLength":2048},"style":{"default":"primary","type":"string","enum":["primary","secondary"]}},"required":["id","text","action"]}},"message_input":{"default":true,"type":"boolean"}},"required":["type","title","url"]}]},{"type":"null"}]}},"required":["desktop"]},"schedule":{"type":"object","properties":{"starts_at":{"default":null,"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{3}(?:Z))$"},{"type":"null"}]},"ends_at":{"default":null,"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{3}(?:Z))$"},{"type":"null"}]},"timezone":{"default":"UTC","type":"string","minLength":1,"maxLength":64},"hours":{"default":[],"maxItems":28,"type":"array","items":{"type":"object","properties":{"day":{"type":"integer","minimum":0,"maximum":6},"from":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"to":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["day","from","to"]}}}},"limits":{"type":"object","properties":{"max_per_visitor":{"default":0,"type":"integer","minimum":0,"maximum":1000},"once_per_visit":{"default":true,"type":"boolean"}}}}}}}},"responses":{"200":{"description":"OK","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)$"},"name":{"type":"string","minLength":1,"maxLength":120},"kind":{"type":"string","enum":["recurring","one_time"]},"enabled":{"type":"boolean"},"priority":{"type":"integer","minimum":-1000,"maximum":1000},"group_id":{"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"}]},"agent_id":{"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"}]},"rules":{"type":"object","properties":{"audience":{"default":"all","type":"string","enum":["all","new","returning"]},"device":{"default":"all","type":"string","enum":["all","desktop","mobile"]},"trigger":{"default":"page","type":"string","enum":["page","exit_intent"]},"time_on_page_s":{"default":5,"anyOf":[{"type":"integer","minimum":0,"maximum":86400},{"type":"null"}]},"match":{"default":"all","type":"string","enum":["all","any"]},"conditions":{"default":[],"maxItems":30,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","enum":["activity","url","title","any_page","pages_in_order","referrer","country","region","city","time_on_site","time_on_page","pageviews","visits","session_field","device","browser","os","language","cart_value","goal","utm_source","utm_medium","utm_campaign","group"]},"operator":{"type":"string","enum":["is","is_not","contains","not_contains","starts_with","ends_with","matches","gt","lt","exists","not_exists","in","not_in"]},"value":{"anyOf":[{"anyOf":[{"type":"string","maxLength":2048},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":2048}}]},{"type":"null"}]},"key":{"type":"string","maxLength":64}},"required":["field","operator","value"],"additionalProperties":false}}},"required":["audience","device","trigger","time_on_page_s","match","conditions"],"additionalProperties":false},"content":{"type":"object","properties":{"desktop":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"text"},"text":{"type":"string","minLength":1,"maxLength":1024},"message_input":{"default":true,"type":"boolean"}},"required":["type","text","message_input"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"card"},"image_url":{"default":null,"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"title":{"type":"string","minLength":1,"maxLength":256},"subtitle":{"default":null,"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"buttons":{"default":[],"maxItems":4,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"text":{"type":"string","minLength":1,"maxLength":64},"action":{"type":"string","enum":["start_chat","message","url","cancel"]},"value":{"default":"","type":"string","maxLength":2048},"style":{"default":"primary","type":"string","enum":["primary","secondary"]}},"required":["id","text","action","value","style"],"additionalProperties":false}},"message_input":{"default":true,"type":"boolean"}},"required":["type","image_url","title","subtitle","buttons","message_input"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"product"},"image_url":{"default":null,"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"title":{"type":"string","minLength":1,"maxLength":256},"subtitle":{"default":null,"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"price":{"default":null,"anyOf":[{"type":"object","properties":{"amount_cents":{"type":"integer","minimum":0,"maximum":10000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["amount_cents","currency"],"additionalProperties":false},{"type":"null"}]},"url":{"type":"string","format":"uri"},"buttons":{"default":[],"maxItems":4,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"text":{"type":"string","minLength":1,"maxLength":64},"action":{"type":"string","enum":["start_chat","message","url","cancel"]},"value":{"default":"","type":"string","maxLength":2048},"style":{"default":"primary","type":"string","enum":["primary","secondary"]}},"required":["id","text","action","value","style"],"additionalProperties":false}},"message_input":{"default":true,"type":"boolean"}},"required":["type","image_url","title","subtitle","price","url","buttons","message_input"],"additionalProperties":false}]},"mobile":{"default":null,"anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"text"},"text":{"type":"string","minLength":1,"maxLength":1024},"message_input":{"default":true,"type":"boolean"}},"required":["type","text","message_input"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"card"},"image_url":{"default":null,"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"title":{"type":"string","minLength":1,"maxLength":256},"subtitle":{"default":null,"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"buttons":{"default":[],"maxItems":4,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"text":{"type":"string","minLength":1,"maxLength":64},"action":{"type":"string","enum":["start_chat","message","url","cancel"]},"value":{"default":"","type":"string","maxLength":2048},"style":{"default":"primary","type":"string","enum":["primary","secondary"]}},"required":["id","text","action","value","style"],"additionalProperties":false}},"message_input":{"default":true,"type":"boolean"}},"required":["type","image_url","title","subtitle","buttons","message_input"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"product"},"image_url":{"default":null,"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"title":{"type":"string","minLength":1,"maxLength":256},"subtitle":{"default":null,"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"price":{"default":null,"anyOf":[{"type":"object","properties":{"amount_cents":{"type":"integer","minimum":0,"maximum":10000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["amount_cents","currency"],"additionalProperties":false},{"type":"null"}]},"url":{"type":"string","format":"uri"},"buttons":{"default":[],"maxItems":4,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"text":{"type":"string","minLength":1,"maxLength":64},"action":{"type":"string","enum":["start_chat","message","url","cancel"]},"value":{"default":"","type":"string","maxLength":2048},"style":{"default":"primary","type":"string","enum":["primary","secondary"]}},"required":["id","text","action","value","style"],"additionalProperties":false}},"message_input":{"default":true,"type":"boolean"}},"required":["type","image_url","title","subtitle","price","url","buttons","message_input"],"additionalProperties":false}]},{"type":"null"}]}},"required":["desktop","mobile"],"additionalProperties":false},"schedule":{"type":"object","properties":{"starts_at":{"default":null,"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{3}(?:Z))$"},{"type":"null"}]},"ends_at":{"default":null,"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{3}(?:Z))$"},{"type":"null"}]},"timezone":{"default":"UTC","type":"string","minLength":1,"maxLength":64},"hours":{"default":[],"maxItems":28,"type":"array","items":{"type":"object","properties":{"day":{"type":"integer","minimum":0,"maximum":6},"from":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"to":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["day","from","to"],"additionalProperties":false}}},"required":["starts_at","ends_at","timezone","hours"],"additionalProperties":false},"limits":{"type":"object","properties":{"max_per_visitor":{"default":0,"type":"integer","minimum":0,"maximum":1000},"once_per_visit":{"default":true,"type":"boolean"}},"required":["max_per_visitor","once_per_visit"],"additionalProperties":false},"template":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"created_by":{"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"}]},"created_at":{"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{3}(?:Z))$"},"updated_at":{"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{3}(?:Z))$"}},"required":["id","name","kind","enabled","priority","group_id","agent_id","rules","content","schedule","limits","template","created_by","created_at","updated_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"delete":{"summary":"Delete a campaign","description":"Needs the `campaigns.manage` permission.","tags":["Campaigns"],"security":[{"bearer":[]},{"oauth2":["campaigns.manage"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done."},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/greetings/{id}/stats":{"get":{"summary":"A campaign's stats per day","description":"Needs the `campaigns.manage` permission.","tags":["Campaigns"],"security":[{"bearer":[]},{"oauth2":["campaigns.manage"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"from","in":"query","required":false,"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{3}(?:Z))$"}},{"name":"to","in":"query","required":false,"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{3}(?:Z))$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"greeting_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)$"},"days":{"type":"array","items":{"type":"object","properties":{"sent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"displayed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"accepted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"canceled":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"ignored":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"chats":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"conversions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"conversion_rate":{"type":"number"},"date":{"type":"string"}},"required":["sent","displayed","accepted","canceled","ignored","chats","conversions","conversion_rate","date"],"additionalProperties":false}},"total":{"type":"object","properties":{"sent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"displayed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"accepted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"canceled":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"ignored":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"chats":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"conversions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"conversion_rate":{"type":"number"}},"required":["sent","displayed","accepted","canceled","ignored","chats","conversions","conversion_rate"],"additionalProperties":false}},"required":["greeting_id","days","total"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/greetings/settings":{"get":{"summary":"Campaign settings","description":"Needs the `campaigns.manage` permission.","tags":["Campaigns"],"security":[{"bearer":[]},{"oauth2":["campaigns.manage"]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"multiple_campaigns":{"type":"boolean"}},"required":["multiple_campaigns"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"put":{"summary":"Change campaign settings","description":"Needs the `settings.manage` permission.","tags":["Campaigns"],"security":[{"bearer":[]},{"oauth2":["settings.manage"]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"multiple_campaigns":{"type":"boolean"}},"required":["multiple_campaigns"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"multiple_campaigns":{"type":"boolean"}},"required":["multiple_campaigns"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/greetings/templates":{"get":{"summary":"Ready-made campaigns","description":"Needs the `campaigns.manage` permission.","tags":["Campaigns"],"security":[{"bearer":[]},{"oauth2":["campaigns.manage"]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"greeting":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"kind":{"default":"recurring","type":"string","enum":["recurring","one_time"]},"enabled":{"default":true,"type":"boolean"},"priority":{"default":0,"type":"integer","minimum":-1000,"maximum":1000},"group_id":{"default":null,"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"}]},"agent_id":{"default":null,"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"}]},"rules":{"default":{"audience":"all","device":"all","trigger":"page","time_on_page_s":5,"match":"all","conditions":[]},"type":"object","properties":{"audience":{"default":"all","type":"string","enum":["all","new","returning"]},"device":{"default":"all","type":"string","enum":["all","desktop","mobile"]},"trigger":{"default":"page","type":"string","enum":["page","exit_intent"]},"time_on_page_s":{"default":5,"anyOf":[{"type":"integer","minimum":0,"maximum":86400},{"type":"null"}]},"match":{"default":"all","type":"string","enum":["all","any"]},"conditions":{"default":[],"maxItems":30,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","enum":["activity","url","title","any_page","pages_in_order","referrer","country","region","city","time_on_site","time_on_page","pageviews","visits","session_field","device","browser","os","language","cart_value","goal","utm_source","utm_medium","utm_campaign","group"]},"operator":{"type":"string","enum":["is","is_not","contains","not_contains","starts_with","ends_with","matches","gt","lt","exists","not_exists","in","not_in"]},"value":{"anyOf":[{"anyOf":[{"type":"string","maxLength":2048},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":2048}}]},{"type":"null"}]},"key":{"type":"string","maxLength":64}},"required":["field","operator","value"],"additionalProperties":false}}},"required":["audience","device","trigger","time_on_page_s","match","conditions"],"additionalProperties":false},"content":{"type":"object","properties":{"desktop":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"text"},"text":{"type":"string","minLength":1,"maxLength":1024},"message_input":{"default":true,"type":"boolean"}},"required":["type","text","message_input"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"card"},"image_url":{"default":null,"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"title":{"type":"string","minLength":1,"maxLength":256},"subtitle":{"default":null,"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"buttons":{"default":[],"maxItems":4,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"text":{"type":"string","minLength":1,"maxLength":64},"action":{"type":"string","enum":["start_chat","message","url","cancel"]},"value":{"default":"","type":"string","maxLength":2048},"style":{"default":"primary","type":"string","enum":["primary","secondary"]}},"required":["id","text","action","value","style"],"additionalProperties":false}},"message_input":{"default":true,"type":"boolean"}},"required":["type","image_url","title","subtitle","buttons","message_input"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"product"},"image_url":{"default":null,"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"title":{"type":"string","minLength":1,"maxLength":256},"subtitle":{"default":null,"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"price":{"default":null,"anyOf":[{"type":"object","properties":{"amount_cents":{"type":"integer","minimum":0,"maximum":10000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["amount_cents","currency"],"additionalProperties":false},{"type":"null"}]},"url":{"type":"string","format":"uri"},"buttons":{"default":[],"maxItems":4,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"text":{"type":"string","minLength":1,"maxLength":64},"action":{"type":"string","enum":["start_chat","message","url","cancel"]},"value":{"default":"","type":"string","maxLength":2048},"style":{"default":"primary","type":"string","enum":["primary","secondary"]}},"required":["id","text","action","value","style"],"additionalProperties":false}},"message_input":{"default":true,"type":"boolean"}},"required":["type","image_url","title","subtitle","price","url","buttons","message_input"],"additionalProperties":false}]},"mobile":{"default":null,"anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"text"},"text":{"type":"string","minLength":1,"maxLength":1024},"message_input":{"default":true,"type":"boolean"}},"required":["type","text","message_input"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"card"},"image_url":{"default":null,"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"title":{"type":"string","minLength":1,"maxLength":256},"subtitle":{"default":null,"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"buttons":{"default":[],"maxItems":4,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"text":{"type":"string","minLength":1,"maxLength":64},"action":{"type":"string","enum":["start_chat","message","url","cancel"]},"value":{"default":"","type":"string","maxLength":2048},"style":{"default":"primary","type":"string","enum":["primary","secondary"]}},"required":["id","text","action","value","style"],"additionalProperties":false}},"message_input":{"default":true,"type":"boolean"}},"required":["type","image_url","title","subtitle","buttons","message_input"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"product"},"image_url":{"default":null,"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"title":{"type":"string","minLength":1,"maxLength":256},"subtitle":{"default":null,"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"price":{"default":null,"anyOf":[{"type":"object","properties":{"amount_cents":{"type":"integer","minimum":0,"maximum":10000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["amount_cents","currency"],"additionalProperties":false},{"type":"null"}]},"url":{"type":"string","format":"uri"},"buttons":{"default":[],"maxItems":4,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"text":{"type":"string","minLength":1,"maxLength":64},"action":{"type":"string","enum":["start_chat","message","url","cancel"]},"value":{"default":"","type":"string","maxLength":2048},"style":{"default":"primary","type":"string","enum":["primary","secondary"]}},"required":["id","text","action","value","style"],"additionalProperties":false}},"message_input":{"default":true,"type":"boolean"}},"required":["type","image_url","title","subtitle","price","url","buttons","message_input"],"additionalProperties":false}]},{"type":"null"}]}},"required":["desktop","mobile"],"additionalProperties":false},"schedule":{"default":{"starts_at":null,"ends_at":null,"timezone":"UTC","hours":[]},"type":"object","properties":{"starts_at":{"default":null,"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{3}(?:Z))$"},{"type":"null"}]},"ends_at":{"default":null,"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{3}(?:Z))$"},{"type":"null"}]},"timezone":{"default":"UTC","type":"string","minLength":1,"maxLength":64},"hours":{"default":[],"maxItems":28,"type":"array","items":{"type":"object","properties":{"day":{"type":"integer","minimum":0,"maximum":6},"from":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"to":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["day","from","to"],"additionalProperties":false}}},"required":["starts_at","ends_at","timezone","hours"],"additionalProperties":false},"limits":{"default":{"max_per_visitor":0,"once_per_visit":true},"type":"object","properties":{"max_per_visitor":{"default":0,"type":"integer","minimum":0,"maximum":1000},"once_per_visit":{"default":true,"type":"boolean"}},"required":["max_per_visitor","once_per_visit"],"additionalProperties":false},"template":{"default":null,"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]}},"required":["name","kind","enabled","priority","group_id","agent_id","rules","content","schedule","limits","template"],"additionalProperties":false}},"required":["key","name","description","greeting"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/greetings/templates/{key}:use":{"post":{"summary":"Create a draft campaign from a template","description":"Needs the `campaigns.manage` permission.","tags":["Campaigns"],"security":[{"bearer":[]},{"oauth2":["campaigns.manage"]}],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","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)$"},"name":{"type":"string","minLength":1,"maxLength":120},"kind":{"type":"string","enum":["recurring","one_time"]},"enabled":{"type":"boolean"},"priority":{"type":"integer","minimum":-1000,"maximum":1000},"group_id":{"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"}]},"agent_id":{"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"}]},"rules":{"type":"object","properties":{"audience":{"default":"all","type":"string","enum":["all","new","returning"]},"device":{"default":"all","type":"string","enum":["all","desktop","mobile"]},"trigger":{"default":"page","type":"string","enum":["page","exit_intent"]},"time_on_page_s":{"default":5,"anyOf":[{"type":"integer","minimum":0,"maximum":86400},{"type":"null"}]},"match":{"default":"all","type":"string","enum":["all","any"]},"conditions":{"default":[],"maxItems":30,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","enum":["activity","url","title","any_page","pages_in_order","referrer","country","region","city","time_on_site","time_on_page","pageviews","visits","session_field","device","browser","os","language","cart_value","goal","utm_source","utm_medium","utm_campaign","group"]},"operator":{"type":"string","enum":["is","is_not","contains","not_contains","starts_with","ends_with","matches","gt","lt","exists","not_exists","in","not_in"]},"value":{"anyOf":[{"anyOf":[{"type":"string","maxLength":2048},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":2048}}]},{"type":"null"}]},"key":{"type":"string","maxLength":64}},"required":["field","operator","value"],"additionalProperties":false}}},"required":["audience","device","trigger","time_on_page_s","match","conditions"],"additionalProperties":false},"content":{"type":"object","properties":{"desktop":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"text"},"text":{"type":"string","minLength":1,"maxLength":1024},"message_input":{"default":true,"type":"boolean"}},"required":["type","text","message_input"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"card"},"image_url":{"default":null,"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"title":{"type":"string","minLength":1,"maxLength":256},"subtitle":{"default":null,"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"buttons":{"default":[],"maxItems":4,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"text":{"type":"string","minLength":1,"maxLength":64},"action":{"type":"string","enum":["start_chat","message","url","cancel"]},"value":{"default":"","type":"string","maxLength":2048},"style":{"default":"primary","type":"string","enum":["primary","secondary"]}},"required":["id","text","action","value","style"],"additionalProperties":false}},"message_input":{"default":true,"type":"boolean"}},"required":["type","image_url","title","subtitle","buttons","message_input"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"product"},"image_url":{"default":null,"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"title":{"type":"string","minLength":1,"maxLength":256},"subtitle":{"default":null,"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"price":{"default":null,"anyOf":[{"type":"object","properties":{"amount_cents":{"type":"integer","minimum":0,"maximum":10000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["amount_cents","currency"],"additionalProperties":false},{"type":"null"}]},"url":{"type":"string","format":"uri"},"buttons":{"default":[],"maxItems":4,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"text":{"type":"string","minLength":1,"maxLength":64},"action":{"type":"string","enum":["start_chat","message","url","cancel"]},"value":{"default":"","type":"string","maxLength":2048},"style":{"default":"primary","type":"string","enum":["primary","secondary"]}},"required":["id","text","action","value","style"],"additionalProperties":false}},"message_input":{"default":true,"type":"boolean"}},"required":["type","image_url","title","subtitle","price","url","buttons","message_input"],"additionalProperties":false}]},"mobile":{"default":null,"anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"text"},"text":{"type":"string","minLength":1,"maxLength":1024},"message_input":{"default":true,"type":"boolean"}},"required":["type","text","message_input"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"card"},"image_url":{"default":null,"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"title":{"type":"string","minLength":1,"maxLength":256},"subtitle":{"default":null,"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"buttons":{"default":[],"maxItems":4,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"text":{"type":"string","minLength":1,"maxLength":64},"action":{"type":"string","enum":["start_chat","message","url","cancel"]},"value":{"default":"","type":"string","maxLength":2048},"style":{"default":"primary","type":"string","enum":["primary","secondary"]}},"required":["id","text","action","value","style"],"additionalProperties":false}},"message_input":{"default":true,"type":"boolean"}},"required":["type","image_url","title","subtitle","buttons","message_input"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"product"},"image_url":{"default":null,"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"title":{"type":"string","minLength":1,"maxLength":256},"subtitle":{"default":null,"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"price":{"default":null,"anyOf":[{"type":"object","properties":{"amount_cents":{"type":"integer","minimum":0,"maximum":10000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["amount_cents","currency"],"additionalProperties":false},{"type":"null"}]},"url":{"type":"string","format":"uri"},"buttons":{"default":[],"maxItems":4,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"text":{"type":"string","minLength":1,"maxLength":64},"action":{"type":"string","enum":["start_chat","message","url","cancel"]},"value":{"default":"","type":"string","maxLength":2048},"style":{"default":"primary","type":"string","enum":["primary","secondary"]}},"required":["id","text","action","value","style"],"additionalProperties":false}},"message_input":{"default":true,"type":"boolean"}},"required":["type","image_url","title","subtitle","price","url","buttons","message_input"],"additionalProperties":false}]},{"type":"null"}]}},"required":["desktop","mobile"],"additionalProperties":false},"schedule":{"type":"object","properties":{"starts_at":{"default":null,"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{3}(?:Z))$"},{"type":"null"}]},"ends_at":{"default":null,"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{3}(?:Z))$"},{"type":"null"}]},"timezone":{"default":"UTC","type":"string","minLength":1,"maxLength":64},"hours":{"default":[],"maxItems":28,"type":"array","items":{"type":"object","properties":{"day":{"type":"integer","minimum":0,"maximum":6},"from":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"to":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["day","from","to"],"additionalProperties":false}}},"required":["starts_at","ends_at","timezone","hours"],"additionalProperties":false},"limits":{"type":"object","properties":{"max_per_visitor":{"default":0,"type":"integer","minimum":0,"maximum":1000},"once_per_visit":{"default":true,"type":"boolean"}},"required":["max_per_visitor","once_per_visit"],"additionalProperties":false},"template":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"created_by":{"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"}]},"created_at":{"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{3}(?:Z))$"},"updated_at":{"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{3}(?:Z))$"}},"required":["id","name","kind","enabled","priority","group_id","agent_id","rules","content","schedule","limits","template","created_by","created_at","updated_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/goals":{"get":{"summary":"List goals","description":"Needs the `campaigns.manage` permission.","tags":["Goals"],"security":[{"bearer":[]},{"oauth2":["campaigns.manage"]}],"parameters":[],"responses":{"200":{"description":"OK","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)$"},"name":{"type":"string","minLength":1,"maxLength":120},"rule":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"url"},"operator":{"type":"string","enum":["is","contains","starts_with","ends_with","matches"]},"value":{"type":"string","minLength":1,"maxLength":2048}},"required":["kind","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"event"},"name":{"type":"string","pattern":"^[A-Za-z0-9_.:-]{1,64}$"}},"required":["kind","name"],"additionalProperties":false}]},"value":{"anyOf":[{"type":"object","properties":{"amount_cents":{"type":"integer","minimum":0,"maximum":10000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["amount_cents","currency"],"additionalProperties":false},{"type":"null"}]},"enabled":{"type":"boolean"},"created_at":{"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{3}(?:Z))$"},"updated_at":{"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{3}(?:Z))$"}},"required":["id","name","rule","value","enabled","created_at","updated_at"],"additionalProperties":false}},"next_page_token":{"type":"null"}},"required":["items","next_page_token"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"post":{"summary":"Create a goal","description":"Needs the `campaigns.manage` permission.","tags":["Goals"],"security":[{"bearer":[]},{"oauth2":["campaigns.manage"]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"rule":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"url"},"operator":{"type":"string","enum":["is","contains","starts_with","ends_with","matches"]},"value":{"type":"string","minLength":1,"maxLength":2048}},"required":["kind","operator","value"]},{"type":"object","properties":{"kind":{"type":"string","const":"event"},"name":{"type":"string","pattern":"^[A-Za-z0-9_.:-]{1,64}$"}},"required":["kind","name"]}]},"value":{"default":null,"anyOf":[{"type":"object","properties":{"amount_cents":{"type":"integer","minimum":0,"maximum":10000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["amount_cents","currency"]},{"type":"null"}]},"enabled":{"default":true,"type":"boolean"}},"required":["name","rule"]}}}},"responses":{"201":{"description":"Created","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)$"},"name":{"type":"string","minLength":1,"maxLength":120},"rule":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"url"},"operator":{"type":"string","enum":["is","contains","starts_with","ends_with","matches"]},"value":{"type":"string","minLength":1,"maxLength":2048}},"required":["kind","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"event"},"name":{"type":"string","pattern":"^[A-Za-z0-9_.:-]{1,64}$"}},"required":["kind","name"],"additionalProperties":false}]},"value":{"anyOf":[{"type":"object","properties":{"amount_cents":{"type":"integer","minimum":0,"maximum":10000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["amount_cents","currency"],"additionalProperties":false},{"type":"null"}]},"enabled":{"type":"boolean"},"created_at":{"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{3}(?:Z))$"},"updated_at":{"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{3}(?:Z))$"}},"required":["id","name","rule","value","enabled","created_at","updated_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/goals/{id}":{"get":{"summary":"Get a goal","description":"Needs the `campaigns.manage` permission.","tags":["Goals"],"security":[{"bearer":[]},{"oauth2":["campaigns.manage"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","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)$"},"name":{"type":"string","minLength":1,"maxLength":120},"rule":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"url"},"operator":{"type":"string","enum":["is","contains","starts_with","ends_with","matches"]},"value":{"type":"string","minLength":1,"maxLength":2048}},"required":["kind","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"event"},"name":{"type":"string","pattern":"^[A-Za-z0-9_.:-]{1,64}$"}},"required":["kind","name"],"additionalProperties":false}]},"value":{"anyOf":[{"type":"object","properties":{"amount_cents":{"type":"integer","minimum":0,"maximum":10000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["amount_cents","currency"],"additionalProperties":false},{"type":"null"}]},"enabled":{"type":"boolean"},"created_at":{"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{3}(?:Z))$"},"updated_at":{"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{3}(?:Z))$"}},"required":["id","name","rule","value","enabled","created_at","updated_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"patch":{"summary":"Change a goal","description":"Needs the `campaigns.manage` permission.","tags":["Goals"],"security":[{"bearer":[]},{"oauth2":["campaigns.manage"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"rule":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"url"},"operator":{"type":"string","enum":["is","contains","starts_with","ends_with","matches"]},"value":{"type":"string","minLength":1,"maxLength":2048}},"required":["kind","operator","value"]},{"type":"object","properties":{"kind":{"type":"string","const":"event"},"name":{"type":"string","pattern":"^[A-Za-z0-9_.:-]{1,64}$"}},"required":["kind","name"]}]},"value":{"anyOf":[{"type":"object","properties":{"amount_cents":{"type":"integer","minimum":0,"maximum":10000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["amount_cents","currency"]},{"type":"null"}]},"enabled":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","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)$"},"name":{"type":"string","minLength":1,"maxLength":120},"rule":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"url"},"operator":{"type":"string","enum":["is","contains","starts_with","ends_with","matches"]},"value":{"type":"string","minLength":1,"maxLength":2048}},"required":["kind","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"event"},"name":{"type":"string","pattern":"^[A-Za-z0-9_.:-]{1,64}$"}},"required":["kind","name"],"additionalProperties":false}]},"value":{"anyOf":[{"type":"object","properties":{"amount_cents":{"type":"integer","minimum":0,"maximum":10000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["amount_cents","currency"],"additionalProperties":false},{"type":"null"}]},"enabled":{"type":"boolean"},"created_at":{"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{3}(?:Z))$"},"updated_at":{"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{3}(?:Z))$"}},"required":["id","name","rule","value","enabled","created_at","updated_at"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"delete":{"summary":"Delete a goal","description":"Needs the `campaigns.manage` permission.","tags":["Goals"],"security":[{"bearer":[]},{"oauth2":["campaigns.manage"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done."},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/goals/summary":{"get":{"summary":"Visitors, chats, goals and sales in the last 7 days against the 7 before","description":"Needs the `reports.read` permission.","tags":["Goals"],"security":[{"bearer":[]},{"oauth2":["reports.read"]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"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{3}(?: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{3}(?:Z))$"},"visitors":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"chats":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"goals":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sales":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"orders":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amount_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"attributed_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["currency","orders","amount_cents","attributed_cents"],"additionalProperties":false}},"previous":{"type":"object","properties":{"visitors":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"chats":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"goals":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["visitors","chats","goals"],"additionalProperties":false}},"required":["from","to","visitors","chats","goals","sales","previous"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/goals/conversions":{"get":{"summary":"Goal conversions and sales with their chat attribution","description":"Needs the `reports.read` permission.","tags":["Goals"],"security":[{"bearer":[]},{"oauth2":["reports.read"]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"name":"page_token","in":"query","required":false,"schema":{"type":"string","maxLength":2048}},{"name":"goal_id","in":"query","required":false,"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":"kind","in":"query","required":false,"schema":{"type":"string","enum":["goal","sale"]}},{"name":"from","in":"query","required":false,"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{3}(?:Z))$"}},{"name":"to","in":"query","required":false,"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{3}(?:Z))$"}}],"responses":{"200":{"description":"OK","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)$"},"kind":{"type":"string","enum":["goal","sale"]},"goal_id":{"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"}]},"name":{"type":"string"},"order_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"value":{"anyOf":[{"type":"object","properties":{"amount_cents":{"type":"integer","minimum":0,"maximum":10000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["amount_cents","currency"],"additionalProperties":false},{"type":"null"}]},"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)$"},"at":{"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{3}(?:Z))$"},"chat_id":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},{"type":"null"}]},"agent_ids":{"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)$"}},"group_id":{"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"}]},"greeting_id":{"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"}]}},"required":["id","kind","goal_id","name","order_id","value","customer_id","at","chat_id","agent_ids","group_id","greeting_id"],"additionalProperties":false}},"next_page_token":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["items","next_page_token"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/track":{"post":{"summary":"Report a sale, a goal or a cart change (an API token with customers.write, or the widget's customer token)","description":"Needs the `customers.write` permission.","tags":["Goals"],"security":[{"bearer":[]},{"oauth2":["customers.write"]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"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)$"},"external_user_id":{"type":"string","minLength":1,"maxLength":128},"visitor_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{22,64}$"},"event":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"order_created"},"order_id":{"type":"string","minLength":1,"maxLength":128},"total_cents":{"type":"integer","minimum":0,"maximum":10000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"products":{"default":[],"maxItems":100,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128},"name":{"default":"","type":"string","maxLength":256},"quantity":{"default":1,"type":"integer","minimum":1,"maximum":100000},"price_cents":{"default":0,"type":"integer","minimum":0,"maximum":10000000000000}},"required":["id"]}}},"required":["type","order_id","total_cents","currency"]},{"type":"object","properties":{"type":{"type":"string","const":"product_added"},"product":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128},"name":{"default":"","type":"string","maxLength":256},"quantity":{"default":1,"type":"integer","minimum":1,"maximum":100000},"price_cents":{"default":0,"type":"integer","minimum":0,"maximum":10000000000000}},"required":["id"]},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["type","product"]},{"type":"object","properties":{"type":{"type":"string","const":"product_removed"},"product":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128},"name":{"default":"","type":"string","maxLength":256},"quantity":{"default":1,"type":"integer","minimum":1,"maximum":100000},"price_cents":{"default":0,"type":"integer","minimum":0,"maximum":10000000000000}},"required":["id"]},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["type","product"]},{"type":"object","properties":{"type":{"type":"string","const":"goal"},"name":{"type":"string","pattern":"^[A-Za-z0-9_.:-]{1,64}$"},"value":{"default":null,"anyOf":[{"type":"object","properties":{"amount_cents":{"type":"integer","minimum":0,"maximum":10000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["amount_cents","currency"]},{"type":"null"}]}},"required":["type","name"]}]},"at":{"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{3}(?:Z))$"}},"required":["event"]}}}},"responses":{"202":{"description":"Accepted","content":{"application/json":{"schema":{"type":"object","properties":{"accepted":{"type":"boolean","const":true}},"required":["accepted"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/widget/config":{"get":{"summary":"The widget bootstrap for a license: its published config and the socket URLs","description":"No token.","tags":["Widget"],"security":[],"parameters":[{"name":"license_id","in":"query","required":true,"schema":{"type":"number"}},{"name":"group_id","in":"query","required":false,"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":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"api_url":{"type":"string","format":"uri"},"visitor_url":{"type":"string","pattern":"^wss?:\\/\\/"},"chat_url":{"type":"string","pattern":"^wss?:\\/\\/"},"uploads":{"type":"boolean"}},"required":["config","api_url","visitor_url","chat_url","uploads"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/widget/refused":{"post":{"summary":"The loader reports a host it refused to run on, for the tenant's detected domains","description":"No token.","tags":["Widget"],"security":[],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"license_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"host":{"type":"string","minLength":1,"maxLength":253}},"required":["license_id","host"]}}}},"responses":{"204":{"description":"Done."},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/widget/chat-page-stats":{"get":{"summary":"The hosted chat page's figures, when the tenant shows them there","description":"No token.","tags":["Widget"],"security":[],"parameters":[{"name":"license_id","in":"query","required":true,"schema":{"type":"number"}},{"name":"group_id","in":"query","required":false,"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":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"avg_first_response_s":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["avg_first_response_s"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}}},"webhooks":{"chat.started":{"post":{"summary":"A customer or agent started a chat (a new thread).","description":"Needs the `chats.all` permission to subscribe. Signed: see the `x-c2r-signature` header.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string","const":"chat.started"},"created_at":{"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{3}(?:Z))$"},"sequence":{"type":"integer","minimum":1,"maximum":9007199254740991},"organization_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)$"},"webhook_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)$"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991},"data":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},{"type":"null"}]},"channel":{"type":"string","enum":["widget","chat_page","api","email","whatsapp","messenger","instagram","telegram","line","zalo","viber","wechat","kakaotalk","sms","x","discord","slack","teams","apple_messages"]},"customer_id":{"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"}]},"agent_ids":{"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)$"}},"group_id":{"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"}]},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["chat_id","thread_id","channel","customer_id","agent_ids","group_id","details"],"additionalProperties":false}},"required":["id","event","created_at","organization_id","webhook_id","attempt","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Any 2xx acknowledges the delivery."}}}},"chat.queued":{"post":{"summary":"A chat entered the queue.","description":"Needs the `chats.all` permission to subscribe. Signed: see the `x-c2r-signature` header.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string","const":"chat.queued"},"created_at":{"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{3}(?:Z))$"},"sequence":{"type":"integer","minimum":1,"maximum":9007199254740991},"organization_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)$"},"webhook_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)$"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991},"data":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},{"type":"null"}]},"channel":{"type":"string","enum":["widget","chat_page","api","email","whatsapp","messenger","instagram","telegram","line","zalo","viber","wechat","kakaotalk","sms","x","discord","slack","teams","apple_messages"]},"customer_id":{"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"}]},"agent_ids":{"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)$"}},"group_id":{"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"}]},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["chat_id","thread_id","channel","customer_id","agent_ids","group_id","details"],"additionalProperties":false}},"required":["id","event","created_at","organization_id","webhook_id","attempt","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Any 2xx acknowledges the delivery."}}}},"chat.assigned":{"post":{"summary":"Routing assigned a chat to an agent.","description":"Needs the `chats.all` permission to subscribe. Signed: see the `x-c2r-signature` header.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string","const":"chat.assigned"},"created_at":{"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{3}(?:Z))$"},"sequence":{"type":"integer","minimum":1,"maximum":9007199254740991},"organization_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)$"},"webhook_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)$"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991},"data":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},{"type":"null"}]},"channel":{"type":"string","enum":["widget","chat_page","api","email","whatsapp","messenger","instagram","telegram","line","zalo","viber","wechat","kakaotalk","sms","x","discord","slack","teams","apple_messages"]},"customer_id":{"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"}]},"agent_ids":{"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)$"}},"group_id":{"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"}]},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["chat_id","thread_id","channel","customer_id","agent_ids","group_id","details"],"additionalProperties":false}},"required":["id","event","created_at","organization_id","webhook_id","attempt","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Any 2xx acknowledges the delivery."}}}},"chat.transferred":{"post":{"summary":"A chat was transferred to another agent or group.","description":"Needs the `chats.all` permission to subscribe. Signed: see the `x-c2r-signature` header.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string","const":"chat.transferred"},"created_at":{"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{3}(?:Z))$"},"sequence":{"type":"integer","minimum":1,"maximum":9007199254740991},"organization_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)$"},"webhook_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)$"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991},"data":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},{"type":"null"}]},"channel":{"type":"string","enum":["widget","chat_page","api","email","whatsapp","messenger","instagram","telegram","line","zalo","viber","wechat","kakaotalk","sms","x","discord","slack","teams","apple_messages"]},"customer_id":{"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"}]},"agent_ids":{"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)$"}},"group_id":{"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"}]},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["chat_id","thread_id","channel","customer_id","agent_ids","group_id","details"],"additionalProperties":false}},"required":["id","event","created_at","organization_id","webhook_id","attempt","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Any 2xx acknowledges the delivery."}}}},"chat.unassigned":{"post":{"summary":"A chat lost its agent and waits to be routed again.","description":"Needs the `chats.all` permission to subscribe. Signed: see the `x-c2r-signature` header.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string","const":"chat.unassigned"},"created_at":{"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{3}(?:Z))$"},"sequence":{"type":"integer","minimum":1,"maximum":9007199254740991},"organization_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)$"},"webhook_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)$"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991},"data":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},{"type":"null"}]},"channel":{"type":"string","enum":["widget","chat_page","api","email","whatsapp","messenger","instagram","telegram","line","zalo","viber","wechat","kakaotalk","sms","x","discord","slack","teams","apple_messages"]},"customer_id":{"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"}]},"agent_ids":{"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)$"}},"group_id":{"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"}]},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["chat_id","thread_id","channel","customer_id","agent_ids","group_id","details"],"additionalProperties":false}},"required":["id","event","created_at","organization_id","webhook_id","attempt","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Any 2xx acknowledges the delivery."}}}},"chat.deactivated":{"post":{"summary":"A chat's thread ended without being closed by a person (inactivity).","description":"Needs the `chats.all` permission to subscribe. Signed: see the `x-c2r-signature` header.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string","const":"chat.deactivated"},"created_at":{"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{3}(?:Z))$"},"sequence":{"type":"integer","minimum":1,"maximum":9007199254740991},"organization_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)$"},"webhook_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)$"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991},"data":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},{"type":"null"}]},"channel":{"type":"string","enum":["widget","chat_page","api","email","whatsapp","messenger","instagram","telegram","line","zalo","viber","wechat","kakaotalk","sms","x","discord","slack","teams","apple_messages"]},"customer_id":{"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"}]},"agent_ids":{"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)$"}},"group_id":{"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"}]},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["chat_id","thread_id","channel","customer_id","agent_ids","group_id","details"],"additionalProperties":false}},"required":["id","event","created_at","organization_id","webhook_id","attempt","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Any 2xx acknowledges the delivery."}}}},"chat.closed":{"post":{"summary":"A chat's thread was closed.","description":"Needs the `chats.all` permission to subscribe. Signed: see the `x-c2r-signature` header.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string","const":"chat.closed"},"created_at":{"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{3}(?:Z))$"},"sequence":{"type":"integer","minimum":1,"maximum":9007199254740991},"organization_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)$"},"webhook_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)$"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991},"data":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},{"type":"null"}]},"channel":{"type":"string","enum":["widget","chat_page","api","email","whatsapp","messenger","instagram","telegram","line","zalo","viber","wechat","kakaotalk","sms","x","discord","slack","teams","apple_messages"]},"customer_id":{"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"}]},"agent_ids":{"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)$"}},"group_id":{"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"}]},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["chat_id","thread_id","channel","customer_id","agent_ids","group_id","details"],"additionalProperties":false}},"required":["id","event","created_at","organization_id","webhook_id","attempt","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Any 2xx acknowledges the delivery."}}}},"chat.priority_changed":{"post":{"summary":"A chat's priority changed.","description":"Needs the `chats.all` permission to subscribe. Signed: see the `x-c2r-signature` header.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string","const":"chat.priority_changed"},"created_at":{"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{3}(?:Z))$"},"sequence":{"type":"integer","minimum":1,"maximum":9007199254740991},"organization_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)$"},"webhook_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)$"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991},"data":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},{"type":"null"}]},"channel":{"type":"string","enum":["widget","chat_page","api","email","whatsapp","messenger","instagram","telegram","line","zalo","viber","wechat","kakaotalk","sms","x","discord","slack","teams","apple_messages"]},"customer_id":{"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"}]},"agent_ids":{"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)$"}},"group_id":{"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"}]},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["chat_id","thread_id","channel","customer_id","agent_ids","group_id","details"],"additionalProperties":false}},"required":["id","event","created_at","organization_id","webhook_id","attempt","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Any 2xx acknowledges the delivery."}}}},"goal.achieved":{"post":{"summary":"A visitor in a chat reached a goal.","description":"Needs the `chats.all` permission to subscribe. Signed: see the `x-c2r-signature` header.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string","const":"goal.achieved"},"created_at":{"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{3}(?:Z))$"},"sequence":{"type":"integer","minimum":1,"maximum":9007199254740991},"organization_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)$"},"webhook_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)$"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991},"data":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},{"type":"null"}]},"channel":{"type":"string","enum":["widget","chat_page","api","email","whatsapp","messenger","instagram","telegram","line","zalo","viber","wechat","kakaotalk","sms","x","discord","slack","teams","apple_messages"]},"customer_id":{"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"}]},"agent_ids":{"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)$"}},"group_id":{"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"}]},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["chat_id","thread_id","channel","customer_id","agent_ids","group_id","details"],"additionalProperties":false}},"required":["id","event","created_at","organization_id","webhook_id","attempt","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Any 2xx acknowledges the delivery."}}}},"chat.rated":{"post":{"summary":"The customer rated a chat.","description":"Needs the `chats.all` permission to subscribe. Signed: see the `x-c2r-signature` header.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string","const":"chat.rated"},"created_at":{"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{3}(?:Z))$"},"sequence":{"type":"integer","minimum":1,"maximum":9007199254740991},"organization_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)$"},"webhook_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)$"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991},"data":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},{"type":"null"}]},"channel":{"type":"string","enum":["widget","chat_page","api","email","whatsapp","messenger","instagram","telegram","line","zalo","viber","wechat","kakaotalk","sms","x","discord","slack","teams","apple_messages"]},"customer_id":{"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"}]},"agent_ids":{"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)$"}},"group_id":{"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"}]},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["chat_id","thread_id","channel","customer_id","agent_ids","group_id","details"],"additionalProperties":false}},"required":["id","event","created_at","organization_id","webhook_id","attempt","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Any 2xx acknowledges the delivery."}}}},"chat.user_added":{"post":{"summary":"An agent joined a chat.","description":"Needs the `chats.all` permission to subscribe. Signed: see the `x-c2r-signature` header.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string","const":"chat.user_added"},"created_at":{"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{3}(?:Z))$"},"sequence":{"type":"integer","minimum":1,"maximum":9007199254740991},"organization_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)$"},"webhook_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)$"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991},"data":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},{"type":"null"}]},"user_id":{"type":"string"},"user_type":{"type":"string","enum":["agent","customer"]}},"required":["chat_id","thread_id","user_id","user_type"],"additionalProperties":false}},"required":["id","event","created_at","organization_id","webhook_id","attempt","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Any 2xx acknowledges the delivery."}}}},"chat.user_removed":{"post":{"summary":"An agent left a chat.","description":"Needs the `chats.all` permission to subscribe. Signed: see the `x-c2r-signature` header.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string","const":"chat.user_removed"},"created_at":{"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{3}(?:Z))$"},"sequence":{"type":"integer","minimum":1,"maximum":9007199254740991},"organization_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)$"},"webhook_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)$"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991},"data":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},{"type":"null"}]},"user_id":{"type":"string"}},"required":["chat_id","thread_id","user_id"],"additionalProperties":false}},"required":["id","event","created_at","organization_id","webhook_id","attempt","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Any 2xx acknowledges the delivery."}}}},"chat.properties_updated":{"post":{"summary":"A chat's properties changed.","description":"Needs the `chats.all` permission to subscribe. Signed: see the `x-c2r-signature` header.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string","const":"chat.properties_updated"},"created_at":{"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{3}(?:Z))$"},"sequence":{"type":"integer","minimum":1,"maximum":9007199254740991},"organization_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)$"},"webhook_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)$"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991},"data":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}}},"required":["chat_id","properties"],"additionalProperties":false}},"required":["id","event","created_at","organization_id","webhook_id","attempt","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Any 2xx acknowledges the delivery."}}}},"thread.tagged":{"post":{"summary":"A tag was added to a thread.","description":"Needs the `chats.all` permission to subscribe. Signed: see the `x-c2r-signature` header.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string","const":"thread.tagged"},"created_at":{"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{3}(?:Z))$"},"sequence":{"type":"integer","minimum":1,"maximum":9007199254740991},"organization_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)$"},"webhook_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)$"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991},"data":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},{"type":"null"}]},"channel":{"type":"string","enum":["widget","chat_page","api","email","whatsapp","messenger","instagram","telegram","line","zalo","viber","wechat","kakaotalk","sms","x","discord","slack","teams","apple_messages"]},"customer_id":{"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"}]},"agent_ids":{"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)$"}},"group_id":{"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"}]},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["chat_id","thread_id","channel","customer_id","agent_ids","group_id","details"],"additionalProperties":false}},"required":["id","event","created_at","organization_id","webhook_id","attempt","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Any 2xx acknowledges the delivery."}}}},"thread.untagged":{"post":{"summary":"A tag was removed from a thread.","description":"Needs the `chats.all` permission to subscribe. Signed: see the `x-c2r-signature` header.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string","const":"thread.untagged"},"created_at":{"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{3}(?:Z))$"},"sequence":{"type":"integer","minimum":1,"maximum":9007199254740991},"organization_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)$"},"webhook_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)$"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991},"data":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},{"type":"null"}]},"channel":{"type":"string","enum":["widget","chat_page","api","email","whatsapp","messenger","instagram","telegram","line","zalo","viber","wechat","kakaotalk","sms","x","discord","slack","teams","apple_messages"]},"customer_id":{"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"}]},"agent_ids":{"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)$"}},"group_id":{"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"}]},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["chat_id","thread_id","channel","customer_id","agent_ids","group_id","details"],"additionalProperties":false}},"required":["id","event","created_at","organization_id","webhook_id","attempt","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Any 2xx acknowledges the delivery."}}}},"thread.properties_updated":{"post":{"summary":"A thread's properties changed.","description":"Needs the `chats.all` permission to subscribe. Signed: see the `x-c2r-signature` header.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string","const":"thread.properties_updated"},"created_at":{"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{3}(?:Z))$"},"sequence":{"type":"integer","minimum":1,"maximum":9007199254740991},"organization_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)$"},"webhook_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)$"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991},"data":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},{"type":"null"}]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}}},"required":["chat_id","thread_id","properties"],"additionalProperties":false}},"required":["id","event","created_at","organization_id","webhook_id","attempt","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Any 2xx acknowledges the delivery."}}}},"thread.summary_set":{"post":{"summary":"An AI summary was stored for a thread.","description":"Needs the `chats.all` permission to subscribe. Signed: see the `x-c2r-signature` header.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string","const":"thread.summary_set"},"created_at":{"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{3}(?:Z))$"},"sequence":{"type":"integer","minimum":1,"maximum":9007199254740991},"organization_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)$"},"webhook_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)$"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991},"data":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},{"type":"null"}]},"summary":{"type":"string"}},"required":["chat_id","thread_id","summary"],"additionalProperties":false}},"required":["id","event","created_at","organization_id","webhook_id","attempt","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Any 2xx acknowledges the delivery."}}}},"event.created":{"post":{"summary":"A message, file, form or other event was added to a chat.","description":"Needs the `chats.all` permission to subscribe. Signed: see the `x-c2r-signature` header.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string","const":"event.created"},"created_at":{"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{3}(?:Z))$"},"sequence":{"type":"integer","minimum":1,"maximum":9007199254740991},"organization_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)$"},"webhook_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)$"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991},"data":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},{"type":"null"}]},"event":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"message"},"text":{"type":"string","minLength":1,"maxLength":16384},"postback":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"thread_id":{"type":"string"},"event_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"type":{"type":"string"},"value":{"type":"string"}},"required":["id","thread_id","event_id","type","value"],"additionalProperties":false},{"type":"null"}]}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","text","postback"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"system"},"subtype":{"type":"string","pattern":"^[a-z_]+(\\.[a-z_]+)+$"},"text":{"type":"string","maxLength":1024},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","subtype","text","details"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"file"},"file_key":{"type":"string","maxLength":512},"name":{"type":"string","maxLength":255},"content_type":{"type":"string","maxLength":127},"size":{"type":"integer","minimum":0,"maximum":9007199254740991},"width":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"height":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"alternative_text":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}]}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","file_key","name","content_type","size","width","height","alternative_text"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"rich_message"},"template":{"type":"string","enum":["cards","quick_replies","sticker"]},"elements":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"title":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"subtitle":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"image_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"buttons":{"maxItems":13,"type":"array","items":{"type":"object","properties":{"text":{"type":"string","maxLength":128},"type":{"type":"string","enum":["message","url","webview","phone","cancel"]},"value":{"type":"string","maxLength":2048},"postback_id":{"type":"string","maxLength":64}},"required":["text","type","value","postback_id"],"additionalProperties":false}}},"required":["title","subtitle","image_url","buttons"],"additionalProperties":false}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","template","elements"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"form"},"form_id":{"type":"string"},"form_kind":{"type":"string","enum":["prechat","postchat","ask_for_email","custom"]},"fields":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"type":{"type":"string","enum":["name","email","text","textarea","select","checkbox","radio","rating","phone"]},"label":{"type":"string","maxLength":512},"required":{"type":"boolean"},"options":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":256}}},"required":["id","type","label","required","options"],"additionalProperties":false}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","form_id","form_kind","fields"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"filled_form"},"form_id":{"type":"string"},"form_kind":{"type":"string","enum":["prechat","postchat","ask_for_email","custom"]},"answers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"answer":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["id","label","answer"],"additionalProperties":false}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","form_id","form_kind","answers"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"custom"},"content":{}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","content"],"additionalProperties":false}]}},"required":["chat_id","thread_id","event"],"additionalProperties":false}},"required":["id","event","created_at","organization_id","webhook_id","attempt","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Any 2xx acknowledges the delivery."}}}},"event.updated":{"post":{"summary":"An event was edited.","description":"Needs the `chats.all` permission to subscribe. Signed: see the `x-c2r-signature` header.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string","const":"event.updated"},"created_at":{"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{3}(?:Z))$"},"sequence":{"type":"integer","minimum":1,"maximum":9007199254740991},"organization_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)$"},"webhook_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)$"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991},"data":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},{"type":"null"}]},"event":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"message"},"text":{"type":"string","minLength":1,"maxLength":16384},"postback":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"thread_id":{"type":"string"},"event_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"type":{"type":"string"},"value":{"type":"string"}},"required":["id","thread_id","event_id","type","value"],"additionalProperties":false},{"type":"null"}]}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","text","postback"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"system"},"subtype":{"type":"string","pattern":"^[a-z_]+(\\.[a-z_]+)+$"},"text":{"type":"string","maxLength":1024},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","subtype","text","details"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"file"},"file_key":{"type":"string","maxLength":512},"name":{"type":"string","maxLength":255},"content_type":{"type":"string","maxLength":127},"size":{"type":"integer","minimum":0,"maximum":9007199254740991},"width":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"height":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"alternative_text":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}]}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","file_key","name","content_type","size","width","height","alternative_text"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"rich_message"},"template":{"type":"string","enum":["cards","quick_replies","sticker"]},"elements":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"title":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"subtitle":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"image_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"buttons":{"maxItems":13,"type":"array","items":{"type":"object","properties":{"text":{"type":"string","maxLength":128},"type":{"type":"string","enum":["message","url","webview","phone","cancel"]},"value":{"type":"string","maxLength":2048},"postback_id":{"type":"string","maxLength":64}},"required":["text","type","value","postback_id"],"additionalProperties":false}}},"required":["title","subtitle","image_url","buttons"],"additionalProperties":false}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","template","elements"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"form"},"form_id":{"type":"string"},"form_kind":{"type":"string","enum":["prechat","postchat","ask_for_email","custom"]},"fields":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"type":{"type":"string","enum":["name","email","text","textarea","select","checkbox","radio","rating","phone"]},"label":{"type":"string","maxLength":512},"required":{"type":"boolean"},"options":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":256}}},"required":["id","type","label","required","options"],"additionalProperties":false}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","form_id","form_kind","fields"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"filled_form"},"form_id":{"type":"string"},"form_kind":{"type":"string","enum":["prechat","postchat","ask_for_email","custom"]},"answers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"answer":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["id","label","answer"],"additionalProperties":false}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","form_id","form_kind","answers"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"custom"},"content":{}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","content"],"additionalProperties":false}]}},"required":["chat_id","thread_id","event"],"additionalProperties":false}},"required":["id","event","created_at","organization_id","webhook_id","attempt","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Any 2xx acknowledges the delivery."}}}},"event.deleted":{"post":{"summary":"An event was deleted.","description":"Needs the `chats.all` permission to subscribe. Signed: see the `x-c2r-signature` header.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string","const":"event.deleted"},"created_at":{"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{3}(?:Z))$"},"sequence":{"type":"integer","minimum":1,"maximum":9007199254740991},"organization_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)$"},"webhook_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)$"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991},"data":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},{"type":"null"}]},"event_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"}},"required":["chat_id","thread_id","event_id"],"additionalProperties":false}},"required":["id","event","created_at","organization_id","webhook_id","attempt","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Any 2xx acknowledges the delivery."}}}},"event.seen":{"post":{"summary":"A chat member read events up to a time.","description":"Needs the `chats.all` permission to subscribe. Signed: see the `x-c2r-signature` header.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string","const":"event.seen"},"created_at":{"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{3}(?:Z))$"},"sequence":{"type":"integer","minimum":1,"maximum":9007199254740991},"organization_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)$"},"webhook_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)$"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991},"data":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"user_id":{"type":"string"},"seen_up_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{3}(?:Z))$"}},"required":["chat_id","user_id","seen_up_to"],"additionalProperties":false}},"required":["id","event","created_at","organization_id","webhook_id","attempt","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Any 2xx acknowledges the delivery."}}}},"ticket.created":{"post":{"summary":"A ticket was created.","description":"Needs the `chats.all` permission to subscribe. Signed: see the `x-c2r-signature` header.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string","const":"ticket.created"},"created_at":{"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{3}(?:Z))$"},"sequence":{"type":"integer","minimum":1,"maximum":9007199254740991},"organization_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)$"},"webhook_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)$"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991},"data":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},{"type":"null"}]},"channel":{"type":"string","enum":["widget","chat_page","api","email","whatsapp","messenger","instagram","telegram","line","zalo","viber","wechat","kakaotalk","sms","x","discord","slack","teams","apple_messages"]},"customer_id":{"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"}]},"agent_ids":{"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)$"}},"group_id":{"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"}]},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["chat_id","thread_id","channel","customer_id","agent_ids","group_id","details"],"additionalProperties":false}},"required":["id","event","created_at","organization_id","webhook_id","attempt","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Any 2xx acknowledges the delivery."}}}},"ticket.updated":{"post":{"summary":"A ticket's status, assignee or priority changed.","description":"Needs the `chats.all` permission to subscribe. Signed: see the `x-c2r-signature` header.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string","const":"ticket.updated"},"created_at":{"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{3}(?:Z))$"},"sequence":{"type":"integer","minimum":1,"maximum":9007199254740991},"organization_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)$"},"webhook_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)$"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991},"data":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},{"type":"null"}]},"channel":{"type":"string","enum":["widget","chat_page","api","email","whatsapp","messenger","instagram","telegram","line","zalo","viber","wechat","kakaotalk","sms","x","discord","slack","teams","apple_messages"]},"customer_id":{"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"}]},"agent_ids":{"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)$"}},"group_id":{"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"}]},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["chat_id","thread_id","channel","customer_id","agent_ids","group_id","details"],"additionalProperties":false}},"required":["id","event","created_at","organization_id","webhook_id","attempt","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Any 2xx acknowledges the delivery."}}}},"customer.created":{"post":{"summary":"A new customer was recorded.","description":"Needs the `customers.read` permission to subscribe. Signed: see the `x-c2r-signature` header.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string","const":"customer.created"},"created_at":{"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{3}(?:Z))$"},"sequence":{"type":"integer","minimum":1,"maximum":9007199254740991},"organization_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)$"},"webhook_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)$"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991},"data":{"type":"object","properties":{"customer":{"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)$"},"organization_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)$"},"visitor_id":{"anyOf":[{"type":"string","minLength":8,"maxLength":64},{"type":"null"}]},"external_user_id":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}]},"name":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"email":{"anyOf":[{"type":"string","maxLength":254,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}]},"avatar_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"session_fields":{"maxItems":50,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","maxLength":64},{"type":"string","maxLength":512}]}},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"first_seen_at":{"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{3}(?:Z))$"},"last_seen_at":{"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{3}(?:Z))$"},"banned_until":{"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{3}(?:Z))$"},{"type":"null"}]}},"required":["id","organization_id","visitor_id","external_user_id","name","email","phone","avatar_url","session_fields","properties","first_seen_at","last_seen_at","banned_until"],"additionalProperties":false}},"required":["customer"],"additionalProperties":false}},"required":["id","event","created_at","organization_id","webhook_id","attempt","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Any 2xx acknowledges the delivery."}}}},"customer.updated":{"post":{"summary":"A customer's details changed.","description":"Needs the `customers.read` permission to subscribe. Signed: see the `x-c2r-signature` header.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string","const":"customer.updated"},"created_at":{"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{3}(?:Z))$"},"sequence":{"type":"integer","minimum":1,"maximum":9007199254740991},"organization_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)$"},"webhook_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)$"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991},"data":{"type":"object","properties":{"customer":{"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)$"},"organization_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)$"},"visitor_id":{"anyOf":[{"type":"string","minLength":8,"maxLength":64},{"type":"null"}]},"external_user_id":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}]},"name":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"email":{"anyOf":[{"type":"string","maxLength":254,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}]},"avatar_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"session_fields":{"maxItems":50,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","maxLength":64},{"type":"string","maxLength":512}]}},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"first_seen_at":{"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{3}(?:Z))$"},"last_seen_at":{"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{3}(?:Z))$"},"banned_until":{"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{3}(?:Z))$"},{"type":"null"}]}},"required":["id","organization_id","visitor_id","external_user_id","name","email","phone","avatar_url","session_fields","properties","first_seen_at","last_seen_at","banned_until"],"additionalProperties":false}},"required":["customer"],"additionalProperties":false}},"required":["id","event","created_at","organization_id","webhook_id","attempt","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Any 2xx acknowledges the delivery."}}}},"customer.identified":{"post":{"summary":"A visitor was matched to a known customer.","description":"Needs the `customers.read` permission to subscribe. Signed: see the `x-c2r-signature` header.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string","const":"customer.identified"},"created_at":{"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{3}(?:Z))$"},"sequence":{"type":"integer","minimum":1,"maximum":9007199254740991},"organization_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)$"},"webhook_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)$"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991},"data":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},{"type":"null"}]},"channel":{"type":"string","enum":["widget","chat_page","api","email","whatsapp","messenger","instagram","telegram","line","zalo","viber","wechat","kakaotalk","sms","x","discord","slack","teams","apple_messages"]},"customer_id":{"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"}]},"agent_ids":{"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)$"}},"group_id":{"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"}]},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["chat_id","thread_id","channel","customer_id","agent_ids","group_id","details"],"additionalProperties":false}},"required":["id","event","created_at","organization_id","webhook_id","attempt","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Any 2xx acknowledges the delivery."}}}},"customer.banned":{"post":{"summary":"A customer was banned.","description":"Needs the `customers.read` permission to subscribe. Signed: see the `x-c2r-signature` header.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string","const":"customer.banned"},"created_at":{"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{3}(?:Z))$"},"sequence":{"type":"integer","minimum":1,"maximum":9007199254740991},"organization_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)$"},"webhook_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)$"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991},"data":{"type":"object","properties":{"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)$"},"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{3}(?:Z))$"}},"required":["customer_id","until"],"additionalProperties":false}},"required":["id","event","created_at","organization_id","webhook_id","attempt","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Any 2xx acknowledges the delivery."}}}},"agent.status_changed":{"post":{"summary":"An agent's routing status changed.","description":"Needs the `team.read` permission to subscribe. Signed: see the `x-c2r-signature` header.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string","const":"agent.status_changed"},"created_at":{"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{3}(?:Z))$"},"sequence":{"type":"integer","minimum":1,"maximum":9007199254740991},"organization_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)$"},"webhook_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)$"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991},"data":{"type":"object","properties":{"agent_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":["accepting_chats","not_accepting_chats","offline"]}},"required":["agent_id","status"],"additionalProperties":false}},"required":["id","event","created_at","organization_id","webhook_id","attempt","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Any 2xx acknowledges the delivery."}}}},"agent.created":{"post":{"summary":"An agent was created.","description":"Needs the `team.read` permission to subscribe. Signed: see the `x-c2r-signature` header.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string","const":"agent.created"},"created_at":{"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{3}(?:Z))$"},"sequence":{"type":"integer","minimum":1,"maximum":9007199254740991},"organization_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)$"},"webhook_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)$"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991},"data":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false,"description":"The agent id; fetch it from the API for its current state."}},"required":["id","event","created_at","organization_id","webhook_id","attempt","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Any 2xx acknowledges the delivery."}}}},"agent.updated":{"post":{"summary":"An agent was changed.","description":"Needs the `team.read` permission to subscribe. Signed: see the `x-c2r-signature` header.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string","const":"agent.updated"},"created_at":{"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{3}(?:Z))$"},"sequence":{"type":"integer","minimum":1,"maximum":9007199254740991},"organization_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)$"},"webhook_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)$"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991},"data":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false,"description":"The agent id; fetch it from the API for its current state."}},"required":["id","event","created_at","organization_id","webhook_id","attempt","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Any 2xx acknowledges the delivery."}}}},"agent.deleted":{"post":{"summary":"An agent was deleted.","description":"Needs the `team.read` permission to subscribe. Signed: see the `x-c2r-signature` header.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string","const":"agent.deleted"},"created_at":{"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{3}(?:Z))$"},"sequence":{"type":"integer","minimum":1,"maximum":9007199254740991},"organization_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)$"},"webhook_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)$"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991},"data":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false,"description":"The agent id; fetch it from the API for its current state."}},"required":["id","event","created_at","organization_id","webhook_id","attempt","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Any 2xx acknowledges the delivery."}}}},"group.created":{"post":{"summary":"A group was created.","description":"Needs the `team.read` permission to subscribe. Signed: see the `x-c2r-signature` header.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string","const":"group.created"},"created_at":{"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{3}(?:Z))$"},"sequence":{"type":"integer","minimum":1,"maximum":9007199254740991},"organization_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)$"},"webhook_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)$"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991},"data":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false,"description":"The group id; fetch it from the API for its current state."}},"required":["id","event","created_at","organization_id","webhook_id","attempt","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Any 2xx acknowledges the delivery."}}}},"group.updated":{"post":{"summary":"A group was changed.","description":"Needs the `team.read` permission to subscribe. Signed: see the `x-c2r-signature` header.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string","const":"group.updated"},"created_at":{"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{3}(?:Z))$"},"sequence":{"type":"integer","minimum":1,"maximum":9007199254740991},"organization_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)$"},"webhook_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)$"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991},"data":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false,"description":"The group id; fetch it from the API for its current state."}},"required":["id","event","created_at","organization_id","webhook_id","attempt","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Any 2xx acknowledges the delivery."}}}},"group.deleted":{"post":{"summary":"A group was deleted.","description":"Needs the `team.read` permission to subscribe. Signed: see the `x-c2r-signature` header.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string","const":"group.deleted"},"created_at":{"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{3}(?:Z))$"},"sequence":{"type":"integer","minimum":1,"maximum":9007199254740991},"organization_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)$"},"webhook_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)$"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991},"data":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false,"description":"The group id; fetch it from the API for its current state."}},"required":["id","event","created_at","organization_id","webhook_id","attempt","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Any 2xx acknowledges the delivery."}}}},"tag.created":{"post":{"summary":"A tag was created.","description":"Needs the `chats.access` permission to subscribe. Signed: see the `x-c2r-signature` header.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string","const":"tag.created"},"created_at":{"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{3}(?:Z))$"},"sequence":{"type":"integer","minimum":1,"maximum":9007199254740991},"organization_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)$"},"webhook_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)$"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991},"data":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false,"description":"The tag id; fetch it from the API for its current state."}},"required":["id","event","created_at","organization_id","webhook_id","attempt","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Any 2xx acknowledges the delivery."}}}},"tag.updated":{"post":{"summary":"A tag was changed.","description":"Needs the `chats.access` permission to subscribe. Signed: see the `x-c2r-signature` header.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string","const":"tag.updated"},"created_at":{"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{3}(?:Z))$"},"sequence":{"type":"integer","minimum":1,"maximum":9007199254740991},"organization_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)$"},"webhook_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)$"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991},"data":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false,"description":"The tag id; fetch it from the API for its current state."}},"required":["id","event","created_at","organization_id","webhook_id","attempt","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Any 2xx acknowledges the delivery."}}}},"tag.deleted":{"post":{"summary":"A tag was deleted.","description":"Needs the `chats.access` permission to subscribe. Signed: see the `x-c2r-signature` header.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string","const":"tag.deleted"},"created_at":{"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{3}(?:Z))$"},"sequence":{"type":"integer","minimum":1,"maximum":9007199254740991},"organization_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)$"},"webhook_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)$"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991},"data":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false,"description":"The tag id; fetch it from the API for its current state."}},"required":["id","event","created_at","organization_id","webhook_id","attempt","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Any 2xx acknowledges the delivery."}}}},"canned_response.created":{"post":{"summary":"A canned response was created.","description":"Needs the `chats.access` permission to subscribe. Signed: see the `x-c2r-signature` header.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string","const":"canned_response.created"},"created_at":{"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{3}(?:Z))$"},"sequence":{"type":"integer","minimum":1,"maximum":9007199254740991},"organization_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)$"},"webhook_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)$"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991},"data":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false,"description":"The canned_response id; fetch it from the API for its current state."}},"required":["id","event","created_at","organization_id","webhook_id","attempt","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Any 2xx acknowledges the delivery."}}}},"canned_response.updated":{"post":{"summary":"A canned response was changed.","description":"Needs the `chats.access` permission to subscribe. Signed: see the `x-c2r-signature` header.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string","const":"canned_response.updated"},"created_at":{"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{3}(?:Z))$"},"sequence":{"type":"integer","minimum":1,"maximum":9007199254740991},"organization_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)$"},"webhook_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)$"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991},"data":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false,"description":"The canned_response id; fetch it from the API for its current state."}},"required":["id","event","created_at","organization_id","webhook_id","attempt","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Any 2xx acknowledges the delivery."}}}},"canned_response.deleted":{"post":{"summary":"A canned response was deleted.","description":"Needs the `chats.access` permission to subscribe. Signed: see the `x-c2r-signature` header.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string","const":"canned_response.deleted"},"created_at":{"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{3}(?:Z))$"},"sequence":{"type":"integer","minimum":1,"maximum":9007199254740991},"organization_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)$"},"webhook_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)$"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991},"data":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false,"description":"The canned_response id; fetch it from the API for its current state."}},"required":["id","event","created_at","organization_id","webhook_id","attempt","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Any 2xx acknowledges the delivery."}}}},"routing_rule.created":{"post":{"summary":"A routing rule was created.","description":"Needs the `settings.manage` permission to subscribe. Signed: see the `x-c2r-signature` header.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string","const":"routing_rule.created"},"created_at":{"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{3}(?:Z))$"},"sequence":{"type":"integer","minimum":1,"maximum":9007199254740991},"organization_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)$"},"webhook_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)$"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991},"data":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false,"description":"The routing_rule id; fetch it from the API for its current state."}},"required":["id","event","created_at","organization_id","webhook_id","attempt","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Any 2xx acknowledges the delivery."}}}},"routing_rule.updated":{"post":{"summary":"A routing rule was changed.","description":"Needs the `settings.manage` permission to subscribe. Signed: see the `x-c2r-signature` header.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string","const":"routing_rule.updated"},"created_at":{"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{3}(?:Z))$"},"sequence":{"type":"integer","minimum":1,"maximum":9007199254740991},"organization_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)$"},"webhook_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)$"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991},"data":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false,"description":"The routing_rule id; fetch it from the API for its current state."}},"required":["id","event","created_at","organization_id","webhook_id","attempt","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Any 2xx acknowledges the delivery."}}}},"routing_rule.deleted":{"post":{"summary":"A routing rule was deleted.","description":"Needs the `settings.manage` permission to subscribe. Signed: see the `x-c2r-signature` header.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string","const":"routing_rule.deleted"},"created_at":{"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{3}(?:Z))$"},"sequence":{"type":"integer","minimum":1,"maximum":9007199254740991},"organization_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)$"},"webhook_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)$"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991},"data":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false,"description":"The routing_rule id; fetch it from the API for its current state."}},"required":["id","event","created_at","organization_id","webhook_id","attempt","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Any 2xx acknowledges the delivery."}}}},"greeting.created":{"post":{"summary":"A greeting was created.","description":"Needs the `campaigns.manage` permission to subscribe. Signed: see the `x-c2r-signature` header.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string","const":"greeting.created"},"created_at":{"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{3}(?:Z))$"},"sequence":{"type":"integer","minimum":1,"maximum":9007199254740991},"organization_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)$"},"webhook_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)$"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991},"data":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false,"description":"The greeting id; fetch it from the API for its current state."}},"required":["id","event","created_at","organization_id","webhook_id","attempt","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Any 2xx acknowledges the delivery."}}}},"greeting.updated":{"post":{"summary":"A greeting was changed.","description":"Needs the `campaigns.manage` permission to subscribe. Signed: see the `x-c2r-signature` header.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string","const":"greeting.updated"},"created_at":{"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{3}(?:Z))$"},"sequence":{"type":"integer","minimum":1,"maximum":9007199254740991},"organization_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)$"},"webhook_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)$"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991},"data":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false,"description":"The greeting id; fetch it from the API for its current state."}},"required":["id","event","created_at","organization_id","webhook_id","attempt","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Any 2xx acknowledges the delivery."}}}},"greeting.deleted":{"post":{"summary":"A greeting was deleted.","description":"Needs the `campaigns.manage` permission to subscribe. Signed: see the `x-c2r-signature` header.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string","const":"greeting.deleted"},"created_at":{"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{3}(?:Z))$"},"sequence":{"type":"integer","minimum":1,"maximum":9007199254740991},"organization_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)$"},"webhook_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)$"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991},"data":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false,"description":"The greeting id; fetch it from the API for its current state."}},"required":["id","event","created_at","organization_id","webhook_id","attempt","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Any 2xx acknowledges the delivery."}}}},"settings.updated":{"post":{"summary":"Organization or widget settings changed.","description":"Needs the `settings.manage` permission to subscribe. Signed: see the `x-c2r-signature` header.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string","const":"settings.updated"},"created_at":{"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{3}(?:Z))$"},"sequence":{"type":"integer","minimum":1,"maximum":9007199254740991},"organization_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)$"},"webhook_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)$"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991},"data":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false,"description":"The settings id; fetch it from the API for its current state."}},"required":["id","event","created_at","organization_id","webhook_id","attempt","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Any 2xx acknowledges the delivery."}}}},"webhook.test":{"post":{"summary":"A test delivery, sent from the API or the Settings page.","description":"Needs the `developers.manage` permission to subscribe. Signed: see the `x-c2r-signature` header.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string","const":"webhook.test"},"created_at":{"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{3}(?:Z))$"},"sequence":{"type":"integer","minimum":1,"maximum":9007199254740991},"organization_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)$"},"webhook_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)$"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991},"data":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}},"required":["id","event","created_at","organization_id","webhook_id","attempt","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Any 2xx acknowledges the delivery."}}}}},"x-realtime":{"protocol_version":1,"agent":{"actions":{"login":{"request":{"type":"object","properties":{"last_seq":{"type":"integer","minimum":0,"maximum":9007199254740991},"application":{"type":"object","properties":{"name":{"type":"string","maxLength":64},"version":{"type":"string","maxLength":32}},"required":["name","version"]},"away":{"default":false,"type":"boolean"}},"required":["application"]},"response":{"type":"object","properties":{"organization":{"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)$"},"license_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"name":{"type":"string","minLength":1,"maxLength":120},"region":{"type":"string","enum":["apac","eu","us"]},"plan":{"type":"string"},"created_at":{"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{3}(?:Z))$"}},"required":["id","license_id","name","region","plan","created_at"],"additionalProperties":false},"me":{"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)$"},"organization_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":["agent","bot"]},"email":{"anyOf":[{"type":"string","maxLength":254,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]},"name":{"type":"string","minLength":1,"maxLength":120},"job_title":{"type":"string","maxLength":120},"avatar_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"role":{"type":"string","enum":["owner","viceowner","admin","agent"]},"max_chats":{"type":"integer","minimum":0,"maximum":100},"status":{"type":"string","enum":["active","suspended","awaiting_approval"]},"routing_status":{"type":"string","enum":["accepting_chats","not_accepting_chats","offline"]},"group_ids":{"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)$"}},"created_at":{"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{3}(?:Z))$"}},"required":["id","organization_id","kind","email","name","job_title","avatar_url","role","max_chats","status","routing_status","group_ids","created_at"],"additionalProperties":false},"chats":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"channel":{"type":"string","enum":["widget","chat_page","api","email","whatsapp","messenger","instagram","telegram","line","zalo","viber","wechat","kakaotalk","sms","x","discord","slack","teams","apple_messages"]},"status":{"type":"string","enum":["queued","pending","active","inactive","archived"]},"customer":{"type":"object","properties":{"id":{"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"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"type":"string","maxLength":254,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]}},"required":["id","name","email"],"additionalProperties":false},"assignee_id":{"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"}]},"group_ids":{"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)$"}},"agent_ids":{"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)$"}},"supervisor_ids":{"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)$"}},"last_thread_id":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},{"type":"null"}]},"last_event_preview":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"last_event_at":{"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{3}(?:Z))$"},{"type":"null"}]},"last_event_author_type":{"anyOf":[{"type":"string","enum":["agent","customer","system"]},{"type":"null"}]},"unread_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"tags":{"type":"array","items":{"type":"string"}},"queue":{"anyOf":[{"type":"object","properties":{"position":{"type":"integer","minimum":1,"maximum":9007199254740991},"wait_time_s":{"type":"integer","minimum":0,"maximum":9007199254740991},"queued_at":{"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{3}(?:Z))$"}},"required":["position","wait_time_s","queued_at"],"additionalProperties":false},{"type":"null"}]},"rating":{"anyOf":[{"type":"string","enum":["good","bad"]},{"type":"null"}]},"close_reason":{"anyOf":[{"type":"string","enum":["closed_by_agent","closed_by_customer","inactivity","customer_left","customer_banned"]},{"type":"null"}]},"created_at":{"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{3}(?:Z))$"}},"required":["id","channel","status","customer","assignee_id","group_ids","agent_ids","supervisor_ids","last_thread_id","last_event_preview","last_event_at","last_event_author_type","unread_count","tags","queue","rating","close_reason","created_at"],"additionalProperties":false}},"resumed":{"type":"boolean"},"seq":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["organization","me","chats","resumed","seq"],"additionalProperties":false}},"logout":{"request":{"type":"object","properties":{}},"response":{"type":"object","properties":{},"additionalProperties":false}},"ping":{"request":{"type":"object","properties":{}},"response":{"type":"object","properties":{},"additionalProperties":false}},"set_routing_status":{"request":{"type":"object","properties":{"status":{"type":"string","enum":["accepting_chats","not_accepting_chats","offline"]},"agent_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)$"}},"required":["status"]},"response":{"type":"object","properties":{},"additionalProperties":false}},"set_away":{"request":{"type":"object","properties":{"away":{"type":"boolean"}},"required":["away"]},"response":{"type":"object","properties":{},"additionalProperties":false}},"list_routing_statuses":{"request":{"type":"object","properties":{"group_ids":{"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)$"}}}},"response":{"type":"object","properties":{"statuses":{"type":"array","items":{"type":"object","properties":{"agent_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)$"},"name":{"type":"string"},"avatar_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"status":{"type":"string","enum":["accepting_chats","not_accepting_chats","offline"]},"connected":{"type":"boolean"},"active_chats":{"type":"integer","minimum":0,"maximum":9007199254740991},"max_chats":{"type":"integer","minimum":0,"maximum":9007199254740991},"group_ids":{"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":["agent_id","name","avatar_url","status","connected","active_chats","max_chats","group_ids"],"additionalProperties":false}}},"required":["statuses"],"additionalProperties":false}},"list_chats":{"request":{"type":"object","properties":{"status":{"type":"array","items":{"type":"string","enum":["queued","pending","active","inactive","archived"]}},"group_ids":{"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)$"}},"page_token":{"type":"string"},"limit":{"type":"integer","minimum":1,"maximum":100}}},"response":{"type":"object","properties":{"chats":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"channel":{"type":"string","enum":["widget","chat_page","api","email","whatsapp","messenger","instagram","telegram","line","zalo","viber","wechat","kakaotalk","sms","x","discord","slack","teams","apple_messages"]},"status":{"type":"string","enum":["queued","pending","active","inactive","archived"]},"customer":{"type":"object","properties":{"id":{"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"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"type":"string","maxLength":254,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]}},"required":["id","name","email"],"additionalProperties":false},"assignee_id":{"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"}]},"group_ids":{"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)$"}},"agent_ids":{"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)$"}},"supervisor_ids":{"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)$"}},"last_thread_id":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},{"type":"null"}]},"last_event_preview":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"last_event_at":{"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{3}(?:Z))$"},{"type":"null"}]},"last_event_author_type":{"anyOf":[{"type":"string","enum":["agent","customer","system"]},{"type":"null"}]},"unread_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"tags":{"type":"array","items":{"type":"string"}},"queue":{"anyOf":[{"type":"object","properties":{"position":{"type":"integer","minimum":1,"maximum":9007199254740991},"wait_time_s":{"type":"integer","minimum":0,"maximum":9007199254740991},"queued_at":{"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{3}(?:Z))$"}},"required":["position","wait_time_s","queued_at"],"additionalProperties":false},{"type":"null"}]},"rating":{"anyOf":[{"type":"string","enum":["good","bad"]},{"type":"null"}]},"close_reason":{"anyOf":[{"type":"string","enum":["closed_by_agent","closed_by_customer","inactivity","customer_left","customer_banned"]},{"type":"null"}]},"created_at":{"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{3}(?:Z))$"}},"required":["id","channel","status","customer","assignee_id","group_ids","agent_ids","supervisor_ids","last_thread_id","last_event_preview","last_event_at","last_event_author_type","unread_count","tags","queue","rating","close_reason","created_at"],"additionalProperties":false}},"next_page_token":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["chats","next_page_token"],"additionalProperties":false}},"get_chat":{"request":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"limit":{"default":100,"type":"integer","minimum":1,"maximum":500},"cursor":{"type":"string","maxLength":2048}},"required":["chat_id"]},"response":{"type":"object","properties":{"chat":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"organization_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)$"},"channel":{"type":"string","enum":["widget","chat_page","api","email","whatsapp","messenger","instagram","telegram","line","zalo","viber","wechat","kakaotalk","sms","x","discord","slack","teams","apple_messages"]},"status":{"type":"string","enum":["queued","pending","active","inactive","archived"]},"customer_id":{"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"}]},"assignee_id":{"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"}]},"users":{"type":"array","items":{"type":"object","properties":{"id":{"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":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-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":{"type":"string","enum":["agent","customer"]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"avatar_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"present":{"type":"boolean"},"events_seen_up_to":{"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{3}(?:Z))$"},{"type":"null"}]},"visibility":{"type":"string","enum":["all","agents"]}},"required":["id","type","name","avatar_url","present","events_seen_up_to","visibility"],"additionalProperties":false}},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"group_ids":{"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)$"}},"thread":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"active":{"type":"boolean"},"user_ids":{"type":"array","items":{"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":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}]}},"events":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"message"},"text":{"type":"string","minLength":1,"maxLength":16384},"postback":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"thread_id":{"type":"string"},"event_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"type":{"type":"string"},"value":{"type":"string"}},"required":["id","thread_id","event_id","type","value"],"additionalProperties":false},{"type":"null"}]}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","text","postback"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"system"},"subtype":{"type":"string","pattern":"^[a-z_]+(\\.[a-z_]+)+$"},"text":{"type":"string","maxLength":1024},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","subtype","text","details"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"file"},"file_key":{"type":"string","maxLength":512},"name":{"type":"string","maxLength":255},"content_type":{"type":"string","maxLength":127},"size":{"type":"integer","minimum":0,"maximum":9007199254740991},"width":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"height":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"alternative_text":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}]}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","file_key","name","content_type","size","width","height","alternative_text"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"rich_message"},"template":{"type":"string","enum":["cards","quick_replies","sticker"]},"elements":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"title":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"subtitle":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"image_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"buttons":{"maxItems":13,"type":"array","items":{"type":"object","properties":{"text":{"type":"string","maxLength":128},"type":{"type":"string","enum":["message","url","webview","phone","cancel"]},"value":{"type":"string","maxLength":2048},"postback_id":{"type":"string","maxLength":64}},"required":["text","type","value","postback_id"],"additionalProperties":false}}},"required":["title","subtitle","image_url","buttons"],"additionalProperties":false}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","template","elements"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"form"},"form_id":{"type":"string"},"form_kind":{"type":"string","enum":["prechat","postchat","ask_for_email","custom"]},"fields":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"type":{"type":"string","enum":["name","email","text","textarea","select","checkbox","radio","rating","phone"]},"label":{"type":"string","maxLength":512},"required":{"type":"boolean"},"options":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":256}}},"required":["id","type","label","required","options"],"additionalProperties":false}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","form_id","form_kind","fields"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"filled_form"},"form_id":{"type":"string"},"form_kind":{"type":"string","enum":["prechat","postchat","ask_for_email","custom"]},"answers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"answer":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["id","label","answer"],"additionalProperties":false}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","form_id","form_kind","answers"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"custom"},"content":{}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","content"],"additionalProperties":false}]}},"next_cursor":{"default":null,"anyOf":[{"type":"string"},{"type":"null"}]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"group_ids":{"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)$"}},"tags":{"type":"array","items":{"type":"string"}},"queue":{"anyOf":[{"type":"object","properties":{"position":{"type":"integer","minimum":1,"maximum":9007199254740991},"wait_time_s":{"type":"integer","minimum":0,"maximum":9007199254740991},"queued_at":{"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{3}(?:Z))$"}},"required":["position","wait_time_s","queued_at"],"additionalProperties":false},{"type":"null"}]},"rating":{"anyOf":[{"type":"object","properties":{"score":{"anyOf":[{"type":"string","enum":["good","bad"]},{"type":"null"}]},"comment":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"rated_at":{"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{3}(?:Z))$"}},"required":["score","comment","rated_at"],"additionalProperties":false},{"type":"null"}]},"close_reason":{"anyOf":[{"type":"string","enum":["closed_by_agent","closed_by_customer","inactivity","customer_left","customer_banned"]},{"type":"null"}]},"previous_thread_id":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},{"type":"null"}]},"next_thread_id":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},{"type":"null"}]},"created_at":{"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{3}(?:Z))$"},"closed_at":{"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{3}(?:Z))$"},{"type":"null"}]}},"required":["id","chat_id","active","user_ids","events","next_cursor","properties","group_ids","tags","queue","rating","close_reason","previous_thread_id","next_thread_id","created_at","closed_at"],"additionalProperties":false},{"type":"null"}]},"created_at":{"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{3}(?:Z))$"}},"required":["id","organization_id","channel","status","customer_id","assignee_id","users","properties","group_ids","thread","created_at"],"additionalProperties":false}},"required":["chat"],"additionalProperties":false}},"list_threads":{"request":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"page_token":{"type":"string"}},"required":["chat_id"]},"response":{"type":"object","properties":{"threads":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"active":{"type":"boolean"},"user_ids":{"type":"array","items":{"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":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}]}},"events":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"message"},"text":{"type":"string","minLength":1,"maxLength":16384},"postback":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"thread_id":{"type":"string"},"event_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"type":{"type":"string"},"value":{"type":"string"}},"required":["id","thread_id","event_id","type","value"],"additionalProperties":false},{"type":"null"}]}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","text","postback"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"system"},"subtype":{"type":"string","pattern":"^[a-z_]+(\\.[a-z_]+)+$"},"text":{"type":"string","maxLength":1024},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","subtype","text","details"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"file"},"file_key":{"type":"string","maxLength":512},"name":{"type":"string","maxLength":255},"content_type":{"type":"string","maxLength":127},"size":{"type":"integer","minimum":0,"maximum":9007199254740991},"width":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"height":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"alternative_text":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}]}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","file_key","name","content_type","size","width","height","alternative_text"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"rich_message"},"template":{"type":"string","enum":["cards","quick_replies","sticker"]},"elements":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"title":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"subtitle":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"image_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"buttons":{"maxItems":13,"type":"array","items":{"type":"object","properties":{"text":{"type":"string","maxLength":128},"type":{"type":"string","enum":["message","url","webview","phone","cancel"]},"value":{"type":"string","maxLength":2048},"postback_id":{"type":"string","maxLength":64}},"required":["text","type","value","postback_id"],"additionalProperties":false}}},"required":["title","subtitle","image_url","buttons"],"additionalProperties":false}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","template","elements"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"form"},"form_id":{"type":"string"},"form_kind":{"type":"string","enum":["prechat","postchat","ask_for_email","custom"]},"fields":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"type":{"type":"string","enum":["name","email","text","textarea","select","checkbox","radio","rating","phone"]},"label":{"type":"string","maxLength":512},"required":{"type":"boolean"},"options":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":256}}},"required":["id","type","label","required","options"],"additionalProperties":false}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","form_id","form_kind","fields"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"filled_form"},"form_id":{"type":"string"},"form_kind":{"type":"string","enum":["prechat","postchat","ask_for_email","custom"]},"answers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"answer":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["id","label","answer"],"additionalProperties":false}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","form_id","form_kind","answers"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"custom"},"content":{}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","content"],"additionalProperties":false}]}},"next_cursor":{"default":null,"anyOf":[{"type":"string"},{"type":"null"}]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"group_ids":{"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)$"}},"tags":{"type":"array","items":{"type":"string"}},"queue":{"anyOf":[{"type":"object","properties":{"position":{"type":"integer","minimum":1,"maximum":9007199254740991},"wait_time_s":{"type":"integer","minimum":0,"maximum":9007199254740991},"queued_at":{"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{3}(?:Z))$"}},"required":["position","wait_time_s","queued_at"],"additionalProperties":false},{"type":"null"}]},"rating":{"anyOf":[{"type":"object","properties":{"score":{"anyOf":[{"type":"string","enum":["good","bad"]},{"type":"null"}]},"comment":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"rated_at":{"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{3}(?:Z))$"}},"required":["score","comment","rated_at"],"additionalProperties":false},{"type":"null"}]},"close_reason":{"anyOf":[{"type":"string","enum":["closed_by_agent","closed_by_customer","inactivity","customer_left","customer_banned"]},{"type":"null"}]},"previous_thread_id":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},{"type":"null"}]},"next_thread_id":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},{"type":"null"}]},"created_at":{"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{3}(?:Z))$"},"closed_at":{"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{3}(?:Z))$"},{"type":"null"}]}},"required":["id","chat_id","active","user_ids","events","next_cursor","properties","group_ids","tags","queue","rating","close_reason","previous_thread_id","next_thread_id","created_at","closed_at"],"additionalProperties":false}},"next_page_token":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["threads","next_page_token"],"additionalProperties":false}},"start_chat":{"request":{"type":"object","properties":{"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)$"},"group_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)$"},"events":{"maxItems":20,"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"message"},"text":{"type":"string","minLength":1,"maxLength":16384},"custom_id":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"visibility":{"default":"all","type":"string","enum":["all","agents"]},"mentions":{"maxItems":20,"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":["type","text"]},{"type":"object","properties":{"type":{"type":"string","const":"file"},"file_key":{"type":"string","maxLength":512},"name":{"type":"string","maxLength":255},"content_type":{"type":"string","maxLength":127},"size":{"type":"integer","minimum":0,"maximum":9007199254740991},"custom_id":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"visibility":{"default":"all","type":"string","enum":["all","agents"]},"width":{"type":"integer","minimum":0,"maximum":9007199254740991},"height":{"type":"integer","minimum":0,"maximum":9007199254740991},"alternative_text":{"type":"string","maxLength":512}},"required":["type","file_key","name","content_type","size"]},{"type":"object","properties":{"type":{"type":"string","const":"rich_message"},"template":{"type":"string","enum":["cards","quick_replies","sticker"]},"elements":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"title":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"subtitle":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"image_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"buttons":{"maxItems":13,"type":"array","items":{"type":"object","properties":{"text":{"type":"string","maxLength":128},"type":{"type":"string","enum":["message","url","webview","phone","cancel"]},"value":{"type":"string","maxLength":2048},"postback_id":{"type":"string","maxLength":64}},"required":["text","type","value","postback_id"]}}},"required":["title","subtitle","image_url","buttons"]}},"custom_id":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"visibility":{"default":"all","type":"string","enum":["all","agents"]}},"required":["type","template","elements"]},{"type":"object","properties":{"type":{"type":"string","const":"form"},"form_id":{"type":"string"},"form_kind":{"type":"string","enum":["prechat","postchat","ask_for_email","custom"]},"fields":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"type":{"type":"string","enum":["name","email","text","textarea","select","checkbox","radio","rating","phone"]},"label":{"type":"string","maxLength":512},"required":{"type":"boolean"},"options":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":256}}},"required":["id","type","label","required","options"]}},"custom_id":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"visibility":{"default":"all","type":"string","enum":["all","agents"]}},"required":["type","form_id","form_kind","fields"]},{"type":"object","properties":{"type":{"type":"string","const":"filled_form"},"form_id":{"type":"string"},"form_kind":{"type":"string","enum":["prechat","postchat","ask_for_email","custom"]},"answers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"answer":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["id","label","answer"]}},"custom_id":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"visibility":{"default":"all","type":"string","enum":["all","agents"]}},"required":["type","form_id","form_kind","answers"]},{"type":"object","properties":{"type":{"type":"string","const":"custom"},"content":{},"custom_id":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"visibility":{"default":"all","type":"string","enum":["all","agents"]}},"required":["type","content"]}]}},"continuous":{"type":"boolean"}},"required":["customer_id"]},"response":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"event_ids":{"type":"array","items":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"}}},"required":["chat_id","thread_id","event_ids"],"additionalProperties":false}},"resume_chat":{"request":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"events":{"maxItems":20,"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"message"},"text":{"type":"string","minLength":1,"maxLength":16384},"custom_id":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"visibility":{"default":"all","type":"string","enum":["all","agents"]},"mentions":{"maxItems":20,"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":["type","text"]},{"type":"object","properties":{"type":{"type":"string","const":"file"},"file_key":{"type":"string","maxLength":512},"name":{"type":"string","maxLength":255},"content_type":{"type":"string","maxLength":127},"size":{"type":"integer","minimum":0,"maximum":9007199254740991},"custom_id":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"visibility":{"default":"all","type":"string","enum":["all","agents"]},"width":{"type":"integer","minimum":0,"maximum":9007199254740991},"height":{"type":"integer","minimum":0,"maximum":9007199254740991},"alternative_text":{"type":"string","maxLength":512}},"required":["type","file_key","name","content_type","size"]},{"type":"object","properties":{"type":{"type":"string","const":"rich_message"},"template":{"type":"string","enum":["cards","quick_replies","sticker"]},"elements":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"title":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"subtitle":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"image_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"buttons":{"maxItems":13,"type":"array","items":{"type":"object","properties":{"text":{"type":"string","maxLength":128},"type":{"type":"string","enum":["message","url","webview","phone","cancel"]},"value":{"type":"string","maxLength":2048},"postback_id":{"type":"string","maxLength":64}},"required":["text","type","value","postback_id"]}}},"required":["title","subtitle","image_url","buttons"]}},"custom_id":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"visibility":{"default":"all","type":"string","enum":["all","agents"]}},"required":["type","template","elements"]},{"type":"object","properties":{"type":{"type":"string","const":"form"},"form_id":{"type":"string"},"form_kind":{"type":"string","enum":["prechat","postchat","ask_for_email","custom"]},"fields":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"type":{"type":"string","enum":["name","email","text","textarea","select","checkbox","radio","rating","phone"]},"label":{"type":"string","maxLength":512},"required":{"type":"boolean"},"options":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":256}}},"required":["id","type","label","required","options"]}},"custom_id":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"visibility":{"default":"all","type":"string","enum":["all","agents"]}},"required":["type","form_id","form_kind","fields"]},{"type":"object","properties":{"type":{"type":"string","const":"filled_form"},"form_id":{"type":"string"},"form_kind":{"type":"string","enum":["prechat","postchat","ask_for_email","custom"]},"answers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"answer":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["id","label","answer"]}},"custom_id":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"visibility":{"default":"all","type":"string","enum":["all","agents"]}},"required":["type","form_id","form_kind","answers"]},{"type":"object","properties":{"type":{"type":"string","const":"custom"},"content":{},"custom_id":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"visibility":{"default":"all","type":"string","enum":["all","agents"]}},"required":["type","content"]}]}}},"required":["chat_id"]},"response":{"type":"object","properties":{"thread_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"}},"required":["thread_id"],"additionalProperties":false}},"accept_chat":{"request":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"}}},"response":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"}},"required":["chat_id","thread_id"],"additionalProperties":false}},"decline_chat":{"request":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"}},"required":["chat_id"]},"response":{"type":"object","properties":{},"additionalProperties":false}},"close_chat":{"request":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"}},"required":["chat_id"]},"response":{"type":"object","properties":{},"additionalProperties":false}},"follow_chat":{"request":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"}},"required":["chat_id"]},"response":{"type":"object","properties":{},"additionalProperties":false}},"unfollow_chat":{"request":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"}},"required":["chat_id"]},"response":{"type":"object","properties":{},"additionalProperties":false}},"transfer_chat":{"request":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"agent"},"ids":{"minItems":1,"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":["type","ids"]},{"type":"object","properties":{"type":{"type":"string","const":"group"},"ids":{"minItems":1,"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":["type","ids"]}]},"ignore_availability":{"type":"boolean"},"note":{"type":"string","minLength":1,"maxLength":16384}},"required":["chat_id","target"]},"response":{"type":"object","properties":{"queued":{"type":"boolean"}},"required":["queued"],"additionalProperties":false}},"add_user_to_chat":{"request":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"agent_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)$"},"visibility":{"type":"string","enum":["all","agents"]}},"required":["chat_id","agent_id","visibility"]},"response":{"type":"object","properties":{},"additionalProperties":false}},"remove_user_from_chat":{"request":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"agent_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)$"}},"required":["chat_id","agent_id"]},"response":{"type":"object","properties":{},"additionalProperties":false}},"list_agents_for_transfer":{"request":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"}},"required":["chat_id"]},"response":{"type":"object","properties":{"agents":{"type":"array","items":{"type":"object","properties":{"agent_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)$"},"name":{"type":"string"},"avatar_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"status":{"type":"string","enum":["accepting_chats","not_accepting_chats","offline"]},"connected":{"type":"boolean"},"active_chats":{"type":"integer","minimum":0,"maximum":9007199254740991},"max_chats":{"type":"integer","minimum":0,"maximum":9007199254740991},"group_ids":{"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":["agent_id","name","avatar_url","status","connected","active_chats","max_chats","group_ids"],"additionalProperties":false}},"groups":{"type":"array","items":{"type":"object","properties":{"group_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)$"},"name":{"type":"string"},"available":{"type":"boolean"}},"required":["group_id","name","available"],"additionalProperties":false}}},"required":["agents","groups"],"additionalProperties":false}},"send_event":{"request":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"event":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"message"},"text":{"type":"string","minLength":1,"maxLength":16384},"custom_id":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"visibility":{"default":"all","type":"string","enum":["all","agents"]},"mentions":{"maxItems":20,"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":["type","text"]},{"type":"object","properties":{"type":{"type":"string","const":"file"},"file_key":{"type":"string","maxLength":512},"name":{"type":"string","maxLength":255},"content_type":{"type":"string","maxLength":127},"size":{"type":"integer","minimum":0,"maximum":9007199254740991},"custom_id":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"visibility":{"default":"all","type":"string","enum":["all","agents"]},"width":{"type":"integer","minimum":0,"maximum":9007199254740991},"height":{"type":"integer","minimum":0,"maximum":9007199254740991},"alternative_text":{"type":"string","maxLength":512}},"required":["type","file_key","name","content_type","size"]},{"type":"object","properties":{"type":{"type":"string","const":"rich_message"},"template":{"type":"string","enum":["cards","quick_replies","sticker"]},"elements":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"title":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"subtitle":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"image_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"buttons":{"maxItems":13,"type":"array","items":{"type":"object","properties":{"text":{"type":"string","maxLength":128},"type":{"type":"string","enum":["message","url","webview","phone","cancel"]},"value":{"type":"string","maxLength":2048},"postback_id":{"type":"string","maxLength":64}},"required":["text","type","value","postback_id"]}}},"required":["title","subtitle","image_url","buttons"]}},"custom_id":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"visibility":{"default":"all","type":"string","enum":["all","agents"]}},"required":["type","template","elements"]},{"type":"object","properties":{"type":{"type":"string","const":"form"},"form_id":{"type":"string"},"form_kind":{"type":"string","enum":["prechat","postchat","ask_for_email","custom"]},"fields":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"type":{"type":"string","enum":["name","email","text","textarea","select","checkbox","radio","rating","phone"]},"label":{"type":"string","maxLength":512},"required":{"type":"boolean"},"options":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":256}}},"required":["id","type","label","required","options"]}},"custom_id":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"visibility":{"default":"all","type":"string","enum":["all","agents"]}},"required":["type","form_id","form_kind","fields"]},{"type":"object","properties":{"type":{"type":"string","const":"filled_form"},"form_id":{"type":"string"},"form_kind":{"type":"string","enum":["prechat","postchat","ask_for_email","custom"]},"answers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"answer":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["id","label","answer"]}},"custom_id":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"visibility":{"default":"all","type":"string","enum":["all","agents"]}},"required":["type","form_id","form_kind","answers"]},{"type":"object","properties":{"type":{"type":"string","const":"custom"},"content":{},"custom_id":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"visibility":{"default":"all","type":"string","enum":["all","agents"]}},"required":["type","content"]}]}},"required":["chat_id","event"]},"response":{"type":"object","properties":{"event_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"thread_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"replay":{"type":"boolean"}},"required":["event_id","thread_id","seq","replay"],"additionalProperties":false}},"send_event_preview":{"request":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"text":{"type":"string","maxLength":16384}},"required":["chat_id","text"]},"response":{"type":"object","properties":{},"additionalProperties":false}},"send_typing":{"request":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"is_typing":{"type":"boolean"},"visibility":{"default":"all","type":"string","enum":["all","agents"]}},"required":["chat_id","is_typing"]},"response":{"type":"object","properties":{},"additionalProperties":false}},"mark_events_as_seen":{"request":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"seen_up_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{3}(?:Z))$"}},"required":["chat_id","seen_up_to"]},"response":{"type":"object","properties":{},"additionalProperties":false}},"delete_event":{"request":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"event_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"}},"required":["chat_id","event_id"]},"response":{"type":"object","properties":{},"additionalProperties":false}},"set_reaction":{"request":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"event_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"reaction":{"anyOf":[{"type":"string","minLength":1,"maxLength":16},{"type":"null"}]}},"required":["chat_id","event_id","reaction"]},"response":{"type":"object","properties":{},"additionalProperties":false}},"tag_thread":{"request":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"tag":{"type":"string","minLength":1,"maxLength":64}},"required":["chat_id","thread_id","tag"]},"response":{"type":"object","properties":{},"additionalProperties":false}},"untag_thread":{"request":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"tag":{"type":"string","minLength":1,"maxLength":64}},"required":["chat_id","thread_id","tag"]},"response":{"type":"object","properties":{},"additionalProperties":false}},"update_chat_properties":{"request":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}}},"required":["chat_id","properties"]},"response":{"type":"object","properties":{},"additionalProperties":false}},"update_thread_properties":{"request":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}}},"required":["chat_id","thread_id","properties"]},"response":{"type":"object","properties":{},"additionalProperties":false}},"ban_customer":{"request":{"type":"object","properties":{"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)$"},"days":{"type":"integer","minimum":1,"maximum":3650}},"required":["customer_id","days"]},"response":{"type":"object","properties":{},"additionalProperties":false}},"multicast":{"request":{"type":"object","properties":{"recipients":{"type":"object","properties":{"agent_ids":{"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)$"}},"group_ids":{"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)$"}}}},"content":{}},"required":["recipients","content"]},"response":{"type":"object","properties":{},"additionalProperties":false}}},"pushes":{"incoming_chat":{"type":"object","properties":{"chat":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"organization_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)$"},"channel":{"type":"string","enum":["widget","chat_page","api","email","whatsapp","messenger","instagram","telegram","line","zalo","viber","wechat","kakaotalk","sms","x","discord","slack","teams","apple_messages"]},"status":{"type":"string","enum":["queued","pending","active","inactive","archived"]},"customer_id":{"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"}]},"assignee_id":{"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"}]},"users":{"type":"array","items":{"type":"object","properties":{"id":{"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":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-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":{"type":"string","enum":["agent","customer"]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"avatar_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"present":{"type":"boolean"},"events_seen_up_to":{"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{3}(?:Z))$"},{"type":"null"}]},"visibility":{"type":"string","enum":["all","agents"]}},"required":["id","type","name","avatar_url","present","events_seen_up_to","visibility"],"additionalProperties":false}},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"group_ids":{"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)$"}},"thread":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"active":{"type":"boolean"},"user_ids":{"type":"array","items":{"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":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}]}},"events":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"message"},"text":{"type":"string","minLength":1,"maxLength":16384},"postback":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"thread_id":{"type":"string"},"event_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"type":{"type":"string"},"value":{"type":"string"}},"required":["id","thread_id","event_id","type","value"],"additionalProperties":false},{"type":"null"}]}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","text","postback"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"system"},"subtype":{"type":"string","pattern":"^[a-z_]+(\\.[a-z_]+)+$"},"text":{"type":"string","maxLength":1024},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","subtype","text","details"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"file"},"file_key":{"type":"string","maxLength":512},"name":{"type":"string","maxLength":255},"content_type":{"type":"string","maxLength":127},"size":{"type":"integer","minimum":0,"maximum":9007199254740991},"width":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"height":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"alternative_text":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}]}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","file_key","name","content_type","size","width","height","alternative_text"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"rich_message"},"template":{"type":"string","enum":["cards","quick_replies","sticker"]},"elements":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"title":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"subtitle":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"image_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"buttons":{"maxItems":13,"type":"array","items":{"type":"object","properties":{"text":{"type":"string","maxLength":128},"type":{"type":"string","enum":["message","url","webview","phone","cancel"]},"value":{"type":"string","maxLength":2048},"postback_id":{"type":"string","maxLength":64}},"required":["text","type","value","postback_id"],"additionalProperties":false}}},"required":["title","subtitle","image_url","buttons"],"additionalProperties":false}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","template","elements"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"form"},"form_id":{"type":"string"},"form_kind":{"type":"string","enum":["prechat","postchat","ask_for_email","custom"]},"fields":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"type":{"type":"string","enum":["name","email","text","textarea","select","checkbox","radio","rating","phone"]},"label":{"type":"string","maxLength":512},"required":{"type":"boolean"},"options":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":256}}},"required":["id","type","label","required","options"],"additionalProperties":false}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","form_id","form_kind","fields"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"filled_form"},"form_id":{"type":"string"},"form_kind":{"type":"string","enum":["prechat","postchat","ask_for_email","custom"]},"answers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"answer":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["id","label","answer"],"additionalProperties":false}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","form_id","form_kind","answers"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"custom"},"content":{}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","content"],"additionalProperties":false}]}},"next_cursor":{"default":null,"anyOf":[{"type":"string"},{"type":"null"}]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"group_ids":{"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)$"}},"tags":{"type":"array","items":{"type":"string"}},"queue":{"anyOf":[{"type":"object","properties":{"position":{"type":"integer","minimum":1,"maximum":9007199254740991},"wait_time_s":{"type":"integer","minimum":0,"maximum":9007199254740991},"queued_at":{"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{3}(?:Z))$"}},"required":["position","wait_time_s","queued_at"],"additionalProperties":false},{"type":"null"}]},"rating":{"anyOf":[{"type":"object","properties":{"score":{"anyOf":[{"type":"string","enum":["good","bad"]},{"type":"null"}]},"comment":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"rated_at":{"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{3}(?:Z))$"}},"required":["score","comment","rated_at"],"additionalProperties":false},{"type":"null"}]},"close_reason":{"anyOf":[{"type":"string","enum":["closed_by_agent","closed_by_customer","inactivity","customer_left","customer_banned"]},{"type":"null"}]},"previous_thread_id":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},{"type":"null"}]},"next_thread_id":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},{"type":"null"}]},"created_at":{"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{3}(?:Z))$"},"closed_at":{"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{3}(?:Z))$"},{"type":"null"}]}},"required":["id","chat_id","active","user_ids","events","next_cursor","properties","group_ids","tags","queue","rating","close_reason","previous_thread_id","next_thread_id","created_at","closed_at"],"additionalProperties":false},{"type":"null"}]},"created_at":{"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{3}(?:Z))$"}},"required":["id","organization_id","channel","status","customer_id","assignee_id","users","properties","group_ids","thread","created_at"],"additionalProperties":false},"transferred_from":{"anyOf":[{"type":"object","properties":{"agent_ids":{"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)$"}},"group_ids":{"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":["agent_ids","group_ids"],"additionalProperties":false},{"type":"null"}]}},"required":["chat","transferred_from"],"additionalProperties":false},"chat_summary_updated":{"type":"object","properties":{"chat":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"channel":{"type":"string","enum":["widget","chat_page","api","email","whatsapp","messenger","instagram","telegram","line","zalo","viber","wechat","kakaotalk","sms","x","discord","slack","teams","apple_messages"]},"status":{"type":"string","enum":["queued","pending","active","inactive","archived"]},"customer":{"type":"object","properties":{"id":{"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"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"type":"string","maxLength":254,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]}},"required":["id","name","email"],"additionalProperties":false},"assignee_id":{"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"}]},"group_ids":{"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)$"}},"agent_ids":{"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)$"}},"supervisor_ids":{"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)$"}},"last_thread_id":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},{"type":"null"}]},"last_event_preview":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"last_event_at":{"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{3}(?:Z))$"},{"type":"null"}]},"last_event_author_type":{"anyOf":[{"type":"string","enum":["agent","customer","system"]},{"type":"null"}]},"unread_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"tags":{"type":"array","items":{"type":"string"}},"queue":{"anyOf":[{"type":"object","properties":{"position":{"type":"integer","minimum":1,"maximum":9007199254740991},"wait_time_s":{"type":"integer","minimum":0,"maximum":9007199254740991},"queued_at":{"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{3}(?:Z))$"}},"required":["position","wait_time_s","queued_at"],"additionalProperties":false},{"type":"null"}]},"rating":{"anyOf":[{"type":"string","enum":["good","bad"]},{"type":"null"}]},"close_reason":{"anyOf":[{"type":"string","enum":["closed_by_agent","closed_by_customer","inactivity","customer_left","customer_banned"]},{"type":"null"}]},"created_at":{"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{3}(?:Z))$"}},"required":["id","channel","status","customer","assignee_id","group_ids","agent_ids","supervisor_ids","last_thread_id","last_event_preview","last_event_at","last_event_author_type","unread_count","tags","queue","rating","close_reason","created_at"],"additionalProperties":false}},"required":["chat"],"additionalProperties":false},"chat_unlisted":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"}},"required":["chat_id"],"additionalProperties":false},"chat_closed":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"reason":{"type":"string","enum":["closed_by_agent","closed_by_customer","inactivity","customer_left","customer_banned"]}},"required":["chat_id","thread_id","user_id","reason"],"additionalProperties":false},"chat_transferred":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"requester_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"to":{"type":"object","properties":{"agent_ids":{"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)$"}},"group_ids":{"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":["agent_ids","group_ids"],"additionalProperties":false},"queued":{"type":"boolean"}},"required":["chat_id","thread_id","requester_id","to","queued"],"additionalProperties":false},"user_added_to_chat":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"user_id":{"type":"string"},"user_type":{"type":"string","enum":["agent","customer"]},"visibility":{"type":"string","enum":["all","agents"]}},"required":["chat_id","thread_id","user_id","user_type","visibility"],"additionalProperties":false},"user_removed_from_chat":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"user_id":{"type":"string"},"reason":{"type":"string"}},"required":["chat_id","thread_id","user_id","reason"],"additionalProperties":false},"incoming_event":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"event":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"message"},"text":{"type":"string","minLength":1,"maxLength":16384},"postback":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"thread_id":{"type":"string"},"event_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"type":{"type":"string"},"value":{"type":"string"}},"required":["id","thread_id","event_id","type","value"],"additionalProperties":false},{"type":"null"}]}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","text","postback"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"system"},"subtype":{"type":"string","pattern":"^[a-z_]+(\\.[a-z_]+)+$"},"text":{"type":"string","maxLength":1024},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","subtype","text","details"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"file"},"file_key":{"type":"string","maxLength":512},"name":{"type":"string","maxLength":255},"content_type":{"type":"string","maxLength":127},"size":{"type":"integer","minimum":0,"maximum":9007199254740991},"width":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"height":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"alternative_text":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}]}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","file_key","name","content_type","size","width","height","alternative_text"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"rich_message"},"template":{"type":"string","enum":["cards","quick_replies","sticker"]},"elements":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"title":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"subtitle":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"image_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"buttons":{"maxItems":13,"type":"array","items":{"type":"object","properties":{"text":{"type":"string","maxLength":128},"type":{"type":"string","enum":["message","url","webview","phone","cancel"]},"value":{"type":"string","maxLength":2048},"postback_id":{"type":"string","maxLength":64}},"required":["text","type","value","postback_id"],"additionalProperties":false}}},"required":["title","subtitle","image_url","buttons"],"additionalProperties":false}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","template","elements"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"form"},"form_id":{"type":"string"},"form_kind":{"type":"string","enum":["prechat","postchat","ask_for_email","custom"]},"fields":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"type":{"type":"string","enum":["name","email","text","textarea","select","checkbox","radio","rating","phone"]},"label":{"type":"string","maxLength":512},"required":{"type":"boolean"},"options":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":256}}},"required":["id","type","label","required","options"],"additionalProperties":false}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","form_id","form_kind","fields"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"filled_form"},"form_id":{"type":"string"},"form_kind":{"type":"string","enum":["prechat","postchat","ask_for_email","custom"]},"answers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"answer":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["id","label","answer"],"additionalProperties":false}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","form_id","form_kind","answers"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"custom"},"content":{}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","content"],"additionalProperties":false}]},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["chat_id","thread_id","event","seq"],"additionalProperties":false},"incoming_event_preview":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"author_id":{"type":"string"},"text":{"type":"string"}},"required":["chat_id","thread_id","author_id","text"],"additionalProperties":false},"event_updated":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"event":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"message"},"text":{"type":"string","minLength":1,"maxLength":16384},"postback":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"thread_id":{"type":"string"},"event_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"type":{"type":"string"},"value":{"type":"string"}},"required":["id","thread_id","event_id","type","value"],"additionalProperties":false},{"type":"null"}]}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","text","postback"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"system"},"subtype":{"type":"string","pattern":"^[a-z_]+(\\.[a-z_]+)+$"},"text":{"type":"string","maxLength":1024},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","subtype","text","details"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"file"},"file_key":{"type":"string","maxLength":512},"name":{"type":"string","maxLength":255},"content_type":{"type":"string","maxLength":127},"size":{"type":"integer","minimum":0,"maximum":9007199254740991},"width":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"height":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"alternative_text":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}]}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","file_key","name","content_type","size","width","height","alternative_text"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"rich_message"},"template":{"type":"string","enum":["cards","quick_replies","sticker"]},"elements":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"title":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"subtitle":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"image_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"buttons":{"maxItems":13,"type":"array","items":{"type":"object","properties":{"text":{"type":"string","maxLength":128},"type":{"type":"string","enum":["message","url","webview","phone","cancel"]},"value":{"type":"string","maxLength":2048},"postback_id":{"type":"string","maxLength":64}},"required":["text","type","value","postback_id"],"additionalProperties":false}}},"required":["title","subtitle","image_url","buttons"],"additionalProperties":false}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","template","elements"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"form"},"form_id":{"type":"string"},"form_kind":{"type":"string","enum":["prechat","postchat","ask_for_email","custom"]},"fields":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"type":{"type":"string","enum":["name","email","text","textarea","select","checkbox","radio","rating","phone"]},"label":{"type":"string","maxLength":512},"required":{"type":"boolean"},"options":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":256}}},"required":["id","type","label","required","options"],"additionalProperties":false}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","form_id","form_kind","fields"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"filled_form"},"form_id":{"type":"string"},"form_kind":{"type":"string","enum":["prechat","postchat","ask_for_email","custom"]},"answers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"answer":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["id","label","answer"],"additionalProperties":false}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","form_id","form_kind","answers"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"custom"},"content":{}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","content"],"additionalProperties":false}]}},"required":["chat_id","thread_id","event"],"additionalProperties":false},"event_deleted":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"event_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"}},"required":["chat_id","thread_id","event_id"],"additionalProperties":false},"incoming_sneak_peek":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"text":{"type":"string","maxLength":16384}},"required":["chat_id","thread_id","text"],"additionalProperties":false},"incoming_typing":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"user_id":{"type":"string"},"is_typing":{"type":"boolean"}},"required":["chat_id","thread_id","user_id","is_typing"],"additionalProperties":false},"events_marked_as_seen":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"user_id":{"type":"string"},"seen_up_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{3}(?:Z))$"}},"required":["chat_id","user_id","seen_up_to"],"additionalProperties":false},"chat_properties_updated":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}}},"required":["chat_id","properties"],"additionalProperties":false},"thread_properties_updated":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}}},"required":["chat_id","thread_id","properties"],"additionalProperties":false},"thread_tagged":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"tag":{"type":"string"}},"required":["chat_id","thread_id","tag"],"additionalProperties":false},"thread_untagged":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"tag":{"type":"string"}},"required":["chat_id","thread_id","tag"],"additionalProperties":false},"thread_summary_set":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"summary":{"type":"string"}},"required":["chat_id","thread_id","summary"],"additionalProperties":false},"queue_positions_updated":{"type":"object","properties":{"queue":{"type":"array","items":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"wait_time_s":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["chat_id","position","wait_time_s"],"additionalProperties":false}}},"required":["queue"],"additionalProperties":false},"routing_status_set":{"type":"object","properties":{"agent_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":["accepting_chats","not_accepting_chats","offline"]}},"required":["agent_id","status"],"additionalProperties":false},"customer_banned":{"type":"object","properties":{"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)$"},"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{3}(?:Z))$"}},"required":["customer_id","until"],"additionalProperties":false},"config_updated":{"type":"object","properties":{"entity":{"type":"string","enum":["agent","group","tag","canned_response","settings","routing_rule","greeting"]},"op":{"type":"string","enum":["created","updated","deleted"]},"id":{"type":"string"}},"required":["entity","op","id"],"additionalProperties":false},"incoming_multicast":{"type":"object","properties":{"author_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)$"},"content":{}},"required":["author_id","content"],"additionalProperties":false},"incoming_error":{"type":"object","properties":{"request_action":{"type":"string"},"code":{"type":"string","enum":["validation","authentication","authorization","not_found","conflict","chat_inactive","agent_unavailable","entity_too_large","idempotency_key_reused","unsupported_version","too_many_requests","plan_limit","internal","not_implemented","service_unavailable"]},"message":{"type":"string"}},"required":["request_action","code","message"],"additionalProperties":false},"agent_disconnected":{"type":"object","properties":{"reason":{"type":"string","enum":["logged_out_remotely","token_revoked","token_expired","connection_evicted","too_many_connections","role_changed","organization_deleted","internal_error"]},"reconnect":{"type":"boolean"}},"required":["reason","reconnect"],"additionalProperties":false}}},"customer":{"actions":{"login":{"request":{"type":"object","properties":{"group_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)$"},"page":{"type":"object","properties":{"url":{"type":"string","maxLength":2048},"title":{"type":"string","maxLength":512},"referrer":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}]}},"required":["url","title","referrer"]},"is_mobile":{"type":"boolean"},"application":{"type":"object","properties":{"name":{"type":"string","maxLength":64},"version":{"type":"string","maxLength":32},"channel":{"type":"string","enum":["widget","chat_page","sdk"]}},"required":["name","version","channel"]}},"required":["page","is_mobile","application"]},"response":{"type":"object","properties":{"customer":{"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)$"},"organization_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)$"},"visitor_id":{"anyOf":[{"type":"string","minLength":8,"maxLength":64},{"type":"null"}]},"external_user_id":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}]},"name":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"email":{"anyOf":[{"type":"string","maxLength":254,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}]},"avatar_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"session_fields":{"maxItems":50,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","maxLength":64},{"type":"string","maxLength":512}]}},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"first_seen_at":{"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{3}(?:Z))$"},"last_seen_at":{"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{3}(?:Z))$"},"banned_until":{"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{3}(?:Z))$"},{"type":"null"}]}},"required":["id","organization_id","visitor_id","external_user_id","name","email","phone","avatar_url","session_fields","properties","first_seen_at","last_seen_at","banned_until"],"additionalProperties":false},"chat":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"organization_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)$"},"channel":{"type":"string","enum":["widget","chat_page","api","email","whatsapp","messenger","instagram","telegram","line","zalo","viber","wechat","kakaotalk","sms","x","discord","slack","teams","apple_messages"]},"status":{"type":"string","enum":["queued","pending","active","inactive","archived"]},"customer_id":{"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"}]},"assignee_id":{"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"}]},"users":{"type":"array","items":{"type":"object","properties":{"id":{"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":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-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":{"type":"string","enum":["agent","customer"]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"avatar_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"present":{"type":"boolean"},"events_seen_up_to":{"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{3}(?:Z))$"},{"type":"null"}]},"visibility":{"type":"string","enum":["all","agents"]}},"required":["id","type","name","avatar_url","present","events_seen_up_to","visibility"],"additionalProperties":false}},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"group_ids":{"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)$"}},"thread":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"active":{"type":"boolean"},"user_ids":{"type":"array","items":{"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":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}]}},"events":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"message"},"text":{"type":"string","minLength":1,"maxLength":16384},"postback":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"thread_id":{"type":"string"},"event_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"type":{"type":"string"},"value":{"type":"string"}},"required":["id","thread_id","event_id","type","value"],"additionalProperties":false},{"type":"null"}]}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","text","postback"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"system"},"subtype":{"type":"string","pattern":"^[a-z_]+(\\.[a-z_]+)+$"},"text":{"type":"string","maxLength":1024},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","subtype","text","details"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"file"},"file_key":{"type":"string","maxLength":512},"name":{"type":"string","maxLength":255},"content_type":{"type":"string","maxLength":127},"size":{"type":"integer","minimum":0,"maximum":9007199254740991},"width":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"height":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"alternative_text":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}]}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","file_key","name","content_type","size","width","height","alternative_text"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"rich_message"},"template":{"type":"string","enum":["cards","quick_replies","sticker"]},"elements":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"title":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"subtitle":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"image_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"buttons":{"maxItems":13,"type":"array","items":{"type":"object","properties":{"text":{"type":"string","maxLength":128},"type":{"type":"string","enum":["message","url","webview","phone","cancel"]},"value":{"type":"string","maxLength":2048},"postback_id":{"type":"string","maxLength":64}},"required":["text","type","value","postback_id"],"additionalProperties":false}}},"required":["title","subtitle","image_url","buttons"],"additionalProperties":false}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","template","elements"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"form"},"form_id":{"type":"string"},"form_kind":{"type":"string","enum":["prechat","postchat","ask_for_email","custom"]},"fields":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"type":{"type":"string","enum":["name","email","text","textarea","select","checkbox","radio","rating","phone"]},"label":{"type":"string","maxLength":512},"required":{"type":"boolean"},"options":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":256}}},"required":["id","type","label","required","options"],"additionalProperties":false}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","form_id","form_kind","fields"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"filled_form"},"form_id":{"type":"string"},"form_kind":{"type":"string","enum":["prechat","postchat","ask_for_email","custom"]},"answers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"answer":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["id","label","answer"],"additionalProperties":false}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","form_id","form_kind","answers"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"custom"},"content":{}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","content"],"additionalProperties":false}]}},"next_cursor":{"default":null,"anyOf":[{"type":"string"},{"type":"null"}]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"group_ids":{"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)$"}},"tags":{"type":"array","items":{"type":"string"}},"queue":{"anyOf":[{"type":"object","properties":{"position":{"type":"integer","minimum":1,"maximum":9007199254740991},"wait_time_s":{"type":"integer","minimum":0,"maximum":9007199254740991},"queued_at":{"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{3}(?:Z))$"}},"required":["position","wait_time_s","queued_at"],"additionalProperties":false},{"type":"null"}]},"rating":{"anyOf":[{"type":"object","properties":{"score":{"anyOf":[{"type":"string","enum":["good","bad"]},{"type":"null"}]},"comment":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"rated_at":{"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{3}(?:Z))$"}},"required":["score","comment","rated_at"],"additionalProperties":false},{"type":"null"}]},"close_reason":{"anyOf":[{"type":"string","enum":["closed_by_agent","closed_by_customer","inactivity","customer_left","customer_banned"]},{"type":"null"}]},"previous_thread_id":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},{"type":"null"}]},"next_thread_id":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},{"type":"null"}]},"created_at":{"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{3}(?:Z))$"},"closed_at":{"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{3}(?:Z))$"},{"type":"null"}]}},"required":["id","chat_id","active","user_ids","events","next_cursor","properties","group_ids","tags","queue","rating","close_reason","previous_thread_id","next_thread_id","created_at","closed_at"],"additionalProperties":false},{"type":"null"}]},"created_at":{"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{3}(?:Z))$"}},"required":["id","organization_id","channel","status","customer_id","assignee_id","users","properties","group_ids","thread","created_at"],"additionalProperties":false},{"type":"null"}]},"group_status":{"type":"string","enum":["online","online_for_queue","offline"]},"capped":{"type":"boolean"}},"required":["customer","chat","group_status"],"additionalProperties":false}},"ping":{"request":{"type":"object","properties":{}},"response":{"type":"object","properties":{},"additionalProperties":false}},"get_chat":{"request":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"limit":{"default":100,"type":"integer","minimum":1,"maximum":500},"cursor":{"type":"string","maxLength":2048}},"required":["chat_id"]},"response":{"type":"object","properties":{"chat":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"organization_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)$"},"channel":{"type":"string","enum":["widget","chat_page","api","email","whatsapp","messenger","instagram","telegram","line","zalo","viber","wechat","kakaotalk","sms","x","discord","slack","teams","apple_messages"]},"status":{"type":"string","enum":["queued","pending","active","inactive","archived"]},"customer_id":{"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"}]},"assignee_id":{"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"}]},"users":{"type":"array","items":{"type":"object","properties":{"id":{"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":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-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":{"type":"string","enum":["agent","customer"]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"avatar_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"present":{"type":"boolean"},"events_seen_up_to":{"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{3}(?:Z))$"},{"type":"null"}]},"visibility":{"type":"string","enum":["all","agents"]}},"required":["id","type","name","avatar_url","present","events_seen_up_to","visibility"],"additionalProperties":false}},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"group_ids":{"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)$"}},"thread":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"active":{"type":"boolean"},"user_ids":{"type":"array","items":{"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":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}]}},"events":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"message"},"text":{"type":"string","minLength":1,"maxLength":16384},"postback":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"thread_id":{"type":"string"},"event_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"type":{"type":"string"},"value":{"type":"string"}},"required":["id","thread_id","event_id","type","value"],"additionalProperties":false},{"type":"null"}]}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","text","postback"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"system"},"subtype":{"type":"string","pattern":"^[a-z_]+(\\.[a-z_]+)+$"},"text":{"type":"string","maxLength":1024},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","subtype","text","details"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"file"},"file_key":{"type":"string","maxLength":512},"name":{"type":"string","maxLength":255},"content_type":{"type":"string","maxLength":127},"size":{"type":"integer","minimum":0,"maximum":9007199254740991},"width":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"height":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"alternative_text":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}]}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","file_key","name","content_type","size","width","height","alternative_text"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"rich_message"},"template":{"type":"string","enum":["cards","quick_replies","sticker"]},"elements":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"title":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"subtitle":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"image_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"buttons":{"maxItems":13,"type":"array","items":{"type":"object","properties":{"text":{"type":"string","maxLength":128},"type":{"type":"string","enum":["message","url","webview","phone","cancel"]},"value":{"type":"string","maxLength":2048},"postback_id":{"type":"string","maxLength":64}},"required":["text","type","value","postback_id"],"additionalProperties":false}}},"required":["title","subtitle","image_url","buttons"],"additionalProperties":false}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","template","elements"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"form"},"form_id":{"type":"string"},"form_kind":{"type":"string","enum":["prechat","postchat","ask_for_email","custom"]},"fields":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"type":{"type":"string","enum":["name","email","text","textarea","select","checkbox","radio","rating","phone"]},"label":{"type":"string","maxLength":512},"required":{"type":"boolean"},"options":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":256}}},"required":["id","type","label","required","options"],"additionalProperties":false}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","form_id","form_kind","fields"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"filled_form"},"form_id":{"type":"string"},"form_kind":{"type":"string","enum":["prechat","postchat","ask_for_email","custom"]},"answers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"answer":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["id","label","answer"],"additionalProperties":false}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","form_id","form_kind","answers"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"custom"},"content":{}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","content"],"additionalProperties":false}]}},"next_cursor":{"default":null,"anyOf":[{"type":"string"},{"type":"null"}]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"group_ids":{"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)$"}},"tags":{"type":"array","items":{"type":"string"}},"queue":{"anyOf":[{"type":"object","properties":{"position":{"type":"integer","minimum":1,"maximum":9007199254740991},"wait_time_s":{"type":"integer","minimum":0,"maximum":9007199254740991},"queued_at":{"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{3}(?:Z))$"}},"required":["position","wait_time_s","queued_at"],"additionalProperties":false},{"type":"null"}]},"rating":{"anyOf":[{"type":"object","properties":{"score":{"anyOf":[{"type":"string","enum":["good","bad"]},{"type":"null"}]},"comment":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"rated_at":{"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{3}(?:Z))$"}},"required":["score","comment","rated_at"],"additionalProperties":false},{"type":"null"}]},"close_reason":{"anyOf":[{"type":"string","enum":["closed_by_agent","closed_by_customer","inactivity","customer_left","customer_banned"]},{"type":"null"}]},"previous_thread_id":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},{"type":"null"}]},"next_thread_id":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},{"type":"null"}]},"created_at":{"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{3}(?:Z))$"},"closed_at":{"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{3}(?:Z))$"},{"type":"null"}]}},"required":["id","chat_id","active","user_ids","events","next_cursor","properties","group_ids","tags","queue","rating","close_reason","previous_thread_id","next_thread_id","created_at","closed_at"],"additionalProperties":false},{"type":"null"}]},"created_at":{"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{3}(?:Z))$"}},"required":["id","organization_id","channel","status","customer_id","assignee_id","users","properties","group_ids","thread","created_at"],"additionalProperties":false}},"required":["chat"],"additionalProperties":false}},"list_threads":{"request":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"page_token":{"type":"string"}},"required":["chat_id"]},"response":{"type":"object","properties":{"threads":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"active":{"type":"boolean"},"user_ids":{"type":"array","items":{"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":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}]}},"events":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"message"},"text":{"type":"string","minLength":1,"maxLength":16384},"postback":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"thread_id":{"type":"string"},"event_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"type":{"type":"string"},"value":{"type":"string"}},"required":["id","thread_id","event_id","type","value"],"additionalProperties":false},{"type":"null"}]}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","text","postback"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"system"},"subtype":{"type":"string","pattern":"^[a-z_]+(\\.[a-z_]+)+$"},"text":{"type":"string","maxLength":1024},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","subtype","text","details"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"file"},"file_key":{"type":"string","maxLength":512},"name":{"type":"string","maxLength":255},"content_type":{"type":"string","maxLength":127},"size":{"type":"integer","minimum":0,"maximum":9007199254740991},"width":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"height":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"alternative_text":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}]}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","file_key","name","content_type","size","width","height","alternative_text"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"rich_message"},"template":{"type":"string","enum":["cards","quick_replies","sticker"]},"elements":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"title":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"subtitle":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"image_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"buttons":{"maxItems":13,"type":"array","items":{"type":"object","properties":{"text":{"type":"string","maxLength":128},"type":{"type":"string","enum":["message","url","webview","phone","cancel"]},"value":{"type":"string","maxLength":2048},"postback_id":{"type":"string","maxLength":64}},"required":["text","type","value","postback_id"],"additionalProperties":false}}},"required":["title","subtitle","image_url","buttons"],"additionalProperties":false}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","template","elements"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"form"},"form_id":{"type":"string"},"form_kind":{"type":"string","enum":["prechat","postchat","ask_for_email","custom"]},"fields":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"type":{"type":"string","enum":["name","email","text","textarea","select","checkbox","radio","rating","phone"]},"label":{"type":"string","maxLength":512},"required":{"type":"boolean"},"options":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":256}}},"required":["id","type","label","required","options"],"additionalProperties":false}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","form_id","form_kind","fields"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"filled_form"},"form_id":{"type":"string"},"form_kind":{"type":"string","enum":["prechat","postchat","ask_for_email","custom"]},"answers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"answer":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["id","label","answer"],"additionalProperties":false}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","form_id","form_kind","answers"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"custom"},"content":{}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","content"],"additionalProperties":false}]}},"next_cursor":{"default":null,"anyOf":[{"type":"string"},{"type":"null"}]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"group_ids":{"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)$"}},"tags":{"type":"array","items":{"type":"string"}},"queue":{"anyOf":[{"type":"object","properties":{"position":{"type":"integer","minimum":1,"maximum":9007199254740991},"wait_time_s":{"type":"integer","minimum":0,"maximum":9007199254740991},"queued_at":{"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{3}(?:Z))$"}},"required":["position","wait_time_s","queued_at"],"additionalProperties":false},{"type":"null"}]},"rating":{"anyOf":[{"type":"object","properties":{"score":{"anyOf":[{"type":"string","enum":["good","bad"]},{"type":"null"}]},"comment":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"rated_at":{"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{3}(?:Z))$"}},"required":["score","comment","rated_at"],"additionalProperties":false},{"type":"null"}]},"close_reason":{"anyOf":[{"type":"string","enum":["closed_by_agent","closed_by_customer","inactivity","customer_left","customer_banned"]},{"type":"null"}]},"previous_thread_id":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},{"type":"null"}]},"next_thread_id":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},{"type":"null"}]},"created_at":{"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{3}(?:Z))$"},"closed_at":{"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{3}(?:Z))$"},{"type":"null"}]}},"required":["id","chat_id","active","user_ids","events","next_cursor","properties","group_ids","tags","queue","rating","close_reason","previous_thread_id","next_thread_id","created_at","closed_at"],"additionalProperties":false}},"next_page_token":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["threads","next_page_token"],"additionalProperties":false}},"start_chat":{"request":{"type":"object","properties":{"group_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)$"},"events":{"maxItems":20,"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"message"},"text":{"type":"string","minLength":1,"maxLength":16384},"custom_id":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"visibility":{"default":"all","type":"string","enum":["all","agents"]},"mentions":{"maxItems":20,"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":["type","text"]},{"type":"object","properties":{"type":{"type":"string","const":"file"},"file_key":{"type":"string","maxLength":512},"name":{"type":"string","maxLength":255},"content_type":{"type":"string","maxLength":127},"size":{"type":"integer","minimum":0,"maximum":9007199254740991},"custom_id":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"visibility":{"default":"all","type":"string","enum":["all","agents"]},"width":{"type":"integer","minimum":0,"maximum":9007199254740991},"height":{"type":"integer","minimum":0,"maximum":9007199254740991},"alternative_text":{"type":"string","maxLength":512}},"required":["type","file_key","name","content_type","size"]},{"type":"object","properties":{"type":{"type":"string","const":"rich_message"},"template":{"type":"string","enum":["cards","quick_replies","sticker"]},"elements":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"title":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"subtitle":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"image_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"buttons":{"maxItems":13,"type":"array","items":{"type":"object","properties":{"text":{"type":"string","maxLength":128},"type":{"type":"string","enum":["message","url","webview","phone","cancel"]},"value":{"type":"string","maxLength":2048},"postback_id":{"type":"string","maxLength":64}},"required":["text","type","value","postback_id"]}}},"required":["title","subtitle","image_url","buttons"]}},"custom_id":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"visibility":{"default":"all","type":"string","enum":["all","agents"]}},"required":["type","template","elements"]},{"type":"object","properties":{"type":{"type":"string","const":"form"},"form_id":{"type":"string"},"form_kind":{"type":"string","enum":["prechat","postchat","ask_for_email","custom"]},"fields":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"type":{"type":"string","enum":["name","email","text","textarea","select","checkbox","radio","rating","phone"]},"label":{"type":"string","maxLength":512},"required":{"type":"boolean"},"options":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":256}}},"required":["id","type","label","required","options"]}},"custom_id":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"visibility":{"default":"all","type":"string","enum":["all","agents"]}},"required":["type","form_id","form_kind","fields"]},{"type":"object","properties":{"type":{"type":"string","const":"filled_form"},"form_id":{"type":"string"},"form_kind":{"type":"string","enum":["prechat","postchat","ask_for_email","custom"]},"answers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"answer":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["id","label","answer"]}},"custom_id":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"visibility":{"default":"all","type":"string","enum":["all","agents"]}},"required":["type","form_id","form_kind","answers"]},{"type":"object","properties":{"type":{"type":"string","const":"custom"},"content":{},"custom_id":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"visibility":{"default":"all","type":"string","enum":["all","agents"]}},"required":["type","content"]}]}},"continuous":{"type":"boolean"},"greeting_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)$"}}},"response":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"event_ids":{"type":"array","items":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"}}},"required":["chat_id","thread_id","event_ids"],"additionalProperties":false}},"close_chat":{"request":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"}},"required":["chat_id"]},"response":{"type":"object","properties":{},"additionalProperties":false}},"send_event":{"request":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"event":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"message"},"text":{"type":"string","minLength":1,"maxLength":16384},"custom_id":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"visibility":{"default":"all","type":"string","enum":["all","agents"]},"mentions":{"maxItems":20,"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":["type","text"]},{"type":"object","properties":{"type":{"type":"string","const":"file"},"file_key":{"type":"string","maxLength":512},"name":{"type":"string","maxLength":255},"content_type":{"type":"string","maxLength":127},"size":{"type":"integer","minimum":0,"maximum":9007199254740991},"custom_id":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"visibility":{"default":"all","type":"string","enum":["all","agents"]},"width":{"type":"integer","minimum":0,"maximum":9007199254740991},"height":{"type":"integer","minimum":0,"maximum":9007199254740991},"alternative_text":{"type":"string","maxLength":512}},"required":["type","file_key","name","content_type","size"]},{"type":"object","properties":{"type":{"type":"string","const":"rich_message"},"template":{"type":"string","enum":["cards","quick_replies","sticker"]},"elements":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"title":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"subtitle":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"image_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"buttons":{"maxItems":13,"type":"array","items":{"type":"object","properties":{"text":{"type":"string","maxLength":128},"type":{"type":"string","enum":["message","url","webview","phone","cancel"]},"value":{"type":"string","maxLength":2048},"postback_id":{"type":"string","maxLength":64}},"required":["text","type","value","postback_id"]}}},"required":["title","subtitle","image_url","buttons"]}},"custom_id":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"visibility":{"default":"all","type":"string","enum":["all","agents"]}},"required":["type","template","elements"]},{"type":"object","properties":{"type":{"type":"string","const":"form"},"form_id":{"type":"string"},"form_kind":{"type":"string","enum":["prechat","postchat","ask_for_email","custom"]},"fields":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"type":{"type":"string","enum":["name","email","text","textarea","select","checkbox","radio","rating","phone"]},"label":{"type":"string","maxLength":512},"required":{"type":"boolean"},"options":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":256}}},"required":["id","type","label","required","options"]}},"custom_id":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"visibility":{"default":"all","type":"string","enum":["all","agents"]}},"required":["type","form_id","form_kind","fields"]},{"type":"object","properties":{"type":{"type":"string","const":"filled_form"},"form_id":{"type":"string"},"form_kind":{"type":"string","enum":["prechat","postchat","ask_for_email","custom"]},"answers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"answer":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["id","label","answer"]}},"custom_id":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"visibility":{"default":"all","type":"string","enum":["all","agents"]}},"required":["type","form_id","form_kind","answers"]},{"type":"object","properties":{"type":{"type":"string","const":"custom"},"content":{},"custom_id":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"visibility":{"default":"all","type":"string","enum":["all","agents"]}},"required":["type","content"]}]}},"required":["chat_id","event"]},"response":{"type":"object","properties":{"event_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"thread_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"replay":{"type":"boolean"}},"required":["event_id","thread_id","seq","replay"],"additionalProperties":false}},"send_sneak_peek":{"request":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"text":{"type":"string","maxLength":16384}},"required":["chat_id","text"]},"response":{"type":"object","properties":{},"additionalProperties":false}},"send_typing":{"request":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"is_typing":{"type":"boolean"}},"required":["chat_id","is_typing"]},"response":{"type":"object","properties":{},"additionalProperties":false}},"mark_events_as_seen":{"request":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"seen_up_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{3}(?:Z))$"}},"required":["chat_id","seen_up_to"]},"response":{"type":"object","properties":{},"additionalProperties":false}},"send_rich_message_postback":{"request":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"event_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"postback_id":{"type":"string","maxLength":64},"value":{"type":"string","maxLength":2048}},"required":["chat_id","event_id","postback_id","value"]},"response":{"type":"object","properties":{},"additionalProperties":false}},"rate_chat":{"request":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"score":{"anyOf":[{"type":"string","enum":["good","bad"]},{"type":"null"}]},"comment":{"type":"string","maxLength":1024}},"required":["chat_id","thread_id","score"]},"response":{"type":"object","properties":{},"additionalProperties":false}},"set_reaction":{"request":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"event_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"reaction":{"anyOf":[{"type":"string","minLength":1,"maxLength":16},{"type":"null"}]}},"required":["chat_id","event_id","reaction"]},"response":{"type":"object","properties":{},"additionalProperties":false}},"update_customer":{"request":{"type":"object","properties":{"name":{"type":"string","maxLength":120},"email":{"type":"string","maxLength":254,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}}},"response":{"type":"object","properties":{},"additionalProperties":false}},"get_predicted_agent":{"request":{"type":"object","properties":{"group_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)$"}}},"response":{"type":"object","properties":{"agent":{"anyOf":[{"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)$"},"name":{"type":"string","minLength":1,"maxLength":120},"avatar_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"job_title":{"type":"string","maxLength":120}},"required":["id","name","avatar_url","job_title"],"additionalProperties":false},{"type":"null"}]},"queued":{"type":"boolean"}},"required":["agent","queued"],"additionalProperties":false}}},"pushes":{"incoming_chat":{"type":"object","properties":{"chat":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"organization_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)$"},"channel":{"type":"string","enum":["widget","chat_page","api","email","whatsapp","messenger","instagram","telegram","line","zalo","viber","wechat","kakaotalk","sms","x","discord","slack","teams","apple_messages"]},"status":{"type":"string","enum":["queued","pending","active","inactive","archived"]},"customer_id":{"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"}]},"assignee_id":{"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"}]},"users":{"type":"array","items":{"type":"object","properties":{"id":{"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":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-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":{"type":"string","enum":["agent","customer"]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"avatar_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"present":{"type":"boolean"},"events_seen_up_to":{"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{3}(?:Z))$"},{"type":"null"}]},"visibility":{"type":"string","enum":["all","agents"]}},"required":["id","type","name","avatar_url","present","events_seen_up_to","visibility"],"additionalProperties":false}},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"group_ids":{"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)$"}},"thread":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"active":{"type":"boolean"},"user_ids":{"type":"array","items":{"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":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}]}},"events":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"message"},"text":{"type":"string","minLength":1,"maxLength":16384},"postback":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"thread_id":{"type":"string"},"event_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"type":{"type":"string"},"value":{"type":"string"}},"required":["id","thread_id","event_id","type","value"],"additionalProperties":false},{"type":"null"}]}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","text","postback"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"system"},"subtype":{"type":"string","pattern":"^[a-z_]+(\\.[a-z_]+)+$"},"text":{"type":"string","maxLength":1024},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","subtype","text","details"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"file"},"file_key":{"type":"string","maxLength":512},"name":{"type":"string","maxLength":255},"content_type":{"type":"string","maxLength":127},"size":{"type":"integer","minimum":0,"maximum":9007199254740991},"width":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"height":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"alternative_text":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}]}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","file_key","name","content_type","size","width","height","alternative_text"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"rich_message"},"template":{"type":"string","enum":["cards","quick_replies","sticker"]},"elements":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"title":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"subtitle":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"image_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"buttons":{"maxItems":13,"type":"array","items":{"type":"object","properties":{"text":{"type":"string","maxLength":128},"type":{"type":"string","enum":["message","url","webview","phone","cancel"]},"value":{"type":"string","maxLength":2048},"postback_id":{"type":"string","maxLength":64}},"required":["text","type","value","postback_id"],"additionalProperties":false}}},"required":["title","subtitle","image_url","buttons"],"additionalProperties":false}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","template","elements"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"form"},"form_id":{"type":"string"},"form_kind":{"type":"string","enum":["prechat","postchat","ask_for_email","custom"]},"fields":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"type":{"type":"string","enum":["name","email","text","textarea","select","checkbox","radio","rating","phone"]},"label":{"type":"string","maxLength":512},"required":{"type":"boolean"},"options":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":256}}},"required":["id","type","label","required","options"],"additionalProperties":false}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","form_id","form_kind","fields"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"filled_form"},"form_id":{"type":"string"},"form_kind":{"type":"string","enum":["prechat","postchat","ask_for_email","custom"]},"answers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"answer":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["id","label","answer"],"additionalProperties":false}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","form_id","form_kind","answers"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"custom"},"content":{}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","content"],"additionalProperties":false}]}},"next_cursor":{"default":null,"anyOf":[{"type":"string"},{"type":"null"}]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"group_ids":{"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)$"}},"tags":{"type":"array","items":{"type":"string"}},"queue":{"anyOf":[{"type":"object","properties":{"position":{"type":"integer","minimum":1,"maximum":9007199254740991},"wait_time_s":{"type":"integer","minimum":0,"maximum":9007199254740991},"queued_at":{"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{3}(?:Z))$"}},"required":["position","wait_time_s","queued_at"],"additionalProperties":false},{"type":"null"}]},"rating":{"anyOf":[{"type":"object","properties":{"score":{"anyOf":[{"type":"string","enum":["good","bad"]},{"type":"null"}]},"comment":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"rated_at":{"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{3}(?:Z))$"}},"required":["score","comment","rated_at"],"additionalProperties":false},{"type":"null"}]},"close_reason":{"anyOf":[{"type":"string","enum":["closed_by_agent","closed_by_customer","inactivity","customer_left","customer_banned"]},{"type":"null"}]},"previous_thread_id":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},{"type":"null"}]},"next_thread_id":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},{"type":"null"}]},"created_at":{"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{3}(?:Z))$"},"closed_at":{"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{3}(?:Z))$"},{"type":"null"}]}},"required":["id","chat_id","active","user_ids","events","next_cursor","properties","group_ids","tags","queue","rating","close_reason","previous_thread_id","next_thread_id","created_at","closed_at"],"additionalProperties":false},{"type":"null"}]},"created_at":{"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{3}(?:Z))$"}},"required":["id","organization_id","channel","status","customer_id","assignee_id","users","properties","group_ids","thread","created_at"],"additionalProperties":false}},"required":["chat"],"additionalProperties":false},"chat_closed":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"reason":{"type":"string","enum":["closed_by_agent","closed_by_customer","inactivity","customer_left","customer_banned"]}},"required":["chat_id","thread_id","reason"],"additionalProperties":false},"chat_transferred":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"queued":{"type":"boolean"}},"required":["chat_id","thread_id","queued"],"additionalProperties":false},"user_added_to_chat":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"user":{"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)$"},"name":{"type":"string","minLength":1,"maxLength":120},"avatar_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"job_title":{"type":"string","maxLength":120}},"required":["id","name","avatar_url","job_title"],"additionalProperties":false}},"required":["chat_id","thread_id","user"],"additionalProperties":false},"user_removed_from_chat":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"user_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)$"}},"required":["chat_id","thread_id","user_id"],"additionalProperties":false},"incoming_event":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"event":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"message"},"text":{"type":"string","minLength":1,"maxLength":16384},"postback":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"thread_id":{"type":"string"},"event_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"type":{"type":"string"},"value":{"type":"string"}},"required":["id","thread_id","event_id","type","value"],"additionalProperties":false},{"type":"null"}]}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","text","postback"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"system"},"subtype":{"type":"string","pattern":"^[a-z_]+(\\.[a-z_]+)+$"},"text":{"type":"string","maxLength":1024},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","subtype","text","details"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"file"},"file_key":{"type":"string","maxLength":512},"name":{"type":"string","maxLength":255},"content_type":{"type":"string","maxLength":127},"size":{"type":"integer","minimum":0,"maximum":9007199254740991},"width":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"height":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"alternative_text":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}]}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","file_key","name","content_type","size","width","height","alternative_text"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"rich_message"},"template":{"type":"string","enum":["cards","quick_replies","sticker"]},"elements":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"title":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"subtitle":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"image_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"buttons":{"maxItems":13,"type":"array","items":{"type":"object","properties":{"text":{"type":"string","maxLength":128},"type":{"type":"string","enum":["message","url","webview","phone","cancel"]},"value":{"type":"string","maxLength":2048},"postback_id":{"type":"string","maxLength":64}},"required":["text","type","value","postback_id"],"additionalProperties":false}}},"required":["title","subtitle","image_url","buttons"],"additionalProperties":false}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","template","elements"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"form"},"form_id":{"type":"string"},"form_kind":{"type":"string","enum":["prechat","postchat","ask_for_email","custom"]},"fields":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"type":{"type":"string","enum":["name","email","text","textarea","select","checkbox","radio","rating","phone"]},"label":{"type":"string","maxLength":512},"required":{"type":"boolean"},"options":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":256}}},"required":["id","type","label","required","options"],"additionalProperties":false}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","form_id","form_kind","fields"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"filled_form"},"form_id":{"type":"string"},"form_kind":{"type":"string","enum":["prechat","postchat","ask_for_email","custom"]},"answers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"answer":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["id","label","answer"],"additionalProperties":false}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","form_id","form_kind","answers"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"custom"},"content":{}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","content"],"additionalProperties":false}]},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["chat_id","thread_id","event","seq"],"additionalProperties":false},"incoming_event_preview":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"author_id":{"type":"string"},"text":{"type":"string"}},"required":["chat_id","thread_id","author_id","text"],"additionalProperties":false},"event_updated":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"event":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"message"},"text":{"type":"string","minLength":1,"maxLength":16384},"postback":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"thread_id":{"type":"string"},"event_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"type":{"type":"string"},"value":{"type":"string"}},"required":["id","thread_id","event_id","type","value"],"additionalProperties":false},{"type":"null"}]}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","text","postback"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"system"},"subtype":{"type":"string","pattern":"^[a-z_]+(\\.[a-z_]+)+$"},"text":{"type":"string","maxLength":1024},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","subtype","text","details"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"file"},"file_key":{"type":"string","maxLength":512},"name":{"type":"string","maxLength":255},"content_type":{"type":"string","maxLength":127},"size":{"type":"integer","minimum":0,"maximum":9007199254740991},"width":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"height":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"alternative_text":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}]}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","file_key","name","content_type","size","width","height","alternative_text"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"rich_message"},"template":{"type":"string","enum":["cards","quick_replies","sticker"]},"elements":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"title":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"subtitle":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"image_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"buttons":{"maxItems":13,"type":"array","items":{"type":"object","properties":{"text":{"type":"string","maxLength":128},"type":{"type":"string","enum":["message","url","webview","phone","cancel"]},"value":{"type":"string","maxLength":2048},"postback_id":{"type":"string","maxLength":64}},"required":["text","type","value","postback_id"],"additionalProperties":false}}},"required":["title","subtitle","image_url","buttons"],"additionalProperties":false}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","template","elements"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"form"},"form_id":{"type":"string"},"form_kind":{"type":"string","enum":["prechat","postchat","ask_for_email","custom"]},"fields":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"type":{"type":"string","enum":["name","email","text","textarea","select","checkbox","radio","rating","phone"]},"label":{"type":"string","maxLength":512},"required":{"type":"boolean"},"options":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":256}}},"required":["id","type","label","required","options"],"additionalProperties":false}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","form_id","form_kind","fields"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"filled_form"},"form_id":{"type":"string"},"form_kind":{"type":"string","enum":["prechat","postchat","ask_for_email","custom"]},"answers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"answer":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["id","label","answer"],"additionalProperties":false}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","form_id","form_kind","answers"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"custom"},"content":{}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","content"],"additionalProperties":false}]}},"required":["chat_id","thread_id","event"],"additionalProperties":false},"event_deleted":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"event_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"}},"required":["chat_id","thread_id","event_id"],"additionalProperties":false},"incoming_typing":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"user_id":{"type":"string"},"is_typing":{"type":"boolean"}},"required":["chat_id","thread_id","user_id","is_typing"],"additionalProperties":false},"events_marked_as_seen":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"user_id":{"type":"string"},"seen_up_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{3}(?:Z))$"}},"required":["chat_id","user_id","seen_up_to"],"additionalProperties":false},"queue_position_updated":{"type":"object","properties":{"chat_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"thread_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"wait_time_s":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["chat_id","thread_id","position","wait_time_s"],"additionalProperties":false},"incoming_greeting":{"type":"object","properties":{"greeting_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)$"},"unique_id":{"type":"string"},"event":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"message"},"text":{"type":"string","minLength":1,"maxLength":16384},"postback":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"thread_id":{"type":"string"},"event_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"type":{"type":"string"},"value":{"type":"string"}},"required":["id","thread_id","event_id","type","value"],"additionalProperties":false},{"type":"null"}]}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","text","postback"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"system"},"subtype":{"type":"string","pattern":"^[a-z_]+(\\.[a-z_]+)+$"},"text":{"type":"string","maxLength":1024},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","subtype","text","details"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"file"},"file_key":{"type":"string","maxLength":512},"name":{"type":"string","maxLength":255},"content_type":{"type":"string","maxLength":127},"size":{"type":"integer","minimum":0,"maximum":9007199254740991},"width":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"height":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"alternative_text":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}]}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","file_key","name","content_type","size","width","height","alternative_text"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"rich_message"},"template":{"type":"string","enum":["cards","quick_replies","sticker"]},"elements":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"title":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"subtitle":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}]},"image_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"buttons":{"maxItems":13,"type":"array","items":{"type":"object","properties":{"text":{"type":"string","maxLength":128},"type":{"type":"string","enum":["message","url","webview","phone","cancel"]},"value":{"type":"string","maxLength":2048},"postback_id":{"type":"string","maxLength":64}},"required":["text","type","value","postback_id"],"additionalProperties":false}}},"required":["title","subtitle","image_url","buttons"],"additionalProperties":false}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","template","elements"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"form"},"form_id":{"type":"string"},"form_kind":{"type":"string","enum":["prechat","postchat","ask_for_email","custom"]},"fields":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"type":{"type":"string","enum":["name","email","text","textarea","select","checkbox","radio","rating","phone"]},"label":{"type":"string","maxLength":512},"required":{"type":"boolean"},"options":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":256}}},"required":["id","type","label","required","options"],"additionalProperties":false}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","form_id","form_kind","fields"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"filled_form"},"form_id":{"type":"string"},"form_kind":{"type":"string","enum":["prechat","postchat","ask_for_email","custom"]},"answers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"answer":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["id","label","answer"],"additionalProperties":false}}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","form_id","form_kind","answers"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}_\\d+$"},"custom_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"author_id":{"type":"string"},"author_type":{"type":"string","enum":["agent","bot","customer","system"]},"created_at":{"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{3}(?:Z))$"},"visibility":{"type":"string","enum":["all","agents"]},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"type":{"type":"string","const":"custom"},"content":{}},"required":["id","custom_id","author_id","author_type","created_at","visibility","properties","type","content"],"additionalProperties":false}]},"agent":{"anyOf":[{"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)$"},"name":{"type":"string","minLength":1,"maxLength":120},"avatar_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"job_title":{"type":"string","maxLength":120}},"required":["id","name","avatar_url","job_title"],"additionalProperties":false},{"type":"null"}]}},"required":["greeting_id","unique_id","event","agent"],"additionalProperties":false},"customer_updated":{"type":"object","properties":{"customer":{"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)$"},"organization_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)$"},"visitor_id":{"anyOf":[{"type":"string","minLength":8,"maxLength":64},{"type":"null"}]},"external_user_id":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}]},"name":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"email":{"anyOf":[{"type":"string","maxLength":254,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}]},"avatar_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"session_fields":{"maxItems":50,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","maxLength":64},{"type":"string","maxLength":512}]}},"properties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"first_seen_at":{"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{3}(?:Z))$"},"last_seen_at":{"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{3}(?:Z))$"},"banned_until":{"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{3}(?:Z))$"},{"type":"null"}]}},"required":["id","organization_id","visitor_id","external_user_id","name","email","phone","avatar_url","session_fields","properties","first_seen_at","last_seen_at","banned_until"],"additionalProperties":false}},"required":["customer"],"additionalProperties":false},"customer_disconnected":{"type":"object","properties":{"reason":{"type":"string","enum":["banned","token_expired","inactivity_timeout","too_many_connections","license_expired","service_unavailable"]},"reconnect":{"type":"boolean"}},"required":["reason","reconnect"],"additionalProperties":false}}}}}