{
  "components": {
    "schemas": {
      "AIAgentTestMessage": {
        "additionalProperties": false,
        "properties": {
          "role": {
            "enum": [
              "customer",
              "ai",
              "agent"
            ],
            "type": "string"
          },
          "text": {
            "maxLength": 4000,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "role",
          "text"
        ],
        "type": "object"
      },
      "AIAgentTestResult": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/AIAgentTestResult.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "actions": {
            "items": {
              "$ref": "#/components/schemas/AgentAction"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "confidence": {
            "type": "string"
          },
          "consulted": {
            "description": "Everything retrieved for the question",
            "items": {
              "$ref": "#/components/schemas/AgentPassage"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "detail": {
            "description": "What triggered the hand-off (a topic, the model's reason)",
            "type": "string"
          },
          "gap": {
            "description": "The question it could not answer",
            "type": "string"
          },
          "handoff": {
            "type": "boolean"
          },
          "kind": {
            "enum": [
              "answer",
              "clarify",
              "unknown",
              "resolved",
              "handoff"
            ],
            "type": "string"
          },
          "language": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "pre_model": {
            "type": "boolean"
          },
          "reason": {
            "type": "string"
          },
          "reason_text": {
            "type": "string"
          },
          "reply": {
            "type": "string"
          },
          "sources": {
            "description": "Sources the reply cites",
            "items": {
              "$ref": "#/components/schemas/AgentPassage"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "sources_shown": {
            "items": {
              "$ref": "#/components/schemas/AgentSource"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "summary": {
            "description": "For the team's private note",
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "tools": {
            "items": {
              "$ref": "#/components/schemas/AgentToolUse"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "usage": {
            "$ref": "#/components/schemas/Usage"
          }
        },
        "required": [
          "text",
          "sources_shown",
          "kind",
          "reply",
          "sources",
          "consulted",
          "handoff",
          "actions",
          "tools",
          "language",
          "usage",
          "pre_model"
        ],
        "type": "object"
      },
      "AIAgentView": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/AIAgentView.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "ai_enabled": {
            "description": "Settings → AI is on",
            "type": "boolean"
          },
          "attachments_allowed": {
            "type": "boolean"
          },
          "avatar_url": {
            "description": "https image shown to customers; empty uses the AI marker",
            "maxLength": 500,
            "type": "string"
          },
          "bot_id": {
            "description": "The bot that holds the agent's conversations (after the first save)",
            "format": "int64",
            "type": "integer"
          },
          "disclosure": {
            "description": "The automated-reply line under email replies; empty uses the default in the workspace's language",
            "maxLength": 200,
            "type": "string"
          },
          "enabled": {
            "description": "The AI agent answers in the inboxes it is listed in (AI must be on with a key)",
            "type": "boolean"
          },
          "greeting": {
            "description": "Sent when the agent takes a conversation that has no question yet",
            "maxLength": 500,
            "type": "string"
          },
          "handoff": {
            "$ref": "#/components/schemas/AgentHandoff"
          },
          "handoff_on_upset": {
            "description": "Hand off when the customer seems upset",
            "type": "boolean"
          },
          "handoff_topics": {
            "description": "Words or phrases that always go to a person (refund, cancel my account, ...)",
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "hours": {
            "enum": [
              "always",
              "outside_hours",
              "inside_hours"
            ],
            "type": "string"
          },
          "inbox_ids": {
            "description": "Inboxes whose bots and flows include the AI agent",
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "include_attachments": {
            "description": "Read customers' images and PDFs (only when Settings → AI allows attachments)",
            "type": "boolean"
          },
          "key_set": {
            "type": "boolean"
          },
          "languages": {
            "description": "Languages it answers in; empty answers in the customer's language",
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "max_turns": {
            "description": "Replies before a conversation that is not resolved goes to a person",
            "format": "int64",
            "maximum": 20,
            "minimum": 1,
            "type": "integer"
          },
          "name": {
            "description": "Shown to customers next to its replies",
            "maxLength": 60,
            "type": "string"
          },
          "persona": {
            "description": "Tone and persona instructions (they never override the grounding and safety rules)",
            "maxLength": 1000,
            "type": "string"
          },
          "use_connectors": {
            "description": "Use data connectors marked \"Offer to the AI agent\" to look up this customer's data",
            "type": "boolean"
          },
          "use_internal": {
            "description": "Also answer from internal articles and snippets (never shown or linked to customers)",
            "type": "boolean"
          }
        },
        "required": [
          "inbox_ids",
          "ai_enabled",
          "key_set",
          "attachments_allowed"
        ],
        "type": "object"
      },
      "AISettings": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/AISettings.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "auto_summarize": {
            "type": "boolean"
          },
          "base_url": {
            "type": "string"
          },
          "budget": {
            "$ref": "#/components/schemas/Budget"
          },
          "default_models": {
            "$ref": "#/components/schemas/Models"
          },
          "enabled": {
            "type": "boolean"
          },
          "include_attachments": {
            "type": "boolean"
          },
          "key_set": {
            "description": "A key is stored; it is never returned",
            "type": "boolean"
          },
          "known_prices": {
            "additionalProperties": {
              "$ref": "#/components/schemas/Price"
            },
            "type": "object"
          },
          "models": {
            "$ref": "#/components/schemas/Models"
          },
          "prices": {
            "additionalProperties": {
              "$ref": "#/components/schemas/Price"
            },
            "type": "object"
          },
          "provider": {
            "type": "string"
          }
        },
        "required": [
          "key_set",
          "default_models",
          "known_prices",
          "enabled",
          "provider",
          "base_url",
          "models",
          "include_attachments",
          "auto_summarize",
          "budget"
        ],
        "type": "object"
      },
      "AITestResult": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/AITestResult.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "kind": {
            "description": "Why it failed: auth, not_configured, network, unavailable, rate_limited, invalid, timeout",
            "type": "string"
          },
          "latency_ms": {
            "format": "int64",
            "type": "integer"
          },
          "message": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "ok": {
            "type": "boolean"
          }
        },
        "required": [
          "ok",
          "message",
          "model",
          "latency_ms"
        ],
        "type": "object"
      },
      "APIKey": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/APIKey.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "expires_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "key": {
            "description": "Shown once, on create",
            "type": "string"
          },
          "last_used_at": {
            "format": "date-time",
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "permissions": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "prefix": {
            "description": "First characters of the key, for recognising it",
            "type": "string"
          },
          "revoked_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "prefix",
          "permissions",
          "created_at"
        ],
        "type": "object"
      },
      "APIKeyImpact": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/APIKeyImpact.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "confirm": {
            "description": "Pass this (the key's name) as confirm to revoke",
            "type": "string"
          },
          "created_by": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "in_use": {
            "description": "Used in the last 7 days",
            "type": "boolean"
          },
          "last_used_at": {
            "description": "Updated at most once a minute",
            "format": "date-time",
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "permissions": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "prefix": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "prefix",
          "permissions",
          "in_use",
          "confirm"
        ],
        "type": "object"
      },
      "AcceptInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/AcceptInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "name": {
            "maxLength": 120,
            "type": "string"
          },
          "password": {
            "maxLength": 1024,
            "type": "string"
          },
          "token": {
            "maxLength": 200,
            "minLength": 20,
            "type": "string"
          }
        },
        "required": [
          "token"
        ],
        "type": "object"
      },
      "AcceptInvitationOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/AcceptInvitationOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "account_id": {
            "format": "int64",
            "type": "integer"
          },
          "sign_in_required": {
            "description": "true when the invitation joined an existing user: no session is opened and the user signs in with their own credentials",
            "type": "boolean"
          },
          "user_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "account_id",
          "user_id",
          "sign_in_required"
        ],
        "type": "object"
      },
      "AcceptedOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/AcceptedOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "status": {
            "examples": [
              "accepted"
            ],
            "type": "string"
          }
        },
        "required": [
          "status"
        ],
        "type": "object"
      },
      "AccessInbox": {
        "additionalProperties": false,
        "properties": {
          "channel_kind": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "channel_kind"
        ],
        "type": "object"
      },
      "AccessMember": {
        "additionalProperties": false,
        "properties": {
          "access": {
            "description": "Their reach in every inbox of the workspace (none for disabled members; invitations as their role gives it before any membership)",
            "items": {
              "$ref": "#/components/schemas/InboxAccess"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "email": {
            "type": "string"
          },
          "inbox_ids": {
            "description": "Inboxes they are a member of",
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "is_owner": {
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "role_id": {
            "format": "int64",
            "type": "integer"
          },
          "status": {
            "enum": [
              "active",
              "disabled",
              "invited"
            ],
            "type": "string"
          },
          "team_ids": {
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "user_id": {
            "description": "0 for an invitation",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "name",
          "email",
          "status",
          "is_owner",
          "role_id",
          "team_ids",
          "inbox_ids",
          "access"
        ],
        "type": "object"
      },
      "AccessOverviewOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/AccessOverviewOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "_redacted": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "inboxes": {
            "items": {
              "$ref": "#/components/schemas/AccessInbox"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "members": {
            "items": {
              "$ref": "#/components/schemas/AccessMember"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "reduced": {
            "type": "boolean"
          },
          "roles": {
            "items": {
              "$ref": "#/components/schemas/AccessRole"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "tags": {
            "description": "Every field tag in catalogue order, with the custom attributes that carry it",
            "items": {
              "$ref": "#/components/schemas/AccessTag"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "teams": {
            "items": {
              "$ref": "#/components/schemas/AccessTeam"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "roles",
          "members",
          "inboxes",
          "teams",
          "tags",
          "reduced"
        ],
        "type": "object"
      },
      "AccessRole": {
        "additionalProperties": false,
        "properties": {
          "conversation_verb": {
            "enum": [
              "",
              "read",
              "reply",
              "manage"
            ],
            "type": "string"
          },
          "fields": {
            "description": "The mode of every field tag, in catalogue order",
            "items": {
              "$ref": "#/components/schemas/FieldGrant"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "is_system": {
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "permissions": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "visibility": {
            "items": {
              "$ref": "#/components/schemas/Visibility"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "name",
          "is_system",
          "permissions",
          "visibility",
          "fields",
          "conversation_verb"
        ],
        "type": "object"
      },
      "AccessTag": {
        "additionalProperties": false,
        "properties": {
          "attributes": {
            "items": {
              "$ref": "#/components/schemas/AccessTagAttribute"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "tag": {
            "type": "string"
          }
        },
        "required": [
          "tag",
          "attributes"
        ],
        "type": "object"
      },
      "AccessTagAttribute": {
        "additionalProperties": false,
        "properties": {
          "key": {
            "type": "string"
          },
          "model": {
            "enum": [
              "contact",
              "conversation"
            ],
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "model",
          "key",
          "name"
        ],
        "type": "object"
      },
      "AccessTeam": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ],
        "type": "object"
      },
      "Account": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/Account.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "edition": {
            "enum": [
              "community",
              "saas"
            ],
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "is_owner": {
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "owner_user_id": {
            "format": "int64",
            "type": "integer"
          },
          "slug": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "slug",
          "name",
          "owner_user_id",
          "edition",
          "is_owner"
        ],
        "type": "object"
      },
      "AccountUpdateInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/AccountUpdateInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "name": {
            "maxLength": 120,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "Action": {
        "additionalProperties": false,
        "properties": {
          "params": {},
          "type": {
            "type": "string"
          }
        },
        "required": [
          "type"
        ],
        "type": "object"
      },
      "ActionInfo": {
        "additionalProperties": false,
        "properties": {
          "label": {
            "type": "string"
          },
          "macro_permission": {
            "type": "string"
          },
          "params_schema": {},
          "permission": {
            "type": "string"
          },
          "rules_only": {
            "type": "boolean"
          },
          "type": {
            "type": "string"
          }
        },
        "required": [
          "type",
          "label",
          "permission",
          "params_schema"
        ],
        "type": "object"
      },
      "ActivityOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ActivityOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "active_agents": {
            "format": "int64",
            "type": "integer"
          },
          "agents": {
            "items": {
              "$ref": "#/components/schemas/AgentActivity"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "api_keys": {
            "items": {
              "$ref": "#/components/schemas/RefUsage"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "apps": {
            "items": {
              "$ref": "#/components/schemas/RefUsage"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "daily": {
            "items": {
              "$ref": "#/components/schemas/DayActivity"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "days": {
            "format": "int64",
            "type": "integer"
          },
          "features": {
            "items": {
              "$ref": "#/components/schemas/FeatureUsage"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "from": {
            "description": "First day of the range (UTC, YYYY-MM-DD)",
            "type": "string"
          },
          "members": {
            "format": "int64",
            "type": "integer"
          },
          "prev_active_agents": {
            "format": "int64",
            "type": "integer"
          },
          "prev_sign_ins": {
            "format": "int64",
            "type": "integer"
          },
          "retention_days": {
            "description": "How long the counts are kept (retention.activity_days)",
            "format": "int64",
            "type": "integer"
          },
          "sign_in_people": {
            "format": "int64",
            "type": "integer"
          },
          "sign_ins": {
            "format": "int64",
            "type": "integer"
          },
          "to": {
            "description": "Last day of the range, today (UTC)",
            "type": "string"
          },
          "today": {
            "type": "string"
          },
          "week": {
            "$ref": "#/components/schemas/WeekTrend"
          },
          "weekly": {
            "items": {
              "$ref": "#/components/schemas/WeekActivity"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "retention_days",
          "days",
          "from",
          "to",
          "today",
          "members",
          "active_agents",
          "prev_active_agents",
          "sign_ins",
          "sign_in_people",
          "prev_sign_ins",
          "week",
          "features",
          "agents",
          "daily",
          "weekly",
          "api_keys",
          "apps"
        ],
        "type": "object"
      },
      "AdminHealth": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/AdminHealth.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "agents_online": {
            "format": "int64",
            "type": "integer"
          },
          "automation_failures_24h": {
            "format": "int64",
            "type": "integer"
          },
          "bots_paused": {
            "format": "int64",
            "type": "integer"
          },
          "healthy": {
            "type": "boolean"
          },
          "inboxes": {
            "items": {
              "$ref": "#/components/schemas/InboxHealth"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "open_conversations": {
            "format": "int64",
            "type": "integer"
          },
          "unassigned": {
            "format": "int64",
            "type": "integer"
          },
          "unpublished_events": {
            "description": "Events of this workspace not yet fanned out",
            "format": "int64",
            "type": "integer"
          },
          "webhooks": {
            "items": {
              "$ref": "#/components/schemas/WebhookHealth"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "inboxes",
          "webhooks",
          "bots_paused",
          "automation_failures_24h",
          "unpublished_events",
          "agents_online",
          "open_conversations",
          "unassigned",
          "healthy"
        ],
        "type": "object"
      },
      "AgentAction": {
        "additionalProperties": false,
        "properties": {
          "kind": {
            "enum": [
              "add_tag",
              "set_priority"
            ],
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        },
        "required": [
          "kind",
          "value"
        ],
        "type": "object"
      },
      "AgentActivity": {
        "additionalProperties": false,
        "properties": {
          "active_days": {
            "format": "int64",
            "type": "integer"
          },
          "assigned": {
            "format": "int64",
            "type": "integer"
          },
          "canned": {
            "format": "int64",
            "type": "integer"
          },
          "last_active": {
            "description": "Last day the person replied or changed a conversation, within the retention window",
            "type": "string"
          },
          "macros": {
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "notes": {
            "format": "int64",
            "type": "integer"
          },
          "replies": {
            "format": "int64",
            "type": "integer"
          },
          "resolved": {
            "format": "int64",
            "type": "integer"
          },
          "sign_ins": {
            "format": "int64",
            "type": "integer"
          },
          "user_id": {
            "format": "int64",
            "type": "integer"
          },
          "views": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "user_id",
          "name",
          "sign_ins",
          "active_days",
          "replies",
          "notes",
          "resolved",
          "assigned",
          "canned",
          "macros",
          "views"
        ],
        "type": "object"
      },
      "AgentGap": {
        "additionalProperties": false,
        "properties": {
          "at": {
            "format": "date-time",
            "type": "string"
          },
          "conversation_id": {
            "format": "int64",
            "type": "integer"
          },
          "locale": {
            "type": "string"
          },
          "question": {
            "type": "string"
          },
          "reason": {
            "enum": [
              "no_answer",
              "low_confidence"
            ],
            "type": "string"
          }
        },
        "required": [
          "conversation_id",
          "question",
          "locale",
          "reason",
          "at"
        ],
        "type": "object"
      },
      "AgentHandoff": {
        "additionalProperties": false,
        "properties": {
          "target": {
            "description": "unassigned (the inbox's queue), team, agent, or next (the inbox's next bot or flow, else people)",
            "enum": [
              "unassigned",
              "team",
              "agent",
              "next"
            ],
            "type": "string"
          },
          "team_id": {
            "format": "int64",
            "type": "integer"
          },
          "user_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "AgentPassage": {
        "additionalProperties": false,
        "properties": {
          "kind": {
            "enum": [
              "article",
              "snippet",
              "source"
            ],
            "type": "string"
          },
          "locale": {
            "type": "string"
          },
          "ref": {
            "type": "string"
          },
          "score": {
            "format": "double",
            "type": "number"
          },
          "title": {
            "type": "string"
          },
          "url": {
            "description": "Public link, only for live public articles of an active help center",
            "type": "string"
          },
          "visibility": {
            "type": "string"
          }
        },
        "required": [
          "ref",
          "kind",
          "title",
          "visibility",
          "locale",
          "score"
        ],
        "type": "object"
      },
      "AgentReasonCount": {
        "additionalProperties": false,
        "properties": {
          "count": {
            "format": "int64",
            "type": "integer"
          },
          "reason": {
            "type": "string"
          }
        },
        "required": [
          "reason",
          "count"
        ],
        "type": "object"
      },
      "AgentReplyInfo": {
        "additionalProperties": false,
        "properties": {
          "avatar_url": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "sources": {
            "items": {
              "$ref": "#/components/schemas/AgentSource"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "name",
          "sources"
        ],
        "type": "object"
      },
      "AgentReport": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/AgentReport.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "active": {
            "format": "int64",
            "type": "integer"
          },
          "answered": {
            "description": "Replies grounded in the workspace's content",
            "format": "int64",
            "type": "integer"
          },
          "conversations": {
            "description": "Stretches the agent held a conversation",
            "format": "int64",
            "type": "integer"
          },
          "from": {
            "format": "date-time",
            "type": "string"
          },
          "handed_off": {
            "format": "int64",
            "type": "integer"
          },
          "handoff_rate": {
            "description": "handed_off / ended (0-1)",
            "format": "double",
            "type": "number"
          },
          "reasons": {
            "items": {
              "$ref": "#/components/schemas/AgentReasonCount"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "released": {
            "description": "A person, a rule or another responder took over",
            "format": "int64",
            "type": "integer"
          },
          "replies": {
            "format": "int64",
            "type": "integer"
          },
          "resolution_rate": {
            "description": "resolved / ended (0-1)",
            "format": "double",
            "type": "number"
          },
          "resolved": {
            "description": "The customer confirmed the answer helped",
            "format": "int64",
            "type": "integer"
          },
          "to": {
            "format": "date-time",
            "type": "string"
          },
          "unanswered": {
            "description": "The latest questions without an answer (personal data removed)",
            "items": {
              "$ref": "#/components/schemas/AgentGap"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "unanswered_total": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "from",
          "to",
          "conversations",
          "active",
          "resolved",
          "handed_off",
          "released",
          "resolution_rate",
          "handoff_rate",
          "replies",
          "answered",
          "reasons",
          "unanswered",
          "unanswered_total"
        ],
        "type": "object"
      },
      "AgentSettings": {
        "additionalProperties": false,
        "properties": {
          "avatar_url": {
            "description": "https image shown to customers; empty uses the AI marker",
            "maxLength": 500,
            "type": "string"
          },
          "disclosure": {
            "description": "The automated-reply line under email replies; empty uses the default in the workspace's language",
            "maxLength": 200,
            "type": "string"
          },
          "enabled": {
            "description": "The AI agent answers in the inboxes it is listed in (AI must be on with a key)",
            "type": "boolean"
          },
          "greeting": {
            "description": "Sent when the agent takes a conversation that has no question yet",
            "maxLength": 500,
            "type": "string"
          },
          "handoff": {
            "$ref": "#/components/schemas/AgentHandoff"
          },
          "handoff_on_upset": {
            "description": "Hand off when the customer seems upset",
            "type": "boolean"
          },
          "handoff_topics": {
            "description": "Words or phrases that always go to a person (refund, cancel my account, ...)",
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "hours": {
            "enum": [
              "always",
              "outside_hours",
              "inside_hours"
            ],
            "type": "string"
          },
          "include_attachments": {
            "description": "Read customers' images and PDFs (only when Settings → AI allows attachments)",
            "type": "boolean"
          },
          "languages": {
            "description": "Languages it answers in; empty answers in the customer's language",
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "max_turns": {
            "description": "Replies before a conversation that is not resolved goes to a person",
            "format": "int64",
            "maximum": 20,
            "minimum": 1,
            "type": "integer"
          },
          "name": {
            "description": "Shown to customers next to its replies",
            "maxLength": 60,
            "type": "string"
          },
          "persona": {
            "description": "Tone and persona instructions (they never override the grounding and safety rules)",
            "maxLength": 1000,
            "type": "string"
          },
          "use_connectors": {
            "description": "Use data connectors marked \"Offer to the AI agent\" to look up this customer's data",
            "type": "boolean"
          },
          "use_internal": {
            "description": "Also answer from internal articles and snippets (never shown or linked to customers)",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "AgentSource": {
        "additionalProperties": false,
        "properties": {
          "title": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "title",
          "url"
        ],
        "type": "object"
      },
      "AgentToolUse": {
        "additionalProperties": false,
        "properties": {
          "label": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "enum": [
              "ok",
              "error",
              "refused",
              "skipped"
            ],
            "type": "string"
          }
        },
        "required": [
          "name",
          "label",
          "status"
        ],
        "type": "object"
      },
      "AiAgentPutInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/AiAgentPutInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "avatar_url": {
            "description": "https image shown to customers; empty uses the AI marker",
            "maxLength": 500,
            "type": "string"
          },
          "disclosure": {
            "description": "The automated-reply line under email replies; empty uses the default in the workspace's language",
            "maxLength": 200,
            "type": "string"
          },
          "enabled": {
            "description": "The AI agent answers in the inboxes it is listed in (AI must be on with a key)",
            "type": "boolean"
          },
          "greeting": {
            "description": "Sent when the agent takes a conversation that has no question yet",
            "maxLength": 500,
            "type": "string"
          },
          "handoff": {
            "$ref": "#/components/schemas/AgentHandoff"
          },
          "handoff_on_upset": {
            "description": "Hand off when the customer seems upset",
            "type": "boolean"
          },
          "handoff_topics": {
            "description": "Words or phrases that always go to a person (refund, cancel my account, ...)",
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "hours": {
            "enum": [
              "always",
              "outside_hours",
              "inside_hours"
            ],
            "type": "string"
          },
          "inbox_ids": {
            "description": "List the agent in exactly these inboxes (added after their current bots and flows)",
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "maxItems": 200,
            "type": [
              "array",
              "null"
            ]
          },
          "include_attachments": {
            "description": "Read customers' images and PDFs (only when Settings → AI allows attachments)",
            "type": "boolean"
          },
          "languages": {
            "description": "Languages it answers in; empty answers in the customer's language",
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "max_turns": {
            "description": "Replies before a conversation that is not resolved goes to a person",
            "format": "int64",
            "maximum": 20,
            "minimum": 1,
            "type": "integer"
          },
          "name": {
            "description": "Shown to customers next to its replies",
            "maxLength": 60,
            "type": "string"
          },
          "persona": {
            "description": "Tone and persona instructions (they never override the grounding and safety rules)",
            "maxLength": 1000,
            "type": "string"
          },
          "use_connectors": {
            "description": "Use data connectors marked \"Offer to the AI agent\" to look up this customer's data",
            "type": "boolean"
          },
          "use_internal": {
            "description": "Also answer from internal articles and snippets (never shown or linked to customers)",
            "type": "boolean"
          }
        },
        "required": [
          "inbox_ids"
        ],
        "type": "object"
      },
      "AiAgentTestInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/AiAgentTestInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "language": {
            "description": "The simulated customer's browser language",
            "maxLength": 10,
            "type": "string"
          },
          "messages": {
            "description": "The conversation so far, oldest first; the last customer messages are the question",
            "items": {
              "$ref": "#/components/schemas/AIAgentTestMessage"
            },
            "maxItems": 30,
            "minItems": 1,
            "type": [
              "array",
              "null"
            ]
          },
          "settings": {
            "$ref": "#/components/schemas/AgentSettings",
            "description": "Test these (unsaved) settings instead of the saved ones"
          }
        },
        "required": [
          "messages"
        ],
        "type": "object"
      },
      "AiConvInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/AiConvInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "locale": {
            "description": "The agent's app language; the fallback when the customer's is unclear, and the summary's language",
            "maxLength": 10,
            "type": "string"
          }
        },
        "type": "object"
      },
      "AiEmbeddingsInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/AiEmbeddingsInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "api_key": {
            "description": "A new key; omit to keep the stored one",
            "maxLength": 500,
            "type": "string"
          },
          "base_url": {
            "description": "openai_compatible: the API base, such as https://api.openai.com/v1",
            "type": "string"
          },
          "clear_key": {
            "description": "Remove the stored key",
            "type": "boolean"
          },
          "dimensions": {
            "description": "Ask the model for vectors of this size (models that support it); 0 keeps the model's own",
            "format": "int64",
            "maximum": 4096,
            "minimum": 0,
            "type": "integer"
          },
          "model": {
            "description": "Defaults to text-embedding-3-small (OpenAI) or voyage-3.5 (Voyage)",
            "type": "string"
          },
          "provider": {
            "enum": [
              "none",
              "openai_compatible",
              "voyage"
            ],
            "type": "string"
          }
        },
        "required": [
          "provider"
        ],
        "type": "object"
      },
      "AiEmbeddingsTestInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/AiEmbeddingsTestInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "api_key": {
            "description": "Test this key instead of the stored one",
            "maxLength": 500,
            "type": "string"
          },
          "base_url": {
            "description": "openai_compatible: the API base, such as https://api.openai.com/v1",
            "type": "string"
          },
          "dimensions": {
            "description": "Ask the model for vectors of this size (models that support it); 0 keeps the model's own",
            "format": "int64",
            "maximum": 4096,
            "minimum": 0,
            "type": "integer"
          },
          "model": {
            "description": "Defaults to text-embedding-3-small (OpenAI) or voyage-3.5 (Voyage)",
            "type": "string"
          },
          "provider": {
            "enum": [
              "none",
              "openai_compatible",
              "voyage"
            ],
            "type": "string"
          }
        },
        "required": [
          "provider"
        ],
        "type": "object"
      },
      "AiRewriteInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/AiRewriteInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "draft": {
            "maxLength": 20000,
            "minLength": 1,
            "type": "string"
          },
          "language": {
            "description": "translate: a language code, or customer (the default) for the customer's language",
            "maxLength": 10,
            "type": "string"
          },
          "locale": {
            "maxLength": 10,
            "type": "string"
          },
          "op": {
            "enum": [
              "friendlier",
              "formal",
              "shorter",
              "grammar",
              "translate"
            ],
            "type": "string"
          }
        },
        "required": [
          "op",
          "draft"
        ],
        "type": "object"
      },
      "AiRewriteOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/AiRewriteOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "usage": {
            "$ref": "#/components/schemas/Usage"
          }
        },
        "required": [
          "text",
          "model",
          "usage"
        ],
        "type": "object"
      },
      "AiSettingsInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/AiSettingsInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "api_key": {
            "description": "A new key; omit to keep the stored one",
            "maxLength": 500,
            "type": "string"
          },
          "auto_summarize": {
            "type": "boolean"
          },
          "base_url": {
            "type": "string"
          },
          "budget": {
            "$ref": "#/components/schemas/Budget"
          },
          "clear_key": {
            "description": "Remove the stored key",
            "type": "boolean"
          },
          "enabled": {
            "type": "boolean"
          },
          "include_attachments": {
            "type": "boolean"
          },
          "models": {
            "$ref": "#/components/schemas/Models"
          },
          "prices": {
            "additionalProperties": {
              "$ref": "#/components/schemas/Price"
            },
            "type": "object"
          },
          "provider": {
            "type": "string"
          }
        },
        "required": [
          "enabled",
          "provider",
          "base_url",
          "models",
          "include_attachments",
          "auto_summarize",
          "budget"
        ],
        "type": "object"
      },
      "AiStatusOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/AiStatusOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "auto_summarize": {
            "type": "boolean"
          },
          "budget": {
            "$ref": "#/components/schemas/Budget"
          },
          "budget_reached": {
            "type": "boolean"
          },
          "can_manage": {
            "description": "The caller holds ai:manage",
            "type": "boolean"
          },
          "can_use": {
            "description": "The caller holds ai:use",
            "type": "boolean"
          },
          "configured": {
            "type": "boolean"
          },
          "enabled": {
            "type": "boolean"
          },
          "include_attachments": {
            "type": "boolean"
          },
          "provider": {
            "type": "string"
          },
          "spend": {
            "$ref": "#/components/schemas/Spend"
          }
        },
        "required": [
          "can_use",
          "can_manage",
          "enabled",
          "configured",
          "provider",
          "include_attachments",
          "auto_summarize",
          "budget_reached",
          "budget",
          "spend"
        ],
        "type": "object"
      },
      "AiSuggestInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/AiSuggestInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "draft": {
            "maxLength": 20000,
            "type": "string"
          },
          "locale": {
            "maxLength": 10,
            "type": "string"
          },
          "mode": {
            "description": "suggest drafts the next reply; improve rewrites the draft",
            "enum": [
              "suggest",
              "improve",
              ""
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "AiTestInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/AiTestInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "api_key": {
            "description": "Test this key instead of the stored one",
            "maxLength": 500,
            "type": "string"
          },
          "base_url": {
            "maxLength": 500,
            "type": "string"
          },
          "model": {
            "description": "Defaults to the cheapest configured model (the summary model)",
            "maxLength": 128,
            "type": "string"
          },
          "provider": {
            "description": "Test these values instead of the saved ones",
            "enum": [
              "anthropic",
              "openai_compatible",
              ""
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "AiUsageOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/AiUsageOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "budget": {
            "$ref": "#/components/schemas/Budget"
          },
          "budget_reached": {
            "type": "boolean"
          },
          "by_day": {
            "items": {
              "$ref": "#/components/schemas/UsageRow"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "by_feature": {
            "items": {
              "$ref": "#/components/schemas/UsageRow"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "by_model": {
            "items": {
              "$ref": "#/components/schemas/UsageRow"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "by_user": {
            "items": {
              "$ref": "#/components/schemas/UsageRow"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "from": {
            "format": "date-time",
            "type": "string"
          },
          "spend": {
            "$ref": "#/components/schemas/Spend",
            "description": "This month's standing against the budget"
          },
          "to": {
            "format": "date-time",
            "type": "string"
          },
          "total": {
            "$ref": "#/components/schemas/UsageRow"
          }
        },
        "required": [
          "budget",
          "spend",
          "budget_reached",
          "from",
          "to",
          "total",
          "by_feature",
          "by_user",
          "by_day",
          "by_model"
        ],
        "type": "object"
      },
      "ApiInboundInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ApiInboundInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "content": {
            "maxLength": 100000,
            "minLength": 1,
            "type": "string"
          },
          "from": {
            "$ref": "#/components/schemas/FromStruct"
          },
          "message_id": {
            "description": "Your id for the message; sending it again returns the stored message",
            "maxLength": 200,
            "type": "string"
          },
          "reply_to": {
            "description": "The message_id (or a provider id Kommio sent) this answers; threads into that conversation",
            "maxLength": 200,
            "type": "string"
          },
          "subject": {
            "description": "Used when a new conversation starts",
            "maxLength": 300,
            "type": "string"
          }
        },
        "required": [
          "from",
          "content"
        ],
        "type": "object"
      },
      "ApiInboundOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ApiInboundOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "conversation_id": {
            "format": "int64",
            "type": "integer"
          },
          "created": {
            "description": "false when message_id was already recorded",
            "type": "boolean"
          },
          "message": {
            "$ref": "#/components/schemas/Message"
          }
        },
        "required": [
          "message",
          "conversation_id",
          "created"
        ],
        "type": "object"
      },
      "ApiKeyCreateInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ApiKeyCreateInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "expires_at": {
            "format": "date-time",
            "type": "string"
          },
          "name": {
            "maxLength": 80,
            "minLength": 1,
            "type": "string"
          },
          "permissions": {
            "description": "Permission keys the key may use; must be ones you hold",
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "name",
          "permissions"
        ],
        "type": "object"
      },
      "ApiKeysOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ApiKeysOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "keys": {
            "items": {
              "$ref": "#/components/schemas/APIKey"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "keys"
        ],
        "type": "object"
      },
      "App": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/App.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "hooks": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "manifest": {
            "$ref": "#/components/schemas/Manifest"
          },
          "manifest_url": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "panels": {
            "items": {
              "$ref": "#/components/schemas/Panel"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "requested_scopes": {
            "description": "What the manifest asks for",
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "scopes": {
            "description": "Approved permission keys the token carries",
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "secret": {
            "description": "Signing secret, shown once on install",
            "type": "string"
          },
          "status": {
            "enum": [
              "active",
              "paused"
            ],
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "token": {
            "description": "Shown once, on install and rotate",
            "type": "string"
          },
          "token_prefix": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "version": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "title",
          "version",
          "scopes",
          "requested_scopes",
          "hooks",
          "panels",
          "status",
          "token_prefix",
          "created_at",
          "updated_at",
          "manifest"
        ],
        "type": "object"
      },
      "AppHookEntry": {
        "additionalProperties": false,
        "properties": {
          "conversation_id": {
            "format": "int64",
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "detail": {
            "type": "string"
          },
          "hook": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "latency_ms": {
            "format": "int32",
            "type": "integer"
          },
          "outcome": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "hook",
          "outcome",
          "latency_ms",
          "created_at"
        ],
        "type": "object"
      },
      "AppInstallInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/AppInstallInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "manifest": {
            "description": "Pasted manifest, for apps on private networks"
          },
          "manifest_url": {
            "description": "Hosted manifest to fetch (preferred)",
            "maxLength": 2000,
            "type": "string"
          },
          "scopes": {
            "description": "Subset of the requested scopes to approve; default all",
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "type": "object"
      },
      "AppLogOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/AppLogOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "entries": {
            "items": {
              "$ref": "#/components/schemas/AppHookEntry"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "entries"
        ],
        "type": "object"
      },
      "AppPanel": {
        "additionalProperties": false,
        "properties": {
          "app": {
            "type": "string"
          },
          "app_id": {
            "format": "int64",
            "type": "integer"
          },
          "app_title": {
            "type": "string"
          },
          "key": {
            "type": "string"
          },
          "location": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "app_id",
          "app",
          "app_title",
          "key",
          "title",
          "url",
          "location"
        ],
        "type": "object"
      },
      "AppPanelContextInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/AppPanelContextInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "contact_id": {
            "format": "int64",
            "type": "integer"
          },
          "conversation_id": {
            "format": "int64",
            "type": "integer"
          },
          "inbox_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "AppPanelContextOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/AppPanelContextOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "context": {
            "description": "Signed context, also sent over postMessage",
            "type": "string"
          },
          "expires_at": {
            "format": "date-time",
            "type": "string"
          },
          "url": {
            "description": "Panel URL with the signed context appended as ?kommio_context=",
            "type": "string"
          }
        },
        "required": [
          "url",
          "context",
          "expires_at"
        ],
        "type": "object"
      },
      "AppPanelsOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/AppPanelsOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "panels": {
            "items": {
              "$ref": "#/components/schemas/AppPanel"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "panels"
        ],
        "type": "object"
      },
      "AppUpdateInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/AppUpdateInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "scopes": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "status": {
            "enum": [
              "active",
              "paused",
              ""
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "ApproveInput": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ApproveInput.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "answer": {
            "description": "Edited answer; the suggestion's by default",
            "maxLength": 5000,
            "type": "string"
          },
          "as": {
            "description": "A snippet (used at once by agents and the AI) or a draft article (used once an editor publishes it)",
            "enum": [
              "snippet",
              "article"
            ],
            "type": "string"
          },
          "help_center_id": {
            "format": "int64",
            "type": "integer"
          },
          "question": {
            "description": "Edited question; the suggestion's by default",
            "maxLength": 300,
            "type": "string"
          },
          "visibility": {
            "description": "Snippet: internal (default) or ai_only; article: public, internal (default) or ai_only",
            "enum": [
              "public",
              "internal",
              "ai_only"
            ],
            "type": "string"
          }
        },
        "required": [
          "as"
        ],
        "type": "object"
      },
      "AppsOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/AppsOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "apps": {
            "items": {
              "$ref": "#/components/schemas/App"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "apps"
        ],
        "type": "object"
      },
      "Article": {
        "additionalProperties": false,
        "properties": {
          "author_id": {
            "format": "int64",
            "type": "integer"
          },
          "author_name": {
            "type": "string"
          },
          "collection_id": {
            "format": "int64",
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "draft_changes": {
            "type": "boolean"
          },
          "help_center_id": {
            "format": "int64",
            "type": "integer"
          },
          "helpful": {
            "format": "int64",
            "type": "integer"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "locales": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "not_helpful": {
            "format": "int64",
            "type": "integer"
          },
          "position": {
            "format": "int64",
            "type": "integer"
          },
          "published_at": {
            "format": "date-time",
            "type": "string"
          },
          "published_locales": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "published_version": {
            "description": "The live snapshot",
            "format": "int64",
            "type": "integer"
          },
          "source_kind": {
            "description": "manual, or conversation for a draft made from a conversation",
            "type": "string"
          },
          "source_ref": {},
          "status": {
            "enum": [
              "draft",
              "published",
              "archived"
            ],
            "type": "string"
          },
          "translations": {
            "items": {
              "$ref": "#/components/schemas/ArticleTranslation"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "updated_by": {
            "format": "int64",
            "type": "integer"
          },
          "updated_by_name": {
            "type": "string"
          },
          "views_30d": {
            "format": "int64",
            "type": "integer"
          },
          "visibility": {
            "enum": [
              "public",
              "internal",
              "ai_only"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "help_center_id",
          "status",
          "visibility",
          "position",
          "source_kind",
          "created_at",
          "updated_at",
          "locales",
          "published_locales",
          "draft_changes",
          "views_30d",
          "helpful",
          "not_helpful"
        ],
        "type": "object"
      },
      "ArticleCollection": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ArticleCollection.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "article_count": {
            "description": "Articles in the collection (any status)",
            "format": "int64",
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "help_center_id": {
            "format": "int64",
            "type": "integer"
          },
          "icon": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "is_faq": {
            "description": "The public page carries FAQPage structured data",
            "type": "boolean"
          },
          "parent_id": {
            "format": "int64",
            "type": "integer"
          },
          "position": {
            "format": "int64",
            "type": "integer"
          },
          "slug": {
            "type": "string"
          },
          "texts": {
            "additionalProperties": {
              "$ref": "#/components/schemas/ArticleCollectionText"
            },
            "description": "Name and description per locale",
            "type": "object"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "help_center_id",
          "slug",
          "position",
          "is_faq",
          "texts",
          "article_count",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "ArticleCollectionInput": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ArticleCollectionInput.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "icon": {
            "maxLength": 40,
            "type": "string"
          },
          "is_faq": {
            "type": "boolean"
          },
          "parent_id": {
            "format": "int64",
            "type": "integer"
          },
          "slug": {
            "description": "Derived from the default locale's name when empty",
            "maxLength": 80,
            "type": "string"
          },
          "texts": {
            "additionalProperties": {
              "$ref": "#/components/schemas/ArticleCollectionText"
            },
            "minProperties": 1,
            "type": "object"
          }
        },
        "required": [
          "texts"
        ],
        "type": "object"
      },
      "ArticleCollectionText": {
        "additionalProperties": false,
        "properties": {
          "description": {
            "maxLength": 500,
            "type": "string"
          },
          "name": {
            "maxLength": 120,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "ArticleImage": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ArticleImage.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "content_type": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "file_name": {
            "type": "string"
          },
          "height": {
            "format": "int32",
            "type": "integer"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "size": {
            "format": "int64",
            "type": "integer"
          },
          "url": {
            "description": "The path to use as the image source in an article body",
            "type": "string"
          },
          "width": {
            "format": "int32",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "file_name",
          "content_type",
          "size",
          "url",
          "created_at"
        ],
        "type": "object"
      },
      "ArticleInput": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ArticleInput.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "collection_id": {
            "format": "int64",
            "type": "integer"
          },
          "help_center_id": {
            "format": "int64",
            "minimum": 1,
            "type": "integer"
          },
          "locale": {
            "description": "Defaults to the help center's default locale",
            "type": "string"
          },
          "translation": {
            "$ref": "#/components/schemas/TranslationInput"
          },
          "visibility": {
            "enum": [
              "public",
              "internal",
              "ai_only"
            ],
            "type": "string"
          }
        },
        "required": [
          "help_center_id",
          "translation"
        ],
        "type": "object"
      },
      "ArticlePatch": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ArticlePatch.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "collection_id": {
            "description": "0 removes the article from its collection",
            "format": "int64",
            "type": "integer"
          },
          "position": {
            "format": "int64",
            "type": "integer"
          },
          "status": {
            "description": "Archive or return to draft; publishing is its own call",
            "enum": [
              "draft",
              "archived"
            ],
            "type": "string"
          },
          "visibility": {
            "enum": [
              "public",
              "internal",
              "ai_only"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "ArticleStat": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "title": {
            "type": "string"
          },
          "views": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "title",
          "views"
        ],
        "type": "object"
      },
      "ArticleTranslation": {
        "additionalProperties": false,
        "properties": {
          "body_html": {
            "type": "string"
          },
          "body_text": {
            "type": "string"
          },
          "excerpt": {
            "type": "string"
          },
          "locale": {
            "type": "string"
          },
          "seo_description": {
            "type": "string"
          },
          "seo_title": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "locale",
          "slug",
          "title",
          "body_html",
          "excerpt",
          "seo_title",
          "seo_description",
          "updated_at"
        ],
        "type": "object"
      },
      "ArticleVersion": {
        "additionalProperties": false,
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "created_by": {
            "format": "int64",
            "type": "integer"
          },
          "created_by_name": {
            "type": "string"
          },
          "live": {
            "type": "boolean"
          },
          "locales": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "title": {
            "description": "In the help center's default locale, else the first",
            "type": "string"
          },
          "version": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "version",
          "locales",
          "title",
          "created_at",
          "live"
        ],
        "type": "object"
      },
      "AssignmentPoint": {
        "additionalProperties": false,
        "properties": {
          "assigned": {
            "format": "int64",
            "type": "integer"
          },
          "avg_load": {
            "description": "Open conversations held, averaged over the day's sampled hours; 0 without samples",
            "format": "double",
            "type": "number"
          },
          "day": {
            "type": "string"
          },
          "first_assignment_median_ms": {
            "format": "int64",
            "type": "integer"
          },
          "reassigned": {
            "format": "int64",
            "type": "integer"
          },
          "sampled_hours": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "day",
          "assigned",
          "reassigned",
          "first_assignment_median_ms",
          "avg_load",
          "sampled_hours"
        ],
        "type": "object"
      },
      "AssignmentReportOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/AssignmentReportOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "from": {
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "rows": {
            "description": "One per agent with an assignment, a reassignment, a first assignment or load in the window",
            "items": {
              "$ref": "#/components/schemas/AssignmentRow"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "scoped": {
            "description": "The numbers are limited to what the caller's role sees",
            "type": "boolean"
          },
          "series": {
            "items": {
              "$ref": "#/components/schemas/AssignmentPoint"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "to": {
            "type": "string"
          },
          "totals": {
            "$ref": "#/components/schemas/AssignmentTotals"
          },
          "tz": {
            "type": "string"
          }
        },
        "required": [
          "from",
          "to",
          "tz",
          "totals",
          "series",
          "rows",
          "note",
          "scoped"
        ],
        "type": "object"
      },
      "AssignmentRow": {
        "additionalProperties": false,
        "properties": {
          "agent_id": {
            "format": "int64",
            "type": "integer"
          },
          "assigned": {
            "format": "int64",
            "type": "integer"
          },
          "avg_load": {
            "format": "double",
            "type": "number"
          },
          "first_assignment_count": {
            "format": "int64",
            "type": "integer"
          },
          "first_assignment_median_ms": {
            "format": "int64",
            "type": "integer"
          },
          "label": {
            "type": "string"
          },
          "reassigned": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "agent_id",
          "label",
          "assigned",
          "reassigned",
          "first_assignment_count",
          "first_assignment_median_ms",
          "avg_load"
        ],
        "type": "object"
      },
      "AssignmentTotals": {
        "additionalProperties": false,
        "properties": {
          "assigned": {
            "format": "int64",
            "type": "integer"
          },
          "avg_load": {
            "description": "Open and pending conversations held by agents, averaged over the sampled hours",
            "format": "double",
            "type": "number"
          },
          "first_assignment_count": {
            "format": "int64",
            "type": "integer"
          },
          "first_assignment_median_ms": {
            "description": "Creation to the first assignee",
            "format": "int64",
            "type": "integer"
          },
          "first_assignment_p90_ms": {
            "format": "int64",
            "type": "integer"
          },
          "reassigned": {
            "description": "Open conversations taken from an agent (to another agent or back to the queue), once per conversation and agent",
            "format": "int64",
            "type": "integer"
          },
          "sampled_hours": {
            "description": "Hours with a load sample in the window (one an hour while the workspace's agents use the app)",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "assigned",
          "reassigned",
          "first_assignment_count",
          "first_assignment_median_ms",
          "first_assignment_p90_ms",
          "avg_load",
          "sampled_hours"
        ],
        "type": "object"
      },
      "Attachment": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/Attachment.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "content_type": {
            "type": "string"
          },
          "file_name": {
            "type": "string"
          },
          "height": {
            "format": "int32",
            "type": "integer"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "preview_url": {
            "description": "A preview 1024 pixels on the long edge, once made; absent when the image is not larger than that",
            "type": "string"
          },
          "redaction": {
            "description": "Set when the reader's grant for the file's kind is not visible: masked (kind and size, no name or link; sensitive:reveal may reveal it) or hidden (only that a file is there)",
            "enum": [
              "masked",
              "hidden"
            ],
            "type": "string"
          },
          "scan_signature": {
            "description": "What the scanner found, for an infected file",
            "type": "string"
          },
          "scan_state": {
            "description": "The virus scanner's verdict (absent for files stored before scanning existed): infected means the file was removed, there is no url and downloads answer 410; pending and error files are served as they are",
            "enum": [
              "pending",
              "clean",
              "infected",
              "skipped",
              "error"
            ],
            "type": "string"
          },
          "sensitivity": {
            "description": "The kind of personal data the file holds (pii.identity_doc, payment, ...), set by an agent or a rule; the reader's field grant for it decides how the file arrives",
            "type": "string"
          },
          "size": {
            "format": "int64",
            "type": "integer"
          },
          "thumb_url": {
            "description": "A preview 320 pixels on the long edge (JPEG, or PNG with transparency), once made; absent for small images and other files",
            "type": "string"
          },
          "url": {
            "description": "Download through the API; visibility is checked on every request",
            "type": "string"
          },
          "width": {
            "format": "int32",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "file_name",
          "content_type",
          "size",
          "url"
        ],
        "type": "object"
      },
      "AttachmentFlagInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/AttachmentFlagInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "sensitivity": {
            "description": "pii.identity_doc, payment, pii.email, pii.phone or pii.address; empty removes the flag",
            "maxLength": 40,
            "type": "string"
          }
        },
        "required": [
          "sensitivity"
        ],
        "type": "object"
      },
      "AttrCreateInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/AttrCreateInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "agents_may_edit": {
            "description": "Defaults to true for manual and flow_or_rule, false otherwise",
            "type": "boolean"
          },
          "description": {
            "maxLength": 500,
            "type": "string"
          },
          "key": {
            "description": "snake_case identifier used in custom_attributes",
            "maxLength": 60,
            "minLength": 1,
            "type": "string"
          },
          "model": {
            "enum": [
              "contact",
              "conversation"
            ],
            "type": "string"
          },
          "name": {
            "maxLength": 120,
            "minLength": 1,
            "type": "string"
          },
          "options": {
            "items": {
              "type": "string"
            },
            "maxItems": 100,
            "type": [
              "array",
              "null"
            ]
          },
          "position": {
            "format": "int32",
            "type": "integer"
          },
          "sensitivity": {
            "description": "The personal-data tag of the values (none by default)",
            "enum": [
              "",
              "pii.email",
              "pii.phone",
              "pii.address",
              "pii.identity_doc",
              "payment"
            ],
            "type": "string"
          },
          "source": {
            "description": "Defaults to manual",
            "enum": [
              "manual",
              "api",
              "website_signin",
              "app",
              "flow_or_rule",
              "connector",
              "channel"
            ],
            "type": "string"
          },
          "source_app_id": {
            "format": "int64",
            "type": "integer"
          },
          "type": {
            "enum": [
              "text",
              "number",
              "bool",
              "date",
              "list",
              "link"
            ],
            "type": "string"
          }
        },
        "required": [
          "model",
          "key",
          "name",
          "type"
        ],
        "type": "object"
      },
      "AttrListOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/AttrListOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "definitions": {
            "items": {
              "$ref": "#/components/schemas/AttributeDefinition"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "definitions"
        ],
        "type": "object"
      },
      "AttrPatchInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/AttrPatchInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "attributes": {
            "description": "Keys to set; a key set to null is removed. Other stored keys are kept (JSON merge patch)."
          }
        },
        "required": [
          "attributes"
        ],
        "type": "object"
      },
      "AttrUpdateInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/AttrUpdateInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "agents_may_edit": {
            "description": "Omitted keeps the setting",
            "type": "boolean"
          },
          "confirm_option_removal": {
            "description": "Required to remove list options that records hold; their values are cleared",
            "type": "boolean"
          },
          "description": {
            "description": "Omitted keeps the description",
            "maxLength": 500,
            "type": "string"
          },
          "key": {
            "description": "A new key; refused once any record holds a value or anything references the key",
            "maxLength": 60,
            "type": "string"
          },
          "name": {
            "maxLength": 120,
            "minLength": 1,
            "type": "string"
          },
          "options": {
            "items": {
              "type": "string"
            },
            "maxItems": 100,
            "type": [
              "array",
              "null"
            ]
          },
          "position": {
            "format": "int32",
            "type": "integer"
          },
          "sensitivity": {
            "description": "Omitted keeps the tag; empty removes it. A change is audited (custom_attribute.sensitivity_changed)",
            "enum": [
              "",
              "pii.email",
              "pii.phone",
              "pii.address",
              "pii.identity_doc",
              "payment"
            ],
            "type": "string"
          },
          "source": {
            "description": "Omitted keeps the source",
            "enum": [
              "manual",
              "api",
              "website_signin",
              "app",
              "flow_or_rule",
              "connector",
              "channel"
            ],
            "type": "string"
          },
          "source_app_id": {
            "format": "int64",
            "type": "integer"
          },
          "type": {
            "description": "A new type; refused once any record holds a value or a condition reads it",
            "enum": [
              "text",
              "number",
              "bool",
              "date",
              "list",
              "link"
            ],
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "AttrUsageListOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/AttrUsageListOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "usage": {
            "items": {
              "$ref": "#/components/schemas/AttributeUsage"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "usage"
        ],
        "type": "object"
      },
      "AttributeDefinition": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/AttributeDefinition.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "agents_may_edit": {
            "description": "Whether people may change values; off by default for api, website_signin and app",
            "type": "boolean"
          },
          "description": {
            "description": "Shown to agents beside the field",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "key": {
            "type": "string"
          },
          "model": {
            "enum": [
              "contact",
              "conversation"
            ],
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "options": {
            "description": "List options for type list"
          },
          "position": {
            "format": "int32",
            "type": "integer"
          },
          "sensitivity": {
            "description": "The personal-data tag of the values: each role then sees them visible, masked or hidden by its field grant for that tag, like the built-in fields. Empty: every reader of the record sees them",
            "enum": [
              "",
              "pii.email",
              "pii.phone",
              "pii.address",
              "pii.identity_doc",
              "payment"
            ],
            "type": "string"
          },
          "source": {
            "description": "Where values come from: agents, your systems through the API, the website sign-in (signed identity attributes), an installed app, a chatbot flow or automation, a data connector, or a messaging channel (Telegram)",
            "enum": [
              "manual",
              "api",
              "website_signin",
              "app",
              "flow_or_rule",
              "connector",
              "channel"
            ],
            "type": "string"
          },
          "source_app_id": {
            "description": "For source app: the app that writes it, when known",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "type": {
            "enum": [
              "text",
              "number",
              "bool",
              "date",
              "list",
              "link"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "model",
          "key",
          "name",
          "description",
          "type",
          "options",
          "position",
          "source",
          "source_app_id",
          "agents_may_edit",
          "sensitivity"
        ],
        "type": "object"
      },
      "AttributeRef": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "via": {
            "items": {
              "enum": [
                "condition",
                "placeholder",
                "action"
              ],
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "name",
          "via"
        ],
        "type": "object"
      },
      "AttributeUsage": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/AttributeUsage.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "canned": {
            "items": {
              "$ref": "#/components/schemas/AttributeRef"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "in_use": {
            "description": "Any value or reference exists: deleting needs the key typed as confirmation",
            "type": "boolean"
          },
          "key": {
            "type": "string"
          },
          "macros": {
            "items": {
              "$ref": "#/components/schemas/AttributeRef"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "macros_hidden": {
            "format": "int64",
            "type": "integer"
          },
          "model": {
            "enum": [
              "contact",
              "conversation"
            ],
            "type": "string"
          },
          "option_counts": {
            "additionalProperties": {
              "format": "int64",
              "type": "integer"
            },
            "description": "For list attributes: records holding each option",
            "type": "object"
          },
          "rules": {
            "items": {
              "$ref": "#/components/schemas/AttributeRef"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "rules_hidden": {
            "format": "int64",
            "type": "integer"
          },
          "values": {
            "description": "Contacts or conversations (per model) holding a value",
            "format": "int64",
            "type": "integer"
          },
          "views": {
            "items": {
              "$ref": "#/components/schemas/AttributeRef"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "views_hidden": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "model",
          "key",
          "values",
          "option_counts",
          "rules",
          "rules_hidden",
          "views",
          "views_hidden",
          "macros",
          "macros_hidden",
          "canned",
          "in_use"
        ],
        "type": "object"
      },
      "AuditItem": {
        "additionalProperties": false,
        "properties": {
          "action": {
            "type": "string"
          },
          "actor_id": {
            "format": "int64",
            "type": "integer"
          },
          "actor_type": {
            "type": "string"
          },
          "after": {},
          "before": {},
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "ip": {
            "type": "string"
          },
          "object_id": {
            "format": "int64",
            "type": "integer"
          },
          "object_type": {
            "type": "string"
          },
          "occurred_at": {
            "format": "date-time",
            "type": "string"
          },
          "request_id": {
            "type": "string"
          },
          "user_agent": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "actor_type",
          "action",
          "occurred_at"
        ],
        "type": "object"
      },
      "AuditListOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/AuditListOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "_redacted": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/AuditItem"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "next_cursor": {
            "description": "Pass as ?cursor= to fetch the next page; absent on the last page",
            "type": "string"
          }
        },
        "required": [
          "items"
        ],
        "type": "object"
      },
      "AvailabilityInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/AvailabilityInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "auto": {
            "description": "Set by the app's inactivity timer: away applies only over online, and online only over an automatic away; a status the person chose is never changed",
            "type": "boolean"
          },
          "availability": {
            "enum": [
              "online",
              "busy",
              "away",
              "offline"
            ],
            "type": "string"
          }
        },
        "required": [
          "availability"
        ],
        "type": "object"
      },
      "AvailabilityOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/AvailabilityOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "availability": {
            "enum": [
              "online",
              "busy",
              "away",
              "offline"
            ],
            "type": "string"
          },
          "availability_auto": {
            "description": "The current away was set by the inactivity timer",
            "type": "boolean"
          },
          "changed": {
            "type": "boolean"
          }
        },
        "required": [
          "availability",
          "availability_auto",
          "changed"
        ],
        "type": "object"
      },
      "BacklogBucket": {
        "additionalProperties": false,
        "properties": {
          "count": {
            "format": "int64",
            "type": "integer"
          },
          "key": {
            "description": "Time since creation: under 1 hour, 1-4 hours, 4-24 hours, 1-3 days, 3-7 days, over 7 days",
            "enum": [
              "lt1h",
              "1to4h",
              "4to24h",
              "1to3d",
              "3to7d",
              "gt7d"
            ],
            "type": "string"
          },
          "waiting_on_us": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "key",
          "count",
          "waiting_on_us"
        ],
        "type": "object"
      },
      "BacklogOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/BacklogOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "buckets": {
            "items": {
              "$ref": "#/components/schemas/BacklogBucket"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "oldest_waiting": {
            "$ref": "#/components/schemas/OldestWaiting"
          },
          "open": {
            "description": "Open and pending conversations",
            "format": "int64",
            "type": "integer"
          },
          "scoped": {
            "type": "boolean"
          },
          "waiting_on_customer": {
            "description": "Pending, or open with the team's reply last",
            "format": "int64",
            "type": "integer"
          },
          "waiting_on_us": {
            "description": "Open, and the customer wrote last",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "open",
          "waiting_on_us",
          "waiting_on_customer",
          "buckets",
          "scoped"
        ],
        "type": "object"
      },
      "Bot": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/Bot.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "allowed_actions": {
            "description": "Callback actions the bot may use: reply, handoff, update, typing, resolve, start_conversation",
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "auto_pause_after": {
            "description": "Pause the bot after this many failed deliveries in a row and notify its administrators; 0 (the default) never pauses",
            "format": "int32",
            "type": "integer"
          },
          "auto_paused_at": {
            "description": "When Kommio paused the bot on its own; cleared on resume",
            "format": "date-time",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "health": {
            "$ref": "#/components/schemas/Health",
            "description": "Derived from the bot's deliveries in the last 24 hours; Kommio pauses a bot only when auto_pause_after is set"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "inboxes": {
            "description": "Inboxes whose bots and flows list this bot, with its place in each order",
            "items": {
              "$ref": "#/components/schemas/Placement"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "outbound_url": {
            "type": "string"
          },
          "secret": {
            "description": "Signing secret for Kommio-Signature; only on create",
            "type": "string"
          },
          "status": {
            "enum": [
              "active",
              "paused"
            ],
            "type": "string"
          },
          "token": {
            "description": "Only on create and rotate",
            "type": "string"
          },
          "token_prefix": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "outbound_url",
          "status",
          "token_prefix",
          "allowed_actions",
          "health",
          "auto_pause_after",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "BotBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/BotBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "allowed_actions": {
            "description": "Omitted keeps the current list (new bots: everything except start_conversation); handoff is always kept",
            "items": {
              "type": "string"
            },
            "maxItems": 10,
            "type": [
              "array",
              "null"
            ]
          },
          "auto_pause_after": {
            "description": "0 (off) or 3 to 50 failed deliveries in a row; omitted keeps the current setting (new bots: off)",
            "format": "int32",
            "maximum": 50,
            "minimum": 0,
            "type": "integer"
          },
          "name": {
            "maxLength": 80,
            "minLength": 1,
            "type": "string"
          },
          "outbound_url": {
            "maxLength": 2000,
            "minLength": 8,
            "type": "string"
          },
          "status": {
            "enum": [
              "active",
              "paused",
              ""
            ],
            "type": "string"
          }
        },
        "required": [
          "name",
          "outbound_url"
        ],
        "type": "object"
      },
      "BotContact": {
        "additionalProperties": false,
        "properties": {
          "email": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ],
        "type": "object"
      },
      "BotConversation": {
        "additionalProperties": false,
        "properties": {
          "contact": {
            "$ref": "#/components/schemas/BotContact"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "custom_attributes": {},
          "display_id": {
            "format": "int64",
            "type": "integer"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "inbox_id": {
            "format": "int64",
            "type": "integer"
          },
          "priority": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "subject": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "display_id",
          "inbox_id",
          "status",
          "priority",
          "contact",
          "custom_attributes",
          "created_at"
        ],
        "type": "object"
      },
      "BotConversationOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/BotConversationOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "conversation": {
            "$ref": "#/components/schemas/BotConversation"
          },
          "messages": {
            "items": {
              "$ref": "#/components/schemas/BotMessage"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "conversation",
          "messages"
        ],
        "type": "object"
      },
      "BotHandoffInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/BotHandoffInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "reason": {
            "maxLength": 300,
            "type": "string"
          },
          "to": {
            "description": "people (default) hands the conversation to the team; next passes it to the next bot or flow in the inbox's order whose conditions match, or to people when none does",
            "enum": [
              "people",
              "next",
              ""
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "BotMessage": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/BotMessage.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "content_type": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "direction": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "type": "string"
          },
          "sender_type": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "direction",
          "kind",
          "sender_type",
          "content",
          "content_type",
          "created_at"
        ],
        "type": "object"
      },
      "BotReplyInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/BotReplyInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "content": {
            "maxLength": 20000,
            "minLength": 1,
            "type": "string"
          },
          "content_type": {
            "default": "text",
            "enum": [
              "text",
              "html",
              "markdown",
              ""
            ],
            "type": "string"
          }
        },
        "required": [
          "content"
        ],
        "type": "object"
      },
      "BotReportOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/BotReportOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "from": {
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "rows": {
            "items": {
              "$ref": "#/components/schemas/BotRow"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "scoped": {
            "description": "Bots are shown only to roles that see every conversation",
            "type": "boolean"
          },
          "to": {
            "type": "string"
          },
          "total": {
            "$ref": "#/components/schemas/BotRow"
          },
          "tz": {
            "type": "string"
          }
        },
        "required": [
          "from",
          "to",
          "tz",
          "total",
          "rows",
          "note",
          "scoped"
        ],
        "type": "object"
      },
      "BotRow": {
        "additionalProperties": false,
        "properties": {
          "bot_id": {
            "format": "int64",
            "type": "integer"
          },
          "deleted": {
            "description": "The bot no longer exists; its history still counts",
            "type": "boolean"
          },
          "handled": {
            "description": "Conversations the bot started holding",
            "format": "int64",
            "type": "integer"
          },
          "handoff_median_ms": {
            "description": "Median time from the bot taking a conversation to the hand-off",
            "format": "int64",
            "type": "integer"
          },
          "handoff_p90_ms": {
            "format": "int64",
            "type": "integer"
          },
          "handoff_rate": {
            "description": "Hand-offs per handled conversation",
            "format": "double",
            "type": "number"
          },
          "handoff_time_count": {
            "format": "int64",
            "type": "integer"
          },
          "handoffs": {
            "format": "int64",
            "type": "integer"
          },
          "handoffs_explicit": {
            "description": "The bot asked for a person",
            "format": "int64",
            "type": "integer"
          },
          "handoffs_implicit": {
            "description": "A person replied while the bot held it",
            "format": "int64",
            "type": "integer"
          },
          "handoffs_takeover": {
            "description": "An agent pressed Take over",
            "format": "int64",
            "type": "integer"
          },
          "label": {
            "type": "string"
          },
          "resolution_rate": {
            "description": "Bot resolutions per handled conversation",
            "format": "double",
            "type": "number"
          },
          "resolved": {
            "description": "Resolved while the bot held them, with no person replying",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "bot_id",
          "label",
          "handled",
          "resolved",
          "handoffs",
          "handoffs_explicit",
          "handoffs_implicit",
          "handoffs_takeover",
          "handoff_rate",
          "resolution_rate",
          "handoff_median_ms",
          "handoff_p90_ms",
          "handoff_time_count"
        ],
        "type": "object"
      },
      "BotStartInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/BotStartInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "contact_id": {
            "format": "int64",
            "minimum": 1,
            "type": "integer"
          },
          "content": {
            "description": "The bot's first message",
            "maxLength": 20000,
            "minLength": 1,
            "type": "string"
          },
          "content_type": {
            "default": "text",
            "enum": [
              "text",
              "html",
              "markdown",
              ""
            ],
            "type": "string"
          },
          "inbox_id": {
            "description": "An inbox this bot is attached to",
            "format": "int64",
            "minimum": 1,
            "type": "integer"
          },
          "subject": {
            "maxLength": 300,
            "type": "string"
          }
        },
        "required": [
          "inbox_id",
          "contact_id",
          "content"
        ],
        "type": "object"
      },
      "BotUpdateConvInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/BotUpdateConvInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "custom_attributes": {
            "description": "Merged into the conversation's attributes"
          },
          "priority": {
            "enum": [
              "none",
              "low",
              "medium",
              "high",
              "urgent",
              ""
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "BotsOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/BotsOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "actions": {
            "description": "Every callback action a bot can be allowed",
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "bots": {
            "items": {
              "$ref": "#/components/schemas/Bot"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "bots",
          "actions"
        ],
        "type": "object"
      },
      "BrandConversation": {
        "additionalProperties": false,
        "properties": {
          "account_id": {
            "format": "int64",
            "type": "integer"
          },
          "account_name": {
            "type": "string"
          },
          "account_slug": {
            "type": "string"
          },
          "assignee_id": {
            "format": "int64",
            "type": "integer"
          },
          "assignee_name": {
            "type": "string"
          },
          "brand_color": {
            "description": "The workspace's published brand.primary token, when it has one",
            "type": "string"
          },
          "contact_id": {
            "format": "int64",
            "type": "integer"
          },
          "contact_name": {
            "description": "As the reader may see it in that workspace (masked or empty by their role there)",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "csat_rating": {
            "format": "int32",
            "maximum": 5,
            "minimum": 1,
            "type": "integer"
          },
          "display_id": {
            "format": "int64",
            "type": "integer"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "inbox_channel_kind": {
            "type": "string"
          },
          "inbox_id": {
            "format": "int64",
            "type": "integer"
          },
          "inbox_name": {
            "type": "string"
          },
          "last_activity_at": {
            "format": "date-time",
            "type": "string"
          },
          "last_inbound_at": {
            "format": "date-time",
            "type": "string"
          },
          "last_message_at": {
            "format": "date-time",
            "type": "string"
          },
          "last_message_preview": {
            "type": "string"
          },
          "priority": {
            "enum": [
              "none",
              "low",
              "medium",
              "high",
              "urgent"
            ],
            "type": "string"
          },
          "role_name": {
            "description": "The person's role in this workspace",
            "type": "string"
          },
          "snoozed_until": {
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "status_category": {
            "enum": [
              "open",
              "pending",
              "snoozed",
              "resolved",
              "closed"
            ],
            "type": "string"
          },
          "subject": {
            "type": "string"
          },
          "tags": {
            "items": {
              "$ref": "#/components/schemas/Tag"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "team_id": {
            "format": "int64",
            "type": "integer"
          },
          "unread_count": {
            "format": "int32",
            "type": "integer"
          }
        },
        "required": [
          "inbox_name",
          "inbox_channel_kind",
          "id",
          "display_id",
          "inbox_id",
          "contact_id",
          "contact_name",
          "status",
          "status_category",
          "priority",
          "last_activity_at",
          "unread_count",
          "tags",
          "created_at",
          "account_id",
          "account_slug",
          "account_name",
          "role_name"
        ],
        "type": "object"
      },
      "BrandConversationsPage": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/BrandConversationsPage.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/BrandConversation"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "next_cursor": {
            "description": "Pass as ?cursor= to fetch the next page; absent on the last page",
            "type": "string"
          },
          "skipped": {
            "description": "Workspaces this page could not read; their conversations are not in items",
            "items": {
              "$ref": "#/components/schemas/SkippedWorkspace"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "items",
          "skipped"
        ],
        "type": "object"
      },
      "BrandCounts": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/BrandCounts.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "mine": {
            "description": "Open and assigned to the caller",
            "format": "int64",
            "type": "integer"
          },
          "open": {
            "format": "int64",
            "type": "integer"
          },
          "pending": {
            "format": "int64",
            "type": "integer"
          },
          "skipped": {
            "items": {
              "$ref": "#/components/schemas/SkippedWorkspace"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "unassigned": {
            "description": "Open and unassigned",
            "format": "int64",
            "type": "integer"
          },
          "workspaces": {
            "description": "Every workspace that was counted, by name",
            "items": {
              "$ref": "#/components/schemas/BrandWorkspaceCounts"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "open",
          "pending",
          "unassigned",
          "mine",
          "workspaces",
          "skipped"
        ],
        "type": "object"
      },
      "BrandFile": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/BrandFile.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "content_type": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "file_name": {
            "type": "string"
          },
          "height": {
            "format": "int32",
            "type": "integer"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "size": {
            "format": "int64",
            "type": "integer"
          },
          "url": {
            "description": "The public path to put in a logo slot (served without a session, for the widget and the help center)",
            "type": "string"
          },
          "width": {
            "format": "int32",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "url",
          "file_name",
          "content_type",
          "size",
          "created_at"
        ],
        "type": "object"
      },
      "BrandTheme": {
        "additionalProperties": false,
        "properties": {
          "logo_dark_url": {
            "description": "Wordmark for dark surfaces (branding.logo_dark_url)",
            "maxLength": 2000,
            "type": "string"
          },
          "logo_url": {
            "description": "Wordmark (branding.logo_url)",
            "maxLength": 2000,
            "type": "string"
          },
          "mark_dark_url": {
            "description": "Square mark for dark surfaces (branding.mark_dark_url)",
            "maxLength": 2000,
            "type": "string"
          },
          "mark_url": {
            "description": "Square mark (branding.mark_url)",
            "maxLength": 2000,
            "type": "string"
          },
          "tokens": {
            "description": "Token overrides (the keys of branding.tokens and its dark group)"
          }
        },
        "required": [
          "tokens",
          "logo_url",
          "logo_dark_url",
          "mark_url",
          "mark_dark_url"
        ],
        "type": "object"
      },
      "BrandThemeInput": {
        "additionalProperties": false,
        "properties": {
          "logo_dark_url": {
            "maxLength": 2000,
            "type": "string"
          },
          "logo_url": {
            "maxLength": 2000,
            "type": "string"
          },
          "mark_dark_url": {
            "maxLength": 2000,
            "type": "string"
          },
          "mark_url": {
            "maxLength": 2000,
            "type": "string"
          },
          "tokens": {
            "description": "Token overrides (the keys of branding.tokens and its dark group); absent is none"
          }
        },
        "type": "object"
      },
      "BrandVersion": {
        "additionalProperties": false,
        "properties": {
          "published_at": {
            "format": "date-time",
            "type": "string"
          },
          "published_by": {
            "description": "Absent for the branding that existed before versions (migration 0094) or a deleted member",
            "format": "int64",
            "type": "integer"
          },
          "published_by_name": {
            "type": "string"
          },
          "restored_from": {
            "description": "Set when this version is a rollback: the version it copies",
            "format": "int32",
            "type": "integer"
          },
          "theme": {
            "$ref": "#/components/schemas/BrandTheme"
          },
          "version": {
            "format": "int32",
            "type": "integer"
          }
        },
        "required": [
          "version",
          "theme",
          "published_at"
        ],
        "type": "object"
      },
      "BrandWorkspaceCounts": {
        "additionalProperties": false,
        "properties": {
          "account_id": {
            "format": "int64",
            "type": "integer"
          },
          "account_name": {
            "type": "string"
          },
          "account_slug": {
            "type": "string"
          },
          "brand_color": {
            "description": "The workspace's published brand.primary token, when it has one",
            "type": "string"
          },
          "mine": {
            "description": "Open and assigned to the caller",
            "format": "int64",
            "type": "integer"
          },
          "open": {
            "format": "int64",
            "type": "integer"
          },
          "pending": {
            "format": "int64",
            "type": "integer"
          },
          "role_name": {
            "description": "The person's role in this workspace",
            "type": "string"
          },
          "unassigned": {
            "description": "Open and unassigned",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "open",
          "pending",
          "unassigned",
          "mine",
          "account_id",
          "account_slug",
          "account_name",
          "role_name"
        ],
        "type": "object"
      },
      "BrandingDraftInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/BrandingDraftInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "theme": {
            "$ref": "#/components/schemas/BrandThemeInput"
          }
        },
        "required": [
          "theme"
        ],
        "type": "object"
      },
      "BrandingState": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/BrandingState.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "draft": {
            "$ref": "#/components/schemas/BrandTheme",
            "description": "The working copy; the published theme when there is no draft"
          },
          "draft_updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "draft_updated_by": {
            "description": "Name of the member who last saved the draft",
            "type": "string"
          },
          "has_draft": {
            "description": "The draft differs from the published theme",
            "type": "boolean"
          },
          "published": {
            "$ref": "#/components/schemas/BrandTheme",
            "description": "The live theme, as the widget, the agent app, the help center and the survey page read it"
          },
          "published_version": {
            "description": "The version that is live; absent before the first publish",
            "format": "int32",
            "type": "integer"
          },
          "versions": {
            "description": "Publishes, newest first (at most 100)",
            "items": {
              "$ref": "#/components/schemas/BrandVersion"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "published",
          "draft",
          "has_draft",
          "versions"
        ],
        "type": "object"
      },
      "BrowserContext": {
        "additionalProperties": false,
        "properties": {
          "ad_platform": {
            "description": "The ad network a click id on the landing page named; the id itself is never sent",
            "enum": [
              "google_ads",
              "meta",
              "microsoft_ads",
              "tiktok",
              "linkedin"
            ],
            "type": "string"
          },
          "first_seen_at": {
            "format": "date-time",
            "type": "string"
          },
          "js_errors": {
            "description": "Recent JavaScript errors; kept only when the inbox captures them",
            "items": {
              "$ref": "#/components/schemas/JSError"
            },
            "maxItems": 5,
            "type": [
              "array",
              "null"
            ]
          },
          "landing_page": {
            "maxLength": 2000,
            "type": "string"
          },
          "languages": {
            "items": {
              "type": "string"
            },
            "maxItems": 5,
            "type": [
              "array",
              "null"
            ]
          },
          "page": {
            "$ref": "#/components/schemas/PageRef",
            "description": "The page the visitor is on now"
          },
          "page_context": {
            "additionalProperties": {},
            "description": "Flat object from window.Kommio.setContext (unverified); replaces the stored one when present",
            "type": "object"
          },
          "referrer": {
            "maxLength": 2000,
            "type": "string"
          },
          "screen": {
            "maxLength": 11,
            "pattern": "^[0-9]{1,5}x[0-9]{1,5}$",
            "type": "string"
          },
          "session_started_at": {
            "format": "date-time",
            "type": "string"
          },
          "timezone": {
            "maxLength": 64,
            "type": "string"
          },
          "trail": {
            "description": "Pages of this browsing session, oldest first",
            "items": {
              "$ref": "#/components/schemas/PageVisit"
            },
            "maxItems": 20,
            "type": [
              "array",
              "null"
            ]
          },
          "utm": {
            "$ref": "#/components/schemas/UTM"
          },
          "visit_count": {
            "format": "int64",
            "maximum": 1000000,
            "minimum": 0,
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Budget": {
        "additionalProperties": false,
        "properties": {
          "kind": {
            "type": "string"
          },
          "limit": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "kind",
          "limit"
        ],
        "type": "object"
      },
      "BusinessHours": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/BusinessHours.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "days": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "next_change": {
            "format": "date-time",
            "type": "string"
          },
          "open_now": {
            "type": "boolean"
          },
          "timezone": {
            "description": "The schedule's zone; empty is UTC",
            "type": "string"
          },
          "upcoming": {
            "items": {
              "$ref": "#/components/schemas/Day"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "weekly": {
            "additionalProperties": {
              "items": {
                "type": "string"
              },
              "type": [
                "array",
                "null"
              ]
            },
            "type": "object"
          }
        },
        "required": [
          "open_now",
          "timezone",
          "weekly",
          "days",
          "upcoming"
        ],
        "type": "object"
      },
      "CSATPoint": {
        "additionalProperties": false,
        "properties": {
          "day": {
            "type": "string"
          },
          "positive": {
            "format": "int64",
            "type": "integer"
          },
          "responses": {
            "format": "int64",
            "type": "integer"
          },
          "score": {
            "format": "double",
            "type": "number"
          }
        },
        "required": [
          "day",
          "responses",
          "positive"
        ],
        "type": "object"
      },
      "CSATResponse": {
        "additionalProperties": false,
        "properties": {
          "assignee_id": {
            "description": "The assignee when the conversation was resolved",
            "format": "int64",
            "type": "integer"
          },
          "channel": {
            "type": "string"
          },
          "comment": {
            "type": "string"
          },
          "contact_id": {
            "format": "int64",
            "type": "integer"
          },
          "conversation_display_id": {
            "format": "int64",
            "type": "integer"
          },
          "conversation_id": {
            "format": "int64",
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "inbox_id": {
            "format": "int64",
            "type": "integer"
          },
          "rating": {
            "description": "Normalised: thumbs are 1 or 5",
            "format": "int64",
            "maximum": 5,
            "minimum": 1,
            "type": "integer"
          },
          "scale": {
            "enum": [
              "faces5",
              "stars5",
              "thumbs"
            ],
            "type": "string"
          },
          "source": {
            "enum": [
              "widget",
              "link"
            ],
            "type": "string"
          },
          "team_id": {
            "format": "int64",
            "type": "integer"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "value": {
            "description": "What the customer picked on the scale",
            "type": "string"
          }
        },
        "required": [
          "id",
          "conversation_id",
          "conversation_display_id",
          "contact_id",
          "inbox_id",
          "channel",
          "rating",
          "value",
          "scale",
          "source",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "CSATRow": {
        "additionalProperties": false,
        "properties": {
          "average": {
            "description": "Mean rating from 1 to 5; absent without responses",
            "format": "double",
            "type": "number"
          },
          "dimension_id": {
            "format": "int64",
            "type": "integer"
          },
          "distribution": {
            "description": "Responses rated 1 to 5",
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "maxItems": 5,
            "minItems": 5,
            "type": [
              "array",
              "null"
            ]
          },
          "key": {
            "description": "The channel of a breakdown by channel (web_chat, email, api...)",
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "positive": {
            "description": "Responses rated 4 or 5",
            "format": "int64",
            "type": "integer"
          },
          "response_rate": {
            "description": "Responses per survey offered, in percent; absent when none was offered",
            "format": "double",
            "type": "number"
          },
          "responses": {
            "format": "int64",
            "type": "integer"
          },
          "score": {
            "description": "Percent of responses rated 4 or 5; absent without responses",
            "format": "double",
            "type": "number"
          },
          "sent": {
            "description": "Surveys offered",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "dimension_id",
          "label",
          "sent",
          "responses",
          "positive",
          "distribution"
        ],
        "type": "object"
      },
      "CSATSurveyInfo": {
        "additionalProperties": false,
        "properties": {
          "answered": {
            "type": "boolean"
          },
          "channel": {
            "type": "string"
          },
          "email_sent_at": {
            "format": "date-time",
            "type": "string"
          },
          "expires_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "offered_at": {
            "format": "date-time",
            "type": "string"
          },
          "scale": {
            "enum": [
              "faces5",
              "stars5",
              "thumbs"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "channel",
          "scale",
          "offered_at",
          "expires_at",
          "answered"
        ],
        "type": "object"
      },
      "CSATTotals": {
        "additionalProperties": false,
        "properties": {
          "average": {
            "description": "Mean rating from 1 to 5; absent without responses",
            "format": "double",
            "type": "number"
          },
          "distribution": {
            "description": "Responses rated 1 to 5",
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "maxItems": 5,
            "minItems": 5,
            "type": [
              "array",
              "null"
            ]
          },
          "positive": {
            "description": "Responses rated 4 or 5",
            "format": "int64",
            "type": "integer"
          },
          "response_rate": {
            "description": "Responses per survey offered, in percent; absent when none was offered",
            "format": "double",
            "type": "number"
          },
          "responses": {
            "format": "int64",
            "type": "integer"
          },
          "score": {
            "description": "Percent of responses rated 4 or 5; absent without responses",
            "format": "double",
            "type": "number"
          },
          "sent": {
            "description": "Surveys offered",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "sent",
          "responses",
          "positive",
          "distribution"
        ],
        "type": "object"
      },
      "CannedInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/CannedInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "content": {
            "maxLength": 20000,
            "minLength": 1,
            "type": "string"
          },
          "shortcut": {
            "maxLength": 60,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "shortcut",
          "content"
        ],
        "type": "object"
      },
      "CannedOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/CannedOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "canned_responses": {
            "items": {
              "$ref": "#/components/schemas/CannedResponse"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "canned_responses"
        ],
        "type": "object"
      },
      "CannedResponse": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/CannedResponse.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "shortcut": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "shortcut",
          "content"
        ],
        "type": "object"
      },
      "CannedUpdateInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/CannedUpdateInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "content": {
            "maxLength": 20000,
            "minLength": 1,
            "type": "string"
          },
          "shortcut": {
            "maxLength": 60,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "shortcut",
          "content"
        ],
        "type": "object"
      },
      "Capabilities": {
        "additionalProperties": false,
        "properties": {
          "attachments": {
            "type": "boolean"
          },
          "buttons": {
            "type": "boolean"
          },
          "html_content": {
            "type": "boolean"
          },
          "max_text_length": {
            "format": "int64",
            "type": "integer"
          },
          "message_tags": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "opt_out": {
            "type": "boolean"
          },
          "read_receipts": {
            "type": "boolean"
          },
          "reply_window": {
            "format": "int64",
            "type": "integer"
          },
          "subject": {
            "type": "boolean"
          },
          "templates": {
            "type": "boolean"
          },
          "text_counter": {
            "enum": [
              "sms_segments",
              ""
            ],
            "type": "string"
          },
          "threads": {
            "type": "boolean"
          },
          "typing": {
            "type": "boolean"
          }
        },
        "required": [
          "attachments",
          "typing",
          "read_receipts",
          "templates",
          "buttons",
          "threads",
          "subject",
          "html_content"
        ],
        "type": "object"
      },
      "Card": {
        "additionalProperties": false,
        "properties": {
          "choices": {
            "items": {
              "$ref": "#/components/schemas/CardChoice"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "input": {
            "enum": [
              "text",
              "email",
              "phone",
              "number",
              "date",
              ""
            ],
            "type": "string"
          },
          "kind": {
            "enum": [
              "choices",
              "input"
            ],
            "type": "string"
          },
          "placeholder": {
            "type": "string"
          }
        },
        "required": [
          "kind"
        ],
        "type": "object"
      },
      "CardChoice": {
        "additionalProperties": false,
        "properties": {
          "label": {
            "type": "string"
          }
        },
        "required": [
          "label"
        ],
        "type": "object"
      },
      "CatalogAuth": {
        "additionalProperties": false,
        "properties": {
          "method": {
            "enum": [
              "none",
              "api_key",
              "oauth2"
            ],
            "type": "string"
          },
          "provider": {
            "maxLength": 40,
            "type": "string"
          },
          "provider_scopes": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "method"
        ],
        "type": "object"
      },
      "CatalogAutomationAction": {
        "additionalProperties": false,
        "properties": {
          "key": {
            "maxLength": 60,
            "type": "string"
          },
          "params_schema": {},
          "title": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          }
        },
        "required": [
          "key",
          "title"
        ],
        "type": "object"
      },
      "CatalogConnectorSpec": {
        "additionalProperties": false,
        "properties": {
          "bind": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "header_secrets": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "recipe": {
            "$ref": "#/components/schemas/ConnectorRecipe"
          },
          "secret_setting": {
            "maxLength": 60,
            "type": "string"
          }
        },
        "required": [
          "recipe"
        ],
        "type": "object"
      },
      "CatalogDataAccess": {
        "additionalProperties": false,
        "properties": {
          "reads": {
            "items": {
              "additionalProperties": {
                "type": "string"
              },
              "type": "object"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "writes": {
            "items": {
              "additionalProperties": {
                "type": "string"
              },
              "type": "object"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "reads",
          "writes"
        ],
        "type": "object"
      },
      "CatalogDetail": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/CatalogDetail.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "allowed": {
            "type": "boolean"
          },
          "auth": {
            "$ref": "#/components/schemas/CatalogAuth"
          },
          "automation_actions": {
            "items": {
              "$ref": "#/components/schemas/CatalogAutomationAction"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "can_install": {
            "description": "The caller may install it now",
            "type": "boolean"
          },
          "can_request": {
            "description": "The caller may ask an administrator to install it",
            "type": "boolean"
          },
          "category": {
            "enum": [
              "channels",
              "commerce",
              "crm",
              "engineering",
              "team_chat",
              "ai",
              "automation",
              "analytics",
              "other"
            ],
            "type": "string"
          },
          "connector": {
            "$ref": "#/components/schemas/CatalogConnectorSpec"
          },
          "data": {
            "$ref": "#/components/schemas/CatalogDataAccess"
          },
          "description": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "docs_url": {
            "maxLength": 500,
            "type": "string"
          },
          "editions": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "featured": {
            "type": "boolean"
          },
          "hidden": {
            "type": "boolean"
          },
          "hooks": {
            "additionalProperties": {
              "$ref": "#/components/schemas/HookSpec"
            },
            "type": "object"
          },
          "icon": {
            "description": "An icon key (docs/integrations.md) or an https/data: image URL",
            "type": "string"
          },
          "install": {
            "$ref": "#/components/schemas/CatalogInstall"
          },
          "installable": {
            "type": "boolean"
          },
          "installations": {
            "items": {
              "$ref": "#/components/schemas/InstallationView"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "kind": {
            "enum": [
              "channel",
              "native",
              "connector_recipe",
              "app",
              "template",
              "plugin"
            ],
            "type": "string"
          },
          "kommio_catalog_entry": {
            "description": "Listing format version (1)",
            "format": "int64",
            "type": "integer"
          },
          "min_kommio_version": {
            "type": "string"
          },
          "name": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "needs_operator_setup": {
            "type": "boolean"
          },
          "operator_setup": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "What the operator must do",
            "type": "object"
          },
          "panels": {
            "items": {
              "$ref": "#/components/schemas/Panel"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "private": {
            "type": "boolean"
          },
          "publisher": {
            "$ref": "#/components/schemas/CatalogPublisher"
          },
          "requires_operator_setup": {
            "type": "boolean"
          },
          "scopes": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "scoping": {
            "description": "What an installation can be limited to: inbox, team",
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "screenshots": {
            "items": {
              "$ref": "#/components/schemas/CatalogScreenshot"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "settings_form": {
            "items": {
              "$ref": "#/components/schemas/SettingsField"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "settings_schema": {
            "description": "The settings form: a constrained JSON Schema subset (docs/integrations.md)"
          },
          "slug": {
            "type": "string"
          },
          "source": {
            "enum": [
              "builtin",
              "feed",
              "private"
            ],
            "type": "string"
          },
          "summary": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "version": {
            "description": "Semantic version of this listing",
            "type": "string"
          },
          "webhook_subscriptions": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "private",
          "installable",
          "settings_form",
          "allowed",
          "can_install",
          "can_request",
          "installations",
          "source",
          "featured",
          "hidden",
          "needs_operator_setup",
          "kommio_catalog_entry",
          "slug",
          "version",
          "kind",
          "category",
          "name",
          "summary",
          "description",
          "publisher",
          "icon",
          "data",
          "scopes",
          "auth",
          "editions",
          "install"
        ],
        "type": "object"
      },
      "CatalogInstall": {
        "additionalProperties": false,
        "properties": {
          "channel": {
            "maxLength": 40,
            "type": "string"
          },
          "links": {
            "items": {
              "$ref": "#/components/schemas/CatalogLink"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "method": {
            "enum": [
              "connector",
              "native",
              "inbox",
              "rule_template",
              "flow_template",
              "bot",
              "app",
              "connector_editor",
              "guide",
              "informational"
            ],
            "type": "string"
          },
          "provider": {
            "maxLength": 40,
            "type": "string"
          },
          "steps": {
            "items": {
              "additionalProperties": {
                "type": "string"
              },
              "type": "object"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "template": {
            "maxLength": 60,
            "type": "string"
          }
        },
        "required": [
          "method"
        ],
        "type": "object"
      },
      "CatalogItem": {
        "additionalProperties": false,
        "properties": {
          "category": {
            "type": "string"
          },
          "editions": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "featured": {
            "type": "boolean"
          },
          "icon": {
            "type": "string"
          },
          "install_method": {
            "type": "string"
          },
          "installed": {
            "description": "Installations of this entry that are not uninstalled (0 without integrations:read)",
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "type": "string"
          },
          "name": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "needs_operator_setup": {
            "type": "boolean"
          },
          "private": {
            "type": "boolean"
          },
          "publisher": {
            "$ref": "#/components/schemas/CatalogPublisher"
          },
          "slug": {
            "type": "string"
          },
          "source": {
            "enum": [
              "builtin",
              "feed",
              "private"
            ],
            "type": "string"
          },
          "summary": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "version": {
            "type": "string"
          }
        },
        "required": [
          "slug",
          "version",
          "kind",
          "category",
          "name",
          "summary",
          "icon",
          "publisher",
          "source",
          "private",
          "featured",
          "needs_operator_setup",
          "editions",
          "tags",
          "install_method",
          "installed"
        ],
        "type": "object"
      },
      "CatalogLink": {
        "additionalProperties": false,
        "properties": {
          "label": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "url": {
            "maxLength": 500,
            "type": "string"
          }
        },
        "required": [
          "label",
          "url"
        ],
        "type": "object"
      },
      "CatalogListOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/CatalogListOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "categories": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "entries": {
            "items": {
              "$ref": "#/components/schemas/CatalogItem"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "kinds": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "entries",
          "categories",
          "kinds"
        ],
        "type": "object"
      },
      "CatalogPublisher": {
        "additionalProperties": false,
        "properties": {
          "name": {
            "maxLength": 80,
            "minLength": 1,
            "type": "string"
          },
          "url": {
            "maxLength": 300,
            "type": "string"
          },
          "verified": {
            "description": "Kommio checked who the publisher is",
            "type": "boolean"
          }
        },
        "required": [
          "name",
          "verified"
        ],
        "type": "object"
      },
      "CatalogScreenshot": {
        "additionalProperties": false,
        "properties": {
          "caption": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "url": {
            "maxLength": 500,
            "type": "string"
          }
        },
        "required": [
          "url"
        ],
        "type": "object"
      },
      "CategoriesOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/CategoriesOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "_redacted": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "attribute": {
            "description": "The attribute counted (empty: none, the workspace has no category attribute)",
            "type": "string"
          },
          "days": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "from": {
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "other": {
            "description": "Conversations created in the window with another value",
            "format": "int64",
            "type": "integer"
          },
          "scoped": {
            "description": "Category trends span the workspace: roles that see part of it get none",
            "type": "boolean"
          },
          "to": {
            "type": "string"
          },
          "total": {
            "description": "Conversations created in the window with any value",
            "format": "int64",
            "type": "integer"
          },
          "tz": {
            "type": "string"
          },
          "values": {
            "description": "The values with the most conversations created in the window, most first",
            "items": {
              "$ref": "#/components/schemas/CategoryValue"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "from",
          "to",
          "tz",
          "scoped",
          "note",
          "attribute",
          "days",
          "values",
          "other",
          "total"
        ],
        "type": "object"
      },
      "CategoryValue": {
        "additionalProperties": false,
        "properties": {
          "created": {
            "description": "Conversations created in the window with this value now",
            "format": "int64",
            "type": "integer"
          },
          "label": {
            "type": "string"
          },
          "previous_created": {
            "description": "Created in the 14 days before the window (the first day's baseline)",
            "format": "int64",
            "type": "integer"
          },
          "resolution_bh_median_ms": {
            "format": "int64",
            "type": "integer"
          },
          "resolution_median_ms": {
            "format": "int64",
            "type": "integer"
          },
          "resolved": {
            "description": "Resolved in the window with this value at the resolution",
            "format": "int64",
            "type": "integer"
          },
          "series": {
            "description": "Created per day of the window",
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "spikes": {
            "description": "Days flagged by the spike rule",
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "value_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "value_id",
          "label",
          "created",
          "resolved",
          "resolution_median_ms",
          "resolution_bh_median_ms",
          "series",
          "spikes",
          "previous_created"
        ],
        "type": "object"
      },
      "ChannelInfo": {
        "additionalProperties": false,
        "properties": {
          "capabilities": {
            "$ref": "#/components/schemas/Capabilities"
          },
          "config_schema": {},
          "kind": {
            "type": "string"
          },
          "receives_webhooks": {
            "type": "boolean"
          },
          "secrets": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "kind",
          "config_schema",
          "secrets",
          "capabilities",
          "receives_webhooks"
        ],
        "type": "object"
      },
      "ChannelMixOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ChannelMixOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "from": {
            "type": "string"
          },
          "rows": {
            "items": {
              "$ref": "#/components/schemas/ChannelRow"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "scoped": {
            "type": "boolean"
          },
          "to": {
            "type": "string"
          },
          "tz": {
            "type": "string"
          }
        },
        "required": [
          "from",
          "to",
          "tz",
          "rows",
          "scoped"
        ],
        "type": "object"
      },
      "ChannelRow": {
        "additionalProperties": false,
        "properties": {
          "created": {
            "format": "int64",
            "type": "integer"
          },
          "first_response_bh_median_ms": {
            "format": "int64",
            "type": "integer"
          },
          "first_response_bh_p90_ms": {
            "format": "int64",
            "type": "integer"
          },
          "first_response_count": {
            "format": "int64",
            "type": "integer"
          },
          "first_response_median_ms": {
            "format": "int64",
            "type": "integer"
          },
          "first_response_p90_ms": {
            "format": "int64",
            "type": "integer"
          },
          "inboxes": {
            "description": "Inboxes of this kind with numbers in the window",
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "description": "The inboxes' channel kind: email, web_chat, telegram, sms, slack, messenger, instagram, api, or a plugin's",
            "type": "string"
          },
          "resolution_bh_median_ms": {
            "format": "int64",
            "type": "integer"
          },
          "resolution_median_ms": {
            "format": "int64",
            "type": "integer"
          },
          "resolved": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "kind",
          "inboxes",
          "created",
          "resolved",
          "first_response_count",
          "first_response_median_ms",
          "first_response_p90_ms",
          "first_response_bh_median_ms",
          "first_response_bh_p90_ms",
          "resolution_median_ms",
          "resolution_bh_median_ms"
        ],
        "type": "object"
      },
      "ChannelTestInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ChannelTestInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "config": {
            "description": "The setup form's values, secrets included"
          },
          "inbox_id": {
            "description": "An existing inbox whose stored secrets fill the ones left out",
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ChannelTestOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ChannelTestOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "error": {
            "type": "string"
          },
          "ok": {
            "type": "boolean"
          },
          "result": {
            "additionalProperties": {},
            "description": "What the provider said (a Telegram bot's user name, name and t.me link)",
            "type": "object"
          }
        },
        "required": [
          "ok"
        ],
        "type": "object"
      },
      "ChannelsOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ChannelsOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "channels": {
            "items": {
              "$ref": "#/components/schemas/ChannelInfo"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "channels"
        ],
        "type": "object"
      },
      "ChatwootAccount": {
        "additionalProperties": false,
        "properties": {
          "admin": {
            "type": "boolean"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "role": {
            "description": "administrator or agent; only administrators can import",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "role",
          "admin"
        ],
        "type": "object"
      },
      "ChatwootConnectInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ChatwootConnectInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "account_id": {
            "description": "The Chatwoot account to import",
            "format": "int64",
            "minimum": 1,
            "type": "integer"
          },
          "base_url": {
            "maxLength": 500,
            "type": "string"
          },
          "token": {
            "description": "Empty keeps the saved token",
            "maxLength": 500,
            "type": "string"
          }
        },
        "required": [
          "base_url",
          "account_id"
        ],
        "type": "object"
      },
      "ChatwootConnectionOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ChatwootConnectionOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "connected": {
            "type": "boolean"
          },
          "connection": {
            "$ref": "#/components/schemas/ImportConnection"
          },
          "skip_silent_contacts": {
            "description": "Whether runs of this account leave silent contacts out, as the last run left it",
            "type": "boolean"
          }
        },
        "required": [
          "connected",
          "skip_silent_contacts"
        ],
        "type": "object"
      },
      "ChatwootJobInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ChatwootJobInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "allow_mass_delete": {
            "description": "Catch-up: mirror deletions beyond the safety valve (more than 20% or 1,000 records of a kind); without it such a catch-up stops before writing anything",
            "type": "boolean"
          },
          "allow_overwrite_kommio_work": {
            "description": "Catch-up: run although the team has created conversations or messages in Kommio since the last run (Chatwoot's versions then win over their edits); without it such a catch-up stops before writing anything",
            "type": "boolean"
          },
          "include_help_center": {
            "type": "boolean"
          },
          "include_silent_contacts": {
            "description": "Import silent contacts again (remembered likewise). With neither option a run keeps the last run's choice",
            "type": "boolean"
          },
          "kind": {
            "enum": [
              "dry_run",
              "full",
              "delta"
            ],
            "type": "string"
          },
          "only_new": {
            "description": "Catch-up after the switch: only create what is new in Chatwoot (new messages are added to imported conversations); never update or delete what was imported before",
            "type": "boolean"
          },
          "publish_articles": {
            "type": "boolean"
          },
          "skip_silent_contacts": {
            "description": "Only contacts who contacted you: leave out contacts with no conversation and no label (one that gets a conversation later is imported with it). Remembered for later runs",
            "type": "boolean"
          },
          "with_channel_secrets": {
            "description": "Copy the widget's identity secret and mailbox passwords (sealed)",
            "type": "boolean"
          }
        },
        "required": [
          "kind"
        ],
        "type": "object"
      },
      "ChatwootJobsOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ChatwootJobsOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "jobs": {
            "items": {
              "$ref": "#/components/schemas/ImportJob"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "jobs"
        ],
        "type": "object"
      },
      "ChatwootTestInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ChatwootTestInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "base_url": {
            "description": "Where Chatwoot runs, e.g. https://app.chatwoot.com",
            "maxLength": 500,
            "type": "string"
          },
          "token": {
            "description": "An administrator's access token (Chatwoot › Profile settings › Access token); empty uses the saved one",
            "maxLength": 500,
            "type": "string"
          }
        },
        "required": [
          "base_url"
        ],
        "type": "object"
      },
      "ChatwootTestOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ChatwootTestOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "accounts": {
            "items": {
              "$ref": "#/components/schemas/ChatwootAccount"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "user": {
            "description": "Who the token belongs to",
            "type": "string"
          }
        },
        "required": [
          "user",
          "accounts"
        ],
        "type": "object"
      },
      "Checklist": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/Checklist.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "account_created_at": {
            "format": "date-time",
            "type": "string"
          },
          "branding": {
            "description": "A brand colour, logo or mark is set",
            "type": "boolean"
          },
          "business_hours": {
            "description": "Business hours are set for the workspace or an inbox",
            "type": "boolean"
          },
          "teammates": {
            "description": "Someone else is a member or has a pending invitation",
            "type": "boolean"
          },
          "web_chat_inbox": {
            "description": "The workspace has a website chat inbox",
            "type": "boolean"
          },
          "widget_installed": {
            "description": "A website chat inbox's widget was seen on a website",
            "type": "boolean"
          }
        },
        "required": [
          "account_created_at",
          "web_chat_inbox",
          "widget_installed",
          "teammates",
          "business_hours",
          "branding"
        ],
        "type": "object"
      },
      "CollectionOrderItem": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "parent_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "id"
        ],
        "type": "object"
      },
      "ConfirmInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ConfirmInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "code": {
            "maxLength": 8,
            "minLength": 6,
            "type": "string"
          }
        },
        "required": [
          "code"
        ],
        "type": "object"
      },
      "ConfirmOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ConfirmOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "recovery_codes": {
            "description": "Shown once; store them safely",
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "recovery_codes"
        ],
        "type": "object"
      },
      "Connection": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/Connection.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "account_email": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "expires_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "last_auth_error": {
            "type": "string"
          },
          "last_auth_error_at": {
            "format": "date-time",
            "type": "string"
          },
          "last_refresh_at": {
            "format": "date-time",
            "type": "string"
          },
          "last_refresh_error": {
            "type": "string"
          },
          "provider": {
            "type": "string"
          },
          "purpose": {
            "type": "string"
          },
          "scopes": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "status": {
            "enum": [
              "active",
              "needs_reconnect"
            ],
            "type": "string"
          },
          "status_reason": {
            "type": "string"
          },
          "tenant": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "provider",
          "purpose",
          "account_email",
          "scopes",
          "status",
          "created_at"
        ],
        "type": "object"
      },
      "ConnectorAuth": {
        "additionalProperties": false,
        "properties": {
          "header_name": {
            "description": "api_key: the header carrying the key (default X-API-Key)",
            "maxLength": 100,
            "type": "string"
          },
          "kind": {
            "enum": [
              "none",
              "bearer",
              "basic",
              "api_key"
            ],
            "type": "string"
          },
          "secret": {
            "description": "The token, password or key; write-only",
            "maxLength": 4000,
            "type": "string"
          },
          "secret_set": {
            "readOnly": true,
            "type": "boolean"
          },
          "username": {
            "description": "basic: the user name",
            "maxLength": 200,
            "type": "string"
          }
        },
        "required": [
          "kind"
        ],
        "type": "object"
      },
      "ConnectorBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ConnectorBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "definition": {
            "$ref": "#/components/schemas/ConnectorDefinition"
          },
          "description": {
            "description": "What it does; shown to the AI agent when offered as a tool",
            "maxLength": 1000,
            "type": "string"
          },
          "enabled": {
            "description": "Defaults to true",
            "type": "boolean"
          },
          "name": {
            "maxLength": 120,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "name",
          "definition"
        ],
        "type": "object"
      },
      "ConnectorDefinition": {
        "additionalProperties": false,
        "properties": {
          "ai_tool": {
            "description": "Offer this connector to the AI agent as a tool",
            "type": "boolean"
          },
          "auth": {
            "$ref": "#/components/schemas/ConnectorAuth"
          },
          "body": {
            "description": "POST: a JSON template",
            "maxLength": 20000,
            "type": "string"
          },
          "cache_minutes": {
            "format": "int64",
            "maximum": 1440,
            "minimum": 0,
            "type": "integer"
          },
          "failure_threshold": {
            "format": "int64",
            "maximum": 50,
            "minimum": 0,
            "type": "integer"
          },
          "headers": {
            "items": {
              "$ref": "#/components/schemas/ConnectorHeader"
            },
            "maxItems": 20,
            "type": [
              "array",
              "null"
            ]
          },
          "mappings": {
            "items": {
              "$ref": "#/components/schemas/ConnectorMapping"
            },
            "maxItems": 30,
            "type": [
              "array",
              "null"
            ]
          },
          "method": {
            "enum": [
              "GET",
              "POST"
            ],
            "type": "string"
          },
          "panel": {
            "$ref": "#/components/schemas/ConnectorPanel"
          },
          "rate_limit_per_minute": {
            "format": "int64",
            "maximum": 600,
            "minimum": 0,
            "type": "integer"
          },
          "timeout_ms": {
            "format": "int64",
            "maximum": 10000,
            "minimum": 0,
            "type": "integer"
          },
          "triggers": {
            "$ref": "#/components/schemas/ConnectorTriggers"
          },
          "url": {
            "maxLength": 2000,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "method",
          "url",
          "headers",
          "auth",
          "mappings",
          "triggers"
        ],
        "type": "object"
      },
      "ConnectorHeader": {
        "additionalProperties": false,
        "properties": {
          "name": {
            "maxLength": 100,
            "minLength": 1,
            "type": "string"
          },
          "secret": {
            "type": "boolean"
          },
          "value": {
            "maxLength": 2000,
            "type": "string"
          },
          "value_set": {
            "description": "A secret value is stored; it is never returned",
            "readOnly": true,
            "type": "boolean"
          }
        },
        "required": [
          "name",
          "value"
        ],
        "type": "object"
      },
      "ConnectorImportInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ConnectorImportInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "create_attributes": {
            "description": "Create the attributes the recipe maps to that the workspace lacks (custom_attributes:manage)",
            "type": "boolean"
          },
          "enabled": {
            "description": "Defaults to false: an imported connector starts off until tested",
            "type": "boolean"
          },
          "name": {
            "description": "Overrides the recipe's name",
            "maxLength": 120,
            "type": "string"
          },
          "recipe": {
            "$ref": "#/components/schemas/ConnectorRecipe"
          },
          "secret": {
            "description": "The authentication secret, if already at hand",
            "maxLength": 4000,
            "type": "string"
          }
        },
        "required": [
          "recipe"
        ],
        "type": "object"
      },
      "ConnectorListOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ConnectorListOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "connectors": {
            "items": {
              "$ref": "#/components/schemas/ConnectorView"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "daily_cap": {
            "description": "Calls allowed per UTC day; 0 means no cap",
            "format": "int64",
            "type": "integer"
          },
          "usage_today": {
            "description": "Calls made today (UTC) by the workspace",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "connectors",
          "usage_today",
          "daily_cap"
        ],
        "type": "object"
      },
      "ConnectorMapped": {
        "additionalProperties": false,
        "properties": {
          "contact": {
            "additionalProperties": {},
            "type": "object"
          },
          "conversation": {
            "additionalProperties": {},
            "type": "object"
          },
          "panel": {
            "$ref": "#/components/schemas/ConnectorPanelData"
          },
          "skipped": {
            "items": {
              "$ref": "#/components/schemas/ConnectorMappingNote"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "contact",
          "conversation",
          "skipped"
        ],
        "type": "object"
      },
      "ConnectorMapping": {
        "additionalProperties": false,
        "properties": {
          "attribute": {
            "description": "The custom attribute key",
            "maxLength": 60,
            "minLength": 1,
            "type": "string"
          },
          "path": {
            "description": "Selector into the JSON answer (docs/connectors.md)",
            "maxLength": 300,
            "minLength": 1,
            "type": "string"
          },
          "target": {
            "enum": [
              "contact",
              "conversation"
            ],
            "type": "string"
          },
          "transform": {
            "description": "cents divides by 100; unix_* turns a timestamp into a date",
            "enum": [
              "",
              "cents",
              "unix_seconds",
              "unix_ms",
              "lowercase",
              "uppercase"
            ],
            "type": "string"
          }
        },
        "required": [
          "path",
          "target",
          "attribute"
        ],
        "type": "object"
      },
      "ConnectorMappingNote": {
        "additionalProperties": false,
        "properties": {
          "attribute": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "target": {
            "type": "string"
          }
        },
        "required": [
          "target",
          "attribute",
          "reason"
        ],
        "type": "object"
      },
      "ConnectorPanel": {
        "additionalProperties": false,
        "properties": {
          "fields": {
            "items": {
              "$ref": "#/components/schemas/ConnectorPanelField"
            },
            "maxItems": 8,
            "type": [
              "array",
              "null"
            ]
          },
          "items": {
            "description": "table: selector of the array whose items are rows",
            "maxLength": 300,
            "type": "string"
          },
          "kind": {
            "enum": [
              "fields",
              "table"
            ],
            "type": "string"
          },
          "max_rows": {
            "format": "int64",
            "maximum": 10,
            "minimum": 0,
            "type": "integer"
          },
          "title": {
            "maxLength": 60,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "title",
          "kind",
          "fields"
        ],
        "type": "object"
      },
      "ConnectorPanelColumn": {
        "additionalProperties": false,
        "properties": {
          "format": {
            "type": "string"
          },
          "label": {
            "type": "string"
          }
        },
        "required": [
          "label"
        ],
        "type": "object"
      },
      "ConnectorPanelData": {
        "additionalProperties": false,
        "properties": {
          "columns": {
            "items": {
              "$ref": "#/components/schemas/ConnectorPanelColumn"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "fields": {
            "items": {
              "$ref": "#/components/schemas/ConnectorPanelValue"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "kind": {
            "enum": [
              "fields",
              "table"
            ],
            "type": "string"
          },
          "rows": {
            "items": {
              "items": {},
              "type": [
                "array",
                "null"
              ]
            },
            "type": [
              "array",
              "null"
            ]
          },
          "title": {
            "type": "string"
          },
          "total": {
            "description": "Rows in the answer before max_rows",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "title",
          "kind"
        ],
        "type": "object"
      },
      "ConnectorPanelField": {
        "additionalProperties": false,
        "properties": {
          "format": {
            "enum": [
              "",
              "text",
              "number",
              "money",
              "date",
              "link",
              "bool"
            ],
            "type": "string"
          },
          "label": {
            "maxLength": 60,
            "minLength": 1,
            "type": "string"
          },
          "path": {
            "description": "Selector; relative to each item for a table",
            "maxLength": 300,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "label",
          "path"
        ],
        "type": "object"
      },
      "ConnectorPanelValue": {
        "additionalProperties": false,
        "properties": {
          "format": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "value": {}
        },
        "required": [
          "label",
          "value"
        ],
        "type": "object"
      },
      "ConnectorPanelView": {
        "additionalProperties": false,
        "properties": {
          "connector_id": {
            "format": "int64",
            "type": "integer"
          },
          "error": {
            "type": "string"
          },
          "fetched_at": {
            "format": "date-time",
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "panel": {
            "$ref": "#/components/schemas/ConnectorPanelData"
          },
          "pending": {
            "description": "A run was queued by this request",
            "type": "boolean"
          },
          "stale": {
            "type": "boolean"
          },
          "status": {
            "description": "ok, not_found, failed, empty (never ran for this contact), off",
            "type": "string"
          }
        },
        "required": [
          "connector_id",
          "name",
          "status",
          "stale",
          "pending"
        ],
        "type": "object"
      },
      "ConnectorPlaceholderInfo": {
        "additionalProperties": false,
        "properties": {
          "group": {
            "enum": [
              "contact",
              "conversation",
              "visitor"
            ],
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "needs_conversation": {
            "type": "boolean"
          }
        },
        "required": [
          "name",
          "group",
          "needs_conversation"
        ],
        "type": "object"
      },
      "ConnectorPlaceholdersOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ConnectorPlaceholdersOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "placeholders": {
            "items": {
              "$ref": "#/components/schemas/ConnectorPlaceholderInfo"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "placeholders"
        ],
        "type": "object"
      },
      "ConnectorRecipe": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ConnectorRecipe.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "attributes": {
            "items": {
              "$ref": "#/components/schemas/ConnectorRecipeAttribute"
            },
            "maxItems": 30,
            "type": [
              "array",
              "null"
            ]
          },
          "definition": {
            "$ref": "#/components/schemas/ConnectorDefinition"
          },
          "description": {
            "maxLength": 1000,
            "type": "string"
          },
          "example_response": {
            "description": "An answer the selectors were written for"
          },
          "id": {
            "maxLength": 60,
            "type": "string"
          },
          "kommio_connector": {
            "description": "Format version (1)",
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "maxLength": 120,
            "minLength": 1,
            "type": "string"
          },
          "secret_label": {
            "maxLength": 200,
            "type": "string"
          },
          "setup": {
            "description": "Steps a person follows before the first run",
            "items": {
              "type": "string"
            },
            "maxItems": 10,
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "kommio_connector",
          "name",
          "definition"
        ],
        "type": "object"
      },
      "ConnectorRecipeAttribute": {
        "additionalProperties": false,
        "properties": {
          "description": {
            "maxLength": 500,
            "type": "string"
          },
          "key": {
            "maxLength": 60,
            "minLength": 1,
            "type": "string"
          },
          "model": {
            "enum": [
              "contact",
              "conversation"
            ],
            "type": "string"
          },
          "name": {
            "maxLength": 120,
            "minLength": 1,
            "type": "string"
          },
          "options": {
            "items": {
              "type": "string"
            },
            "maxItems": 100,
            "type": [
              "array",
              "null"
            ]
          },
          "type": {
            "enum": [
              "text",
              "number",
              "bool",
              "date",
              "list",
              "link"
            ],
            "type": "string"
          }
        },
        "required": [
          "model",
          "key",
          "name",
          "type"
        ],
        "type": "object"
      },
      "ConnectorRecipesOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ConnectorRecipesOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "recipes": {
            "items": {
              "$ref": "#/components/schemas/RecipeView"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "recipes"
        ],
        "type": "object"
      },
      "ConnectorResult": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ConnectorResult.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "cached": {
            "type": "boolean"
          },
          "error": {
            "type": "string"
          },
          "fetched_at": {
            "format": "date-time",
            "type": "string"
          },
          "http_status": {
            "format": "int64",
            "type": "integer"
          },
          "latency_ms": {
            "format": "int64",
            "type": "integer"
          },
          "panel": {
            "$ref": "#/components/schemas/ConnectorPanelData"
          },
          "run_id": {
            "format": "int64",
            "type": "integer"
          },
          "skipped": {
            "items": {
              "$ref": "#/components/schemas/ConnectorMappingNote"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "status": {
            "type": "string"
          },
          "written": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "status",
          "written"
        ],
        "type": "object"
      },
      "ConnectorRun": {
        "additionalProperties": false,
        "properties": {
          "contact_id": {
            "format": "int64",
            "type": "integer"
          },
          "conversation_id": {
            "format": "int64",
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "error": {
            "type": "string"
          },
          "excerpt": {
            "type": "string"
          },
          "http_status": {
            "format": "int64",
            "type": "integer"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "latency_ms": {
            "format": "int64",
            "type": "integer"
          },
          "status": {
            "type": "string"
          },
          "trigger": {
            "type": "string"
          },
          "written": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "trigger",
          "status",
          "written",
          "created_at"
        ],
        "type": "object"
      },
      "ConnectorRunInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ConnectorRunInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "contact_id": {
            "format": "int64",
            "type": "integer"
          },
          "conversation_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ConnectorRunsOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ConnectorRunsOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "runs": {
            "items": {
              "$ref": "#/components/schemas/ConnectorRun"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "runs"
        ],
        "type": "object"
      },
      "ConnectorSchedule": {
        "additionalProperties": false,
        "properties": {
          "active_within_days": {
            "format": "int64",
            "maximum": 90,
            "minimum": 0,
            "type": "integer"
          },
          "enabled": {
            "type": "boolean"
          },
          "every_hours": {
            "format": "int64",
            "maximum": 168,
            "minimum": 0,
            "type": "integer"
          },
          "max_contacts": {
            "format": "int64",
            "maximum": 1000,
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "enabled"
        ],
        "type": "object"
      },
      "ConnectorStats": {
        "additionalProperties": false,
        "properties": {
          "failed": {
            "format": "int64",
            "type": "integer"
          },
          "ok": {
            "format": "int64",
            "type": "integer"
          },
          "runs": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "runs",
          "ok",
          "failed"
        ],
        "type": "object"
      },
      "ConnectorTestInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ConnectorTestInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "connector_id": {
            "description": "Use this saved connector's secrets for the ones left empty",
            "format": "int64",
            "type": "integer"
          },
          "contact_id": {
            "format": "int64",
            "type": "integer"
          },
          "conversation_id": {
            "format": "int64",
            "type": "integer"
          },
          "definition": {
            "$ref": "#/components/schemas/ConnectorDefinition"
          },
          "values": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Test values by placeholder name; they win over the contact's",
            "type": "object"
          }
        },
        "required": [
          "definition"
        ],
        "type": "object"
      },
      "ConnectorTestResult": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ConnectorTestResult.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "body": {
            "description": "The rendered request body, secrets masked",
            "type": "string"
          },
          "error": {
            "type": "string"
          },
          "headers": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Request headers with secret values masked",
            "type": "object"
          },
          "http_status": {
            "format": "int64",
            "type": "integer"
          },
          "latency_ms": {
            "format": "int64",
            "type": "integer"
          },
          "mapped": {
            "$ref": "#/components/schemas/ConnectorMapped"
          },
          "method": {
            "type": "string"
          },
          "missing": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "response": {
            "description": "The raw answer (up to 256 KB), secrets masked",
            "type": "string"
          },
          "status": {
            "enum": [
              "ok",
              "not_found",
              "skipped",
              "failed",
              "capped"
            ],
            "type": "string"
          },
          "truncated": {
            "type": "boolean"
          },
          "url": {
            "description": "The resolved URL with secrets masked",
            "type": "string"
          }
        },
        "required": [
          "status",
          "method",
          "url",
          "headers"
        ],
        "type": "object"
      },
      "ConnectorTriggers": {
        "additionalProperties": false,
        "properties": {
          "contact_created": {
            "type": "boolean"
          },
          "conversation_opened": {
            "type": "boolean"
          },
          "schedule": {
            "$ref": "#/components/schemas/ConnectorSchedule"
          }
        },
        "required": [
          "conversation_opened",
          "contact_created",
          "schedule"
        ],
        "type": "object"
      },
      "ConnectorView": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ConnectorView.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "consecutive_failures": {
            "format": "int64",
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "definition": {
            "$ref": "#/components/schemas/ConnectorDefinition"
          },
          "description": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "last_run_at": {
            "format": "date-time",
            "type": "string"
          },
          "last_status": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "state": {
            "description": "tripped: turned off by the circuit breaker",
            "enum": [
              "ok",
              "tripped"
            ],
            "type": "string"
          },
          "stats_24h": {
            "$ref": "#/components/schemas/ConnectorStats"
          },
          "tripped_at": {
            "format": "date-time",
            "type": "string"
          },
          "tripped_reason": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "description",
          "enabled",
          "state",
          "definition",
          "consecutive_failures",
          "stats_24h",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "Contact": {
        "additionalProperties": false,
        "properties": {
          "avatar_url": {
            "type": "string"
          },
          "blocked": {
            "type": "boolean"
          },
          "company": {
            "type": "string"
          },
          "conversations": {
            "$ref": "#/components/schemas/ContactConversations",
            "description": "Conversations the caller may see (GET /contacts and GET /contacts/{id})"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "custom_attributes": {},
          "customer_attributes": {
            "description": "Attributes the customer's site signed into the widget identity (attributes + attributes_hmac): verified, read-only, replaced on each signed session"
          },
          "display_email": {
            "description": "An email typed in the widget's pre-chat form, or sent by the customer's site with a sign-in without signing it: shown only, never used to find or match a contact",
            "type": "string"
          },
          "emails": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "external_ids": {
            "items": {
              "$ref": "#/components/schemas/ExternalID"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "is_person": {
            "description": "False for an anonymous website visitor: no email, phone, external or channel identity, no conversation, not added by the team",
            "type": "boolean"
          },
          "last_activity_at": {
            "format": "date-time",
            "type": "string"
          },
          "merged_into_id": {
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "phones": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "possible_match": {
            "$ref": "#/components/schemas/ContactMatch",
            "description": "Another contact you may see whose email identity equals this contact's display email (typed in the pre-chat form or sent unsigned by the site); a candidate for a merge, never merged automatically. Only on GET /contacts/{id}"
          },
          "tags": {
            "description": "The contact's tags (GET /contacts and GET /contacts/{id})",
            "items": {
              "$ref": "#/components/schemas/Tag"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "name",
          "emails",
          "phones",
          "external_ids",
          "custom_attributes",
          "customer_attributes",
          "tags",
          "blocked",
          "is_person",
          "created_at"
        ],
        "type": "object"
      },
      "ContactActivity": {
        "additionalProperties": false,
        "properties": {
          "actor_name": {
            "type": "string"
          },
          "at": {
            "format": "date-time",
            "type": "string"
          },
          "change": {
            "$ref": "#/components/schemas/ContactChange"
          },
          "conversation_id": {
            "format": "int64",
            "type": "integer"
          },
          "display_id": {
            "format": "int64",
            "type": "integer"
          },
          "inbox_name": {
            "type": "string"
          },
          "kind": {
            "enum": [
              "created",
              "imported",
              "updated",
              "tags",
              "identity_added",
              "identity_removed",
              "merged",
              "note",
              "conversation_started",
              "conversation_resolved",
              "site_change"
            ],
            "type": "string"
          },
          "note_id": {
            "format": "int64",
            "type": "integer"
          },
          "subject": {
            "type": "string"
          },
          "tags_added": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "tags_removed": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "text": {
            "type": "string"
          }
        },
        "required": [
          "kind",
          "at"
        ],
        "type": "object"
      },
      "ContactActivityOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ContactActivityOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "_redacted": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/ContactActivity"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "items"
        ],
        "type": "object"
      },
      "ContactBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ContactBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "avatar_url": {
            "maxLength": 1000,
            "type": "string"
          },
          "company": {
            "maxLength": 200,
            "type": "string"
          },
          "custom_attributes": {},
          "name": {
            "maxLength": 200,
            "type": "string"
          }
        },
        "type": "object"
      },
      "ContactBulkImpactInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ContactBulkImpactInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "selection": {
            "$ref": "#/components/schemas/ContactBulkSelection"
          }
        },
        "required": [
          "selection"
        ],
        "type": "object"
      },
      "ContactBulkInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ContactBulkInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "action": {
            "enum": [
              "tag_add",
              "tag_remove",
              "erase"
            ],
            "type": "string"
          },
          "confirm": {
            "description": "Erasing more than one contact: the confirm text GET the impact shows (the number of contacts)",
            "maxLength": 40,
            "type": "string"
          },
          "selection": {
            "$ref": "#/components/schemas/ContactBulkSelection"
          },
          "tag_ids": {
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "maxItems": 20,
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "action",
          "selection"
        ],
        "type": "object"
      },
      "ContactBulkJob": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ContactBulkJob.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "action": {
            "enum": [
              "tag_add",
              "tag_remove",
              "erase"
            ],
            "type": "string"
          },
          "changed": {
            "description": "Contacts actually changed (a tag already there is not a change)",
            "format": "int64",
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "error": {
            "type": "string"
          },
          "failed": {
            "format": "int64",
            "type": "integer"
          },
          "finished_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "processed": {
            "format": "int64",
            "type": "integer"
          },
          "status": {
            "enum": [
              "queued",
              "running",
              "succeeded",
              "failed"
            ],
            "type": "string"
          },
          "total": {
            "description": "Contacts selected when it was asked for (capped at 10,000 for all_matching)",
            "format": "int64",
            "type": "integer"
          },
          "total_capped": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "action",
          "status",
          "total",
          "total_capped",
          "processed",
          "changed",
          "failed",
          "created_at"
        ],
        "type": "object"
      },
      "ContactBulkSelection": {
        "additionalProperties": false,
        "properties": {
          "all_matching": {
            "description": "Every contact the list request below matches",
            "type": "boolean"
          },
          "audience": {
            "description": "people: contacts with an email, phone, external or channel identity, a conversation, or added by the team; visitors: the other, anonymous website visitors; all (the default)",
            "enum": [
              "people",
              "visitors",
              "all",
              ""
            ],
            "type": "string"
          },
          "filter": {
            "description": "An ad-hoc contact condition as JSON (GET /views/schema?object=contact), combined with the view",
            "maxLength": 8000,
            "type": "string"
          },
          "ids": {
            "description": "The selected contacts (ignored with all_matching)",
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "maxItems": 1000,
            "type": [
              "array",
              "null"
            ]
          },
          "q": {
            "description": "Matches name, email or phone",
            "maxLength": 200,
            "type": "string"
          },
          "tag_id": {
            "description": "Only contacts with this tag",
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "view_id": {
            "description": "A saved contact view (GET /views?object=contact)",
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ContactChange": {
        "additionalProperties": false,
        "properties": {
          "action": {
            "enum": [
              "contact.identity_refresh",
              "contact.merged_at_sign_in"
            ],
            "type": "string"
          },
          "contact_id": {
            "description": "The contact the row was written for: this one, or one merged into it since",
            "format": "int64",
            "type": "integer"
          },
          "conversations_moved": {
            "format": "int64",
            "type": "integer"
          },
          "field": {
            "description": "name, email, verified_email, external_id, contact, or attributes.<key> for a signed customer attribute",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "inbox_id": {
            "format": "int64",
            "type": "integer"
          },
          "inbox_name": {
            "type": "string"
          },
          "new": {
            "description": "New value for name, external_id and contact",
            "type": "string"
          },
          "new_email": {
            "description": "New value for the email fields",
            "type": "string"
          },
          "occurred_at": {
            "format": "date-time",
            "type": "string"
          },
          "old": {
            "description": "Old value for name and contact (the merged contact's name)",
            "type": "string"
          },
          "old_email": {
            "description": "Old value for the email fields",
            "type": "string"
          },
          "source_contact_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "action",
          "field",
          "contact_id",
          "occurred_at"
        ],
        "type": "object"
      },
      "ContactChangesOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ContactChangesOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "_redacted": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/ContactChange"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "items"
        ],
        "type": "object"
      },
      "ContactConversations": {
        "additionalProperties": false,
        "properties": {
          "last_at": {
            "description": "Last activity of the contact's most recent conversation you may see",
            "format": "date-time",
            "type": "string"
          },
          "last_channel": {
            "description": "Channel kind of that conversation's inbox (email, web_chat, sms, ...)",
            "type": "string"
          },
          "last_inbox": {
            "description": "Name of that conversation's inbox",
            "type": "string"
          },
          "open": {
            "format": "int64",
            "type": "integer"
          },
          "pending": {
            "format": "int64",
            "type": "integer"
          },
          "snoozed": {
            "format": "int64",
            "type": "integer"
          },
          "total": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "total",
          "open",
          "pending",
          "snoozed"
        ],
        "type": "object"
      },
      "ContactCount": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ContactCount.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "capped": {
            "description": "More contacts match than were counted (count is the cap)",
            "type": "boolean"
          },
          "count": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "count",
          "capped"
        ],
        "type": "object"
      },
      "ContactCreateInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ContactCreateInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "avatar_url": {
            "maxLength": 1000,
            "type": "string"
          },
          "company": {
            "maxLength": 200,
            "type": "string"
          },
          "custom_attributes": {},
          "emails": {
            "items": {
              "type": "string"
            },
            "maxItems": 10,
            "type": [
              "array",
              "null"
            ]
          },
          "external_ids": {
            "items": {
              "$ref": "#/components/schemas/ExternalID"
            },
            "maxItems": 10,
            "type": [
              "array",
              "null"
            ]
          },
          "name": {
            "maxLength": 200,
            "type": "string"
          },
          "phones": {
            "items": {
              "type": "string"
            },
            "maxItems": 10,
            "type": [
              "array",
              "null"
            ]
          }
        },
        "type": "object"
      },
      "ContactEraseImpact": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ContactEraseImpact.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "capped": {
            "description": "More contacts match than were counted (10,000)",
            "type": "boolean"
          },
          "confirm": {
            "type": "string"
          },
          "confirm_required": {
            "type": "boolean"
          },
          "contacts": {
            "$ref": "#/components/schemas/ImpactGroup"
          },
          "conversations": {
            "description": "Their conversations you may see (kept, anonymised); counted over at most 10,000 contacts",
            "format": "int64",
            "type": "integer"
          },
          "count": {
            "format": "int64",
            "type": "integer"
          },
          "exports": {
            "description": "Finished export files of the workspace (contacts and conversations) withdrawn because they may name them",
            "format": "int64",
            "type": "integer"
          },
          "files": {
            "description": "Files they sent in those conversations, deleted (counted up to 100,000)",
            "format": "int64",
            "type": "integer"
          },
          "messages": {
            "description": "Their messages in those conversations whose content, files and headers are removed (counted up to 100,000)",
            "format": "int64",
            "type": "integer"
          },
          "messages_capped": {
            "description": "More messages than were counted",
            "type": "boolean"
          },
          "notes": {
            "description": "Notes on them that are deleted",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "count",
          "capped",
          "contacts",
          "conversations",
          "messages",
          "messages_capped",
          "files",
          "notes",
          "exports",
          "confirm",
          "confirm_required"
        ],
        "type": "object"
      },
      "ContactExportInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ContactExportInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "selection": {
            "$ref": "#/components/schemas/ContactBulkSelection"
          }
        },
        "required": [
          "selection"
        ],
        "type": "object"
      },
      "ContactImport": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ContactImport.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "counts": {
            "$ref": "#/components/schemas/ImportCounts"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "error": {
            "type": "string"
          },
          "expires_at": {
            "format": "date-time",
            "type": "string"
          },
          "file_name": {
            "type": "string"
          },
          "finished_at": {
            "format": "date-time",
            "type": "string"
          },
          "headers": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "mapping": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "options": {
            "$ref": "#/components/schemas/ImportOptions"
          },
          "processed": {
            "format": "int64",
            "type": "integer"
          },
          "status": {
            "enum": [
              "uploaded",
              "queued",
              "running",
              "succeeded",
              "failed"
            ],
            "type": "string"
          },
          "total_rows": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "file_name",
          "total_rows",
          "headers",
          "mapping",
          "options",
          "status",
          "processed",
          "counts",
          "created_at",
          "expires_at"
        ],
        "type": "object"
      },
      "ContactImportPreviewOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ContactImportPreviewOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "counts": {
            "$ref": "#/components/schemas/ImportCounts"
          },
          "outcomes": {
            "description": "What each row would do (the first 100)",
            "items": {
              "$ref": "#/components/schemas/ImportOutcome"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "rows": {
            "description": "Rows the dry run applied (at most 1,000)",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "rows",
          "counts",
          "outcomes"
        ],
        "type": "object"
      },
      "ContactImportRunInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ContactImportRunInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "mapping": {
            "description": "The target of each column, in the file's order: name, first_name, last_name, company, email, phone, external_id, tags, attributes.<key>, or empty to ignore it",
            "items": {
              "type": "string"
            },
            "maxItems": 500,
            "type": [
              "array",
              "null"
            ]
          },
          "options": {
            "$ref": "#/components/schemas/ImportOptions"
          }
        },
        "required": [
          "mapping",
          "options"
        ],
        "type": "object"
      },
      "ContactImportUploadOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ContactImportUploadOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "counts": {
            "$ref": "#/components/schemas/ImportCounts"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "error": {
            "type": "string"
          },
          "expires_at": {
            "format": "date-time",
            "type": "string"
          },
          "file_name": {
            "type": "string"
          },
          "finished_at": {
            "format": "date-time",
            "type": "string"
          },
          "headers": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "mapping": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "options": {
            "$ref": "#/components/schemas/ImportOptions"
          },
          "processed": {
            "format": "int64",
            "type": "integer"
          },
          "sample": {
            "description": "The first rows of the file, for the column mapping",
            "items": {
              "items": {
                "type": "string"
              },
              "type": [
                "array",
                "null"
              ]
            },
            "type": [
              "array",
              "null"
            ]
          },
          "status": {
            "enum": [
              "uploaded",
              "queued",
              "running",
              "succeeded",
              "failed"
            ],
            "type": "string"
          },
          "total_rows": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "sample",
          "id",
          "file_name",
          "total_rows",
          "headers",
          "mapping",
          "options",
          "status",
          "processed",
          "counts",
          "created_at",
          "expires_at"
        ],
        "type": "object"
      },
      "ContactImportsOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ContactImportsOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "imports": {
            "items": {
              "$ref": "#/components/schemas/ContactImport"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "imports"
        ],
        "type": "object"
      },
      "ContactListColumns": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ContactListColumns.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "columns": {
            "description": "Column ids in order: name, identities, company, tags, conversations, last_conversation, last_channel, last_activity, created, attributes.<key>",
            "items": {
              "type": "string"
            },
            "maxItems": 30,
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "columns"
        ],
        "type": "object"
      },
      "ContactListOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ContactListOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "_redacted": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/Contact"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "next_cursor": {
            "description": "Pass as ?cursor= to fetch the next page; absent on the last page",
            "type": "string"
          }
        },
        "required": [
          "items"
        ],
        "type": "object"
      },
      "ContactMatch": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ],
        "type": "object"
      },
      "ContactNote": {
        "additionalProperties": false,
        "properties": {
          "author_id": {
            "format": "int64",
            "type": "integer"
          },
          "author_name": {
            "type": "string"
          },
          "contact_id": {
            "format": "int64",
            "type": "integer"
          },
          "content": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "contact_id",
          "content",
          "created_at"
        ],
        "type": "object"
      },
      "ContactNoteInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ContactNoteInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "content": {
            "maxLength": 20000,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "content"
        ],
        "type": "object"
      },
      "ContactNoteOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ContactNoteOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "_redacted": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "author_id": {
            "format": "int64",
            "type": "integer"
          },
          "author_name": {
            "type": "string"
          },
          "contact_id": {
            "format": "int64",
            "type": "integer"
          },
          "content": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "contact_id",
          "content",
          "created_at"
        ],
        "type": "object"
      },
      "ContactNotesOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ContactNotesOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "_redacted": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "notes": {
            "items": {
              "$ref": "#/components/schemas/ContactNote"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "notes"
        ],
        "type": "object"
      },
      "ContactOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ContactOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "_redacted": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "avatar_url": {
            "type": "string"
          },
          "blocked": {
            "type": "boolean"
          },
          "company": {
            "type": "string"
          },
          "conversations": {
            "$ref": "#/components/schemas/ContactConversations",
            "description": "Conversations the caller may see (GET /contacts and GET /contacts/{id})"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "custom_attributes": {},
          "customer_attributes": {
            "description": "Attributes the customer's site signed into the widget identity (attributes + attributes_hmac): verified, read-only, replaced on each signed session"
          },
          "display_email": {
            "description": "An email typed in the widget's pre-chat form, or sent by the customer's site with a sign-in without signing it: shown only, never used to find or match a contact",
            "type": "string"
          },
          "emails": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "external_ids": {
            "items": {
              "$ref": "#/components/schemas/ExternalID"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "is_person": {
            "description": "False for an anonymous website visitor: no email, phone, external or channel identity, no conversation, not added by the team",
            "type": "boolean"
          },
          "last_activity_at": {
            "format": "date-time",
            "type": "string"
          },
          "merged_into_id": {
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "phones": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "possible_match": {
            "$ref": "#/components/schemas/ContactMatch",
            "description": "Another contact you may see whose email identity equals this contact's display email (typed in the pre-chat form or sent unsigned by the site); a candidate for a merge, never merged automatically. Only on GET /contacts/{id}"
          },
          "tags": {
            "description": "The contact's tags (GET /contacts and GET /contacts/{id})",
            "items": {
              "$ref": "#/components/schemas/Tag"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "name",
          "emails",
          "phones",
          "external_ids",
          "custom_attributes",
          "customer_attributes",
          "tags",
          "blocked",
          "is_person",
          "created_at"
        ],
        "type": "object"
      },
      "ContactPreviewOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ContactPreviewOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "_redacted": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "contact": {
            "$ref": "#/components/schemas/Contact"
          },
          "conversations": {
            "items": {
              "$ref": "#/components/schemas/PreviewConversation"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "notes": {
            "items": {
              "$ref": "#/components/schemas/ContactNote"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "notes_total": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "contact",
          "conversations",
          "notes",
          "notes_total"
        ],
        "type": "object"
      },
      "ContactTagsInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ContactTagsInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "tag_ids": {
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "maxItems": 50,
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "tag_ids"
        ],
        "type": "object"
      },
      "ContextField": {
        "additionalProperties": false,
        "properties": {
          "kind": {
            "enum": [
              "string",
              "number",
              "bool",
              "time",
              "enum",
              "ref",
              "set"
            ],
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "ops": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "values": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "name",
          "label",
          "kind",
          "ops"
        ],
        "type": "object"
      },
      "ContextFieldsOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ContextFieldsOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "fields": {
            "items": {
              "$ref": "#/components/schemas/ContextField"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "fields"
        ],
        "type": "object"
      },
      "ConvCreateInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ConvCreateInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "contact_id": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "content": {
            "description": "Optional first outbound message",
            "maxLength": 100000,
            "type": "string"
          },
          "custom_attributes": {},
          "email": {
            "description": "Alternative to contact_id: resolves or creates the contact",
            "format": "email",
            "type": "string"
          },
          "inbox_id": {
            "format": "int64",
            "minimum": 1,
            "type": "integer"
          },
          "priority": {
            "enum": [
              "none",
              "low",
              "medium",
              "high",
              "urgent",
              ""
            ],
            "type": "string"
          },
          "subject": {
            "maxLength": 500,
            "type": "string"
          },
          "visitor_session_id": {
            "description": "Alternative to contact_id for a website chat: the signed-in visitor session from GET /inboxes/{id}/visitors of a visitor who has no contact yet; the contact is created (or matched to the one carrying their external id) with the conversation (D-208)",
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "inbox_id"
        ],
        "type": "object"
      },
      "ConvListOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ConvListOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "_redacted": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/Conversation"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "next_cursor": {
            "description": "Pass as ?cursor= to fetch the next page; absent on the last page",
            "type": "string"
          },
          "report_items": {
            "description": "With a report_metric that counts replies, ratings, surveys or bot sessions: how many of those the list's conversations hold (the number on the Reports page)",
            "format": "int64",
            "type": "integer"
          },
          "total": {
            "description": "With report_metric: how many conversations the whole list holds (every page)",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "items"
        ],
        "type": "object"
      },
      "ConvOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ConvOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "_redacted": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "assignee_id": {
            "format": "int64",
            "type": "integer"
          },
          "bot_id": {
            "description": "Set while an agent bot holds the conversation",
            "format": "int64",
            "type": "integer"
          },
          "contact_id": {
            "format": "int64",
            "type": "integer"
          },
          "contact_name": {
            "description": "The contact's name; for a contact without one, their first email address or else phone number as the caller may see it (masked, or empty when hidden)",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "csat_rating": {
            "description": "Resolved conversations: the rating (1 to 5) given for this resolution, when the customer answered the survey",
            "format": "int32",
            "maximum": 5,
            "minimum": 1,
            "type": "integer"
          },
          "custom_attributes": {},
          "display_id": {
            "format": "int64",
            "type": "integer"
          },
          "first_response_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "inbox_id": {
            "format": "int64",
            "type": "integer"
          },
          "last_activity_at": {
            "format": "date-time",
            "type": "string"
          },
          "last_inbound_at": {
            "format": "date-time",
            "type": "string"
          },
          "last_message_at": {
            "format": "date-time",
            "type": "string"
          },
          "last_message_preview": {
            "type": "string"
          },
          "priority": {
            "enum": [
              "none",
              "low",
              "medium",
              "high",
              "urgent"
            ],
            "type": "string"
          },
          "resolved_at": {
            "format": "date-time",
            "type": "string"
          },
          "snoozed_until": {
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "description": "Status key, e.g. open",
            "type": "string"
          },
          "status_category": {
            "enum": [
              "open",
              "pending",
              "snoozed",
              "resolved",
              "closed"
            ],
            "type": "string"
          },
          "subject": {
            "type": "string"
          },
          "tags": {
            "items": {
              "$ref": "#/components/schemas/Tag"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "team_id": {
            "format": "int64",
            "type": "integer"
          },
          "unread_count": {
            "format": "int32",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "display_id",
          "inbox_id",
          "contact_id",
          "contact_name",
          "status",
          "status_category",
          "priority",
          "last_activity_at",
          "unread_count",
          "custom_attributes",
          "tags",
          "created_at"
        ],
        "type": "object"
      },
      "ConvPatchInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ConvPatchInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "assignee_id": {
            "description": "Set a member; omit to keep",
            "format": "int64",
            "type": "integer"
          },
          "clear_team": {
            "type": "boolean"
          },
          "custom_attributes": {},
          "priority": {
            "enum": [
              "none",
              "low",
              "medium",
              "high",
              "urgent",
              ""
            ],
            "type": "string"
          },
          "snoozed_until": {
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "description": "Status key; snoozed needs snoozed_until",
            "maxLength": 40,
            "type": "string"
          },
          "subject": {
            "maxLength": 500,
            "type": "string"
          },
          "team_id": {
            "format": "int64",
            "type": "integer"
          },
          "unassign": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "ConvTagsInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ConvTagsInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "tag_ids": {
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "maxItems": 50,
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "tag_ids"
        ],
        "type": "object"
      },
      "Conversation": {
        "additionalProperties": false,
        "properties": {
          "assignee_id": {
            "format": "int64",
            "type": "integer"
          },
          "bot_id": {
            "description": "Set while an agent bot holds the conversation",
            "format": "int64",
            "type": "integer"
          },
          "contact_id": {
            "format": "int64",
            "type": "integer"
          },
          "contact_name": {
            "description": "The contact's name; for a contact without one, their first email address or else phone number as the caller may see it (masked, or empty when hidden)",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "csat_rating": {
            "description": "Resolved conversations: the rating (1 to 5) given for this resolution, when the customer answered the survey",
            "format": "int32",
            "maximum": 5,
            "minimum": 1,
            "type": "integer"
          },
          "custom_attributes": {},
          "display_id": {
            "format": "int64",
            "type": "integer"
          },
          "first_response_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "inbox_id": {
            "format": "int64",
            "type": "integer"
          },
          "last_activity_at": {
            "format": "date-time",
            "type": "string"
          },
          "last_inbound_at": {
            "format": "date-time",
            "type": "string"
          },
          "last_message_at": {
            "format": "date-time",
            "type": "string"
          },
          "last_message_preview": {
            "type": "string"
          },
          "priority": {
            "enum": [
              "none",
              "low",
              "medium",
              "high",
              "urgent"
            ],
            "type": "string"
          },
          "resolved_at": {
            "format": "date-time",
            "type": "string"
          },
          "snoozed_until": {
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "description": "Status key, e.g. open",
            "type": "string"
          },
          "status_category": {
            "enum": [
              "open",
              "pending",
              "snoozed",
              "resolved",
              "closed"
            ],
            "type": "string"
          },
          "subject": {
            "type": "string"
          },
          "tags": {
            "items": {
              "$ref": "#/components/schemas/Tag"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "team_id": {
            "format": "int64",
            "type": "integer"
          },
          "unread_count": {
            "format": "int32",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "display_id",
          "inbox_id",
          "contact_id",
          "contact_name",
          "status",
          "status_category",
          "priority",
          "last_activity_at",
          "unread_count",
          "custom_attributes",
          "tags",
          "created_at"
        ],
        "type": "object"
      },
      "ConversationConnectorsOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ConversationConnectorsOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "panels": {
            "items": {
              "$ref": "#/components/schemas/ConnectorPanelView"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "panels"
        ],
        "type": "object"
      },
      "ConversationRefreshOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ConversationRefreshOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "panels": {
            "items": {
              "$ref": "#/components/schemas/ConnectorPanelView"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "result": {
            "$ref": "#/components/schemas/ConnectorResult"
          }
        },
        "required": [
          "result",
          "panels"
        ],
        "type": "object"
      },
      "Cookie": {
        "additionalProperties": false,
        "properties": {
          "Domain": {
            "type": "string"
          },
          "Expires": {
            "format": "date-time",
            "type": "string"
          },
          "HttpOnly": {
            "type": "boolean"
          },
          "MaxAge": {
            "format": "int64",
            "type": "integer"
          },
          "Name": {
            "type": "string"
          },
          "Partitioned": {
            "type": "boolean"
          },
          "Path": {
            "type": "string"
          },
          "Quoted": {
            "type": "boolean"
          },
          "Raw": {
            "type": "string"
          },
          "RawExpires": {
            "type": "string"
          },
          "SameSite": {
            "format": "int64",
            "type": "integer"
          },
          "Secure": {
            "type": "boolean"
          },
          "Unparsed": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "Value": {
            "type": "string"
          }
        },
        "required": [
          "Name",
          "Value",
          "Quoted",
          "Path",
          "Domain",
          "Expires",
          "RawExpires",
          "MaxAge",
          "Secure",
          "HttpOnly",
          "SameSite",
          "Partitioned",
          "Raw",
          "Unparsed"
        ],
        "type": "object"
      },
      "CoreModuleView": {
        "additionalProperties": false,
        "properties": {
          "can_manage": {
            "description": "The caller may change its settings (plugins:manage)",
            "type": "boolean"
          },
          "default": {},
          "description": {
            "type": "string"
          },
          "key": {
            "description": "The setting that holds it, read and written through /settings/{key}",
            "type": "string"
          },
          "kind": {
            "description": "What it does, for the kind line",
            "enum": [
              "message_guard",
              "channel",
              "automation_action",
              "settings"
            ],
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "schema": {
            "description": "JSON Schema of the settings object"
          }
        },
        "required": [
          "key",
          "name",
          "kind",
          "schema",
          "default",
          "can_manage"
        ],
        "type": "object"
      },
      "Counts": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/Counts.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "by_inbox": {
            "additionalProperties": {
              "format": "int64",
              "type": "integer"
            },
            "description": "Open conversations per inbox id",
            "type": "object"
          },
          "mine": {
            "description": "Open and assigned to the caller",
            "format": "int64",
            "type": "integer"
          },
          "open": {
            "format": "int64",
            "type": "integer"
          },
          "pending": {
            "format": "int64",
            "type": "integer"
          },
          "resolved": {
            "format": "int64",
            "type": "integer"
          },
          "snoozed": {
            "format": "int64",
            "type": "integer"
          },
          "unassigned": {
            "description": "Open and unassigned",
            "format": "int64",
            "type": "integer"
          },
          "views": {
            "additionalProperties": {
              "format": "int64",
              "type": "integer"
            },
            "description": "Matches per saved view id",
            "type": "object"
          }
        },
        "required": [
          "open",
          "pending",
          "snoozed",
          "resolved",
          "unassigned",
          "mine",
          "by_inbox",
          "views"
        ],
        "type": "object"
      },
      "CsatListOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/CsatListOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "_redacted": {
            "description": "Comments whose personal data the caller's field grants mask or hide",
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "current": {
            "$ref": "#/components/schemas/CSATSurveyInfo"
          },
          "responses": {
            "items": {
              "$ref": "#/components/schemas/CSATResponse"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "responses"
        ],
        "type": "object"
      },
      "CsatReportOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/CsatReportOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "dimension": {
            "type": "string"
          },
          "from": {
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "previous": {
            "$ref": "#/components/schemas/CSATTotals"
          },
          "rows": {
            "items": {
              "$ref": "#/components/schemas/CSATRow"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "series": {
            "items": {
              "$ref": "#/components/schemas/CSATPoint"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "to": {
            "type": "string"
          },
          "totals": {
            "$ref": "#/components/schemas/CSATTotals"
          },
          "tz": {
            "type": "string"
          }
        },
        "required": [
          "from",
          "to",
          "tz",
          "totals",
          "series",
          "dimension",
          "rows",
          "note"
        ],
        "type": "object"
      },
      "CsatResponsesOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/CsatResponsesOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "_redacted": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "next_cursor": {
            "description": "Pass as ?cursor= for the next page",
            "type": "string"
          },
          "responses": {
            "items": {
              "$ref": "#/components/schemas/CSATResponse"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "total": {
            "description": "How many responses match (every page)",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "responses",
          "total"
        ],
        "type": "object"
      },
      "DNSRecord": {
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string"
          },
          "type": {
            "enum": [
              "CNAME",
              "TXT"
            ],
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        },
        "required": [
          "type",
          "name",
          "value"
        ],
        "type": "object"
      },
      "Day": {
        "additionalProperties": false,
        "properties": {
          "date": {
            "description": "YYYY-MM-DD in the schedule's zone",
            "type": "string"
          },
          "exception": {
            "description": "The holiday or exception that sets this day",
            "type": "string"
          },
          "ranges": {
            "description": "Open ranges; empty when closed all day",
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "weekday": {
            "enum": [
              "mon",
              "tue",
              "wed",
              "thu",
              "fri",
              "sat",
              "sun"
            ],
            "type": "string"
          }
        },
        "required": [
          "date",
          "weekday",
          "ranges"
        ],
        "type": "object"
      },
      "DayActivity": {
        "additionalProperties": false,
        "properties": {
          "active_agents": {
            "format": "int64",
            "type": "integer"
          },
          "day": {
            "type": "string"
          },
          "sign_in_people": {
            "format": "int64",
            "type": "integer"
          },
          "sign_ins": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "day",
          "active_agents",
          "sign_ins",
          "sign_in_people"
        ],
        "type": "object"
      },
      "DeliveriesOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/DeliveriesOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "deliveries": {
            "items": {
              "$ref": "#/components/schemas/Delivery"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "has_more": {
            "type": "boolean"
          }
        },
        "required": [
          "deliveries",
          "has_more"
        ],
        "type": "object"
      },
      "Delivery": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/Delivery.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "attempts": {
            "format": "int32",
            "type": "integer"
          },
          "conversation_id": {
            "format": "int64",
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "delivered_at": {
            "format": "date-time",
            "type": "string"
          },
          "duration_ms": {
            "description": "Latency of the last attempt",
            "format": "int32",
            "type": "integer"
          },
          "event_id": {
            "format": "int64",
            "type": "integer"
          },
          "event_type": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "last_error": {
            "type": "string"
          },
          "last_status": {
            "format": "int32",
            "type": "integer"
          },
          "next_attempt_at": {
            "format": "date-time",
            "type": "string"
          },
          "request_snippet": {
            "description": "The first 4 KB of the last body sent",
            "type": "string"
          },
          "response_snippet": {
            "type": "string"
          },
          "status": {
            "enum": [
              "pending",
              "retrying",
              "delivered",
              "failed",
              "cancelled",
              "over_budget"
            ],
            "type": "string"
          },
          "target_kind": {
            "enum": [
              "webhook",
              "bot",
              "rule",
              "macro"
            ],
            "type": "string"
          },
          "target_url": {
            "description": "Rule and macro targets: the URL the rule or macro posted to",
            "type": "string"
          }
        },
        "required": [
          "id",
          "target_kind",
          "event_id",
          "event_type",
          "status",
          "attempts",
          "created_at"
        ],
        "type": "object"
      },
      "DemoIdentity": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/DemoIdentity.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "attributes": {
            "additionalProperties": {},
            "type": "object"
          },
          "attributes_hmac": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "email_hmac": {
            "type": "string"
          },
          "hmac": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "email",
          "hmac",
          "email_hmac",
          "attributes",
          "attributes_hmac"
        ],
        "type": "object"
      },
      "DemoRequestInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/DemoRequestInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "channels": {
            "items": {
              "type": "string"
            },
            "maxItems": 10,
            "type": [
              "array",
              "null"
            ]
          },
          "company": {
            "maxLength": 120,
            "minLength": 1,
            "type": "string"
          },
          "email": {
            "format": "email",
            "maxLength": 200,
            "type": "string"
          },
          "locale": {
            "maxLength": 10,
            "type": "string"
          },
          "message": {
            "maxLength": 2000,
            "type": "string"
          },
          "name": {
            "maxLength": 120,
            "minLength": 1,
            "type": "string"
          },
          "source": {
            "maxLength": 500,
            "type": "string"
          },
          "team_size": {
            "enum": [
              "1-5",
              "6-20",
              "21-50",
              "51-200",
              "200+"
            ],
            "type": "string"
          },
          "website": {
            "maxLength": 500,
            "type": "string"
          }
        },
        "required": [
          "name",
          "email",
          "company",
          "team_size"
        ],
        "type": "object"
      },
      "DemoRequestOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/DemoRequestOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "status": {
            "examples": [
              "received"
            ],
            "type": "string"
          }
        },
        "required": [
          "status"
        ],
        "type": "object"
      },
      "DomainCheck": {
        "additionalProperties": false,
        "properties": {
          "cname": {
            "description": "Where the domain's CNAME points now",
            "type": "string"
          },
          "cname_ok": {
            "description": "The domain's CNAME points at the app host (needed for traffic and certificates)",
            "type": "boolean"
          },
          "method": {
            "description": "How ownership was proven",
            "enum": [
              "txt",
              "http"
            ],
            "type": "string"
          },
          "reason": {
            "description": "Why verification failed",
            "type": "string"
          },
          "verified": {
            "type": "boolean"
          }
        },
        "required": [
          "verified",
          "cname_ok"
        ],
        "type": "object"
      },
      "DuplicateGroup": {
        "additionalProperties": false,
        "properties": {
          "contacts": {
            "items": {
              "$ref": "#/components/schemas/Contact"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "email": {
            "description": "The shared email, normalised (kind email)",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "enum": [
              "email",
              "phone"
            ],
            "type": "string"
          },
          "phone": {
            "description": "The shared phone (kind phone)",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "kind",
          "contacts",
          "updated_at"
        ],
        "type": "object"
      },
      "DuplicatesOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/DuplicatesOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "_redacted": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/DuplicateGroup"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "next_cursor": {
            "description": "Pass as ?cursor= to fetch the next page; absent on the last page",
            "type": "string"
          }
        },
        "required": [
          "items"
        ],
        "type": "object"
      },
      "Edge": {
        "additionalProperties": false,
        "properties": {
          "handle": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "target": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "source",
          "handle",
          "target"
        ],
        "type": "object"
      },
      "EmbeddingSettings": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/EmbeddingSettings.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "base_url": {
            "type": "string"
          },
          "default_models": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "The model used per provider when none is set",
            "type": "object"
          },
          "dimensions": {
            "format": "int64",
            "type": "integer"
          },
          "key_set": {
            "description": "A key is stored; it is never returned",
            "type": "boolean"
          },
          "known_prices": {
            "additionalProperties": {
              "$ref": "#/components/schemas/Price"
            },
            "type": "object"
          },
          "model": {
            "type": "string"
          },
          "provider": {
            "enum": [
              "none",
              "openai_compatible",
              "voyage"
            ],
            "type": "string"
          },
          "vectors_available": {
            "description": "The database has pgvector; without it search stays keyword-only",
            "type": "boolean"
          }
        },
        "required": [
          "provider",
          "key_set",
          "vectors_available",
          "default_models",
          "known_prices"
        ],
        "type": "object"
      },
      "EmbeddingTestResult": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/EmbeddingTestResult.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "dims": {
            "description": "The size of the vectors the model returned",
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "type": "string"
          },
          "latency_ms": {
            "format": "int64",
            "type": "integer"
          },
          "message": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "ok": {
            "type": "boolean"
          }
        },
        "required": [
          "ok",
          "message",
          "model",
          "latency_ms"
        ],
        "type": "object"
      },
      "EmptyOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/EmptyOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "ok": {
            "type": "boolean"
          }
        },
        "required": [
          "ok"
        ],
        "type": "object"
      },
      "EnrollInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/EnrollInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "password": {
            "description": "The current password; required unless the person has none (then the session must be under ten minutes old)",
            "maxLength": 1024,
            "type": "string"
          }
        },
        "type": "object"
      },
      "EnrollOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/EnrollOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "otpauth_url": {
            "type": "string"
          },
          "secret": {
            "type": "string"
          }
        },
        "required": [
          "secret",
          "otpauth_url"
        ],
        "type": "object"
      },
      "EntityCount": {
        "additionalProperties": false,
        "properties": {
          "conflicts": {
            "description": "Reports written before 2026-09-26 only: changed on both sides, Kommio's version kept",
            "format": "int64",
            "type": "integer"
          },
          "created": {
            "format": "int64",
            "type": "integer"
          },
          "deleted": {
            "description": "Removed (disabled, for people) because they are gone from the source",
            "format": "int64",
            "type": "integer"
          },
          "failed": {
            "format": "int64",
            "type": "integer"
          },
          "matched": {
            "description": "Linked to a record that already existed in Kommio",
            "format": "int64",
            "type": "integer"
          },
          "overwritten": {
            "description": "Changed in Kommio since the import wrote it and changed (or deleted) in the source too: the source's version was applied and the Kommio edit is lost",
            "format": "int64",
            "type": "integer"
          },
          "skipped": {
            "format": "int64",
            "type": "integer"
          },
          "skipped_silent": {
            "description": "Of the skipped, contacts left out as silent (no conversation and no label; --skip-silent-contacts)",
            "format": "int64",
            "type": "integer"
          },
          "source": {
            "description": "Records the source holds (in the delta window for delta runs)",
            "format": "int64",
            "type": "integer"
          },
          "unchanged": {
            "description": "Already imported and not changed since",
            "format": "int64",
            "type": "integer"
          },
          "updated": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "source",
          "created",
          "updated",
          "unchanged",
          "matched",
          "skipped",
          "failed",
          "deleted",
          "overwritten"
        ],
        "type": "object"
      },
      "ErrorDetail": {
        "additionalProperties": false,
        "properties": {
          "location": {
            "description": "Where the error occurred, e.g. 'body.items[3].tags' or 'path.thing-id'",
            "type": "string"
          },
          "message": {
            "description": "Error message text",
            "type": "string"
          },
          "value": {
            "description": "The value at the given location"
          }
        },
        "type": "object"
      },
      "ErrorModel": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ErrorModel.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "detail": {
            "description": "A human-readable explanation specific to this occurrence of the problem.",
            "examples": [
              "Property foo is required but is missing."
            ],
            "type": "string"
          },
          "errors": {
            "description": "Optional list of individual error details",
            "items": {
              "$ref": "#/components/schemas/ErrorDetail"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "instance": {
            "description": "A URI reference that identifies the specific occurrence of the problem.",
            "examples": [
              "https://example.com/error-log/abc123"
            ],
            "format": "uri",
            "type": "string"
          },
          "status": {
            "description": "HTTP status code",
            "examples": [
              400
            ],
            "format": "int64",
            "type": "integer"
          },
          "title": {
            "description": "A short, human-readable summary of the problem type. This value should not change between occurrences of the error.",
            "examples": [
              "Bad Request"
            ],
            "type": "string"
          },
          "type": {
            "default": "about:blank",
            "description": "A URI reference to human-readable documentation for the error.",
            "examples": [
              "https://example.com/errors/example"
            ],
            "format": "uri",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Exception": {
        "additionalProperties": false,
        "properties": {
          "closed": {
            "description": "Closed all day; otherwise open only in ranges",
            "type": "boolean"
          },
          "end_date": {
            "description": "YYYY-MM-DD, the last day it covers (the start day for one day)",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "maxLength": 120,
            "minLength": 1,
            "type": "string"
          },
          "ranges": {
            "description": "Special hours when not closed, like 10:00-14:00",
            "items": {
              "type": "string"
            },
            "maxItems": 6,
            "type": [
              "array",
              "null"
            ]
          },
          "source": {
            "description": "manual, or import:<country> for imported public holidays",
            "maxLength": 40,
            "type": "string"
          },
          "start_date": {
            "description": "YYYY-MM-DD",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string"
          },
          "yearly": {
            "description": "Repeats every year on the same month and day",
            "type": "boolean"
          }
        },
        "required": [
          "name",
          "start_date",
          "end_date",
          "closed",
          "ranges",
          "yearly"
        ],
        "type": "object"
      },
      "ExceptionsInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ExceptionsInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "exceptions": {
            "description": "The whole list; it replaces what is stored",
            "items": {
              "$ref": "#/components/schemas/Exception"
            },
            "maxItems": 500,
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "exceptions"
        ],
        "type": "object"
      },
      "ExceptionsOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ExceptionsOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "exceptions": {
            "items": {
              "$ref": "#/components/schemas/Exception"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "exceptions"
        ],
        "type": "object"
      },
      "Export": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/Export.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "error": {
            "type": "string"
          },
          "expires_at": {
            "format": "date-time",
            "type": "string"
          },
          "finished_at": {
            "format": "date-time",
            "type": "string"
          },
          "format": {
            "enum": [
              "jsonl",
              "csv"
            ],
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "enum": [
              "conversations",
              "contacts"
            ],
            "type": "string"
          },
          "rows": {
            "description": "Conversations (or contacts) written so far",
            "format": "int64",
            "type": "integer"
          },
          "size_bytes": {
            "format": "int64",
            "type": "integer"
          },
          "status": {
            "enum": [
              "queued",
              "running",
              "succeeded",
              "failed"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "kind",
          "format",
          "status",
          "rows",
          "size_bytes",
          "created_at",
          "expires_at"
        ],
        "type": "object"
      },
      "ExportFilter": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ExportFilter.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "assignee_id": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "category": {
            "enum": [
              "open",
              "pending",
              "snoozed",
              "resolved",
              "closed",
              ""
            ],
            "type": "string"
          },
          "contact_id": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "filter": {
            "description": "An ad-hoc condition as JSON",
            "maxLength": 4000,
            "type": "string"
          },
          "inbox_id": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "priority": {
            "enum": [
              "none",
              "low",
              "medium",
              "high",
              "urgent",
              ""
            ],
            "type": "string"
          },
          "q": {
            "maxLength": 200,
            "type": "string"
          },
          "tag_id": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "team_id": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "unassigned": {
            "type": "boolean"
          },
          "view_id": {
            "description": "A saved conversation view",
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ExportsOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ExportsOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "exports": {
            "items": {
              "$ref": "#/components/schemas/Export"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "exports"
        ],
        "type": "object"
      },
      "ExternalID": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "enum": [
              "visitor",
              "external"
            ],
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "kind",
          "value"
        ],
        "type": "object"
      },
      "FeatureUsage": {
        "additionalProperties": false,
        "properties": {
          "active": {
            "type": "boolean"
          },
          "category": {
            "enum": [
              "conversations",
              "productivity",
              "automation",
              "satisfaction",
              "integrations",
              "ai",
              "access"
            ],
            "type": "string"
          },
          "daily": {
            "description": "Uses per day of the range, oldest first",
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "key": {
            "type": "string"
          },
          "last_used": {
            "description": "Last day with a use within the retention window; absent: never",
            "type": "string"
          },
          "previous": {
            "description": "Uses in the range before, for the trend",
            "format": "int64",
            "type": "integer"
          },
          "refs": {
            "description": "Distinct API keys or apps (integrations)",
            "format": "int64",
            "type": "integer"
          },
          "source": {
            "enum": [
              "event",
              "server",
              "client",
              "derived"
            ],
            "type": "string"
          },
          "users": {
            "description": "Distinct people; absent for features not used by a person (API keys, rules, customers)",
            "format": "int64",
            "type": "integer"
          },
          "uses": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "uses",
          "previous",
          "daily",
          "key",
          "category",
          "source"
        ],
        "type": "object"
      },
      "FeedbackEntry": {
        "additionalProperties": false,
        "properties": {
          "comment": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "helpful": {
            "type": "boolean"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "locale": {
            "type": "string"
          },
          "source": {
            "enum": [
              "web",
              "widget"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "locale",
          "helpful",
          "source",
          "created_at"
        ],
        "type": "object"
      },
      "FeedbackSummary": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/FeedbackSummary.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "helpful": {
            "format": "int64",
            "type": "integer"
          },
          "not_helpful": {
            "format": "int64",
            "type": "integer"
          },
          "recent": {
            "items": {
              "$ref": "#/components/schemas/FeedbackEntry"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "views_30d": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "helpful",
          "not_helpful",
          "views_30d",
          "recent"
        ],
        "type": "object"
      },
      "Field": {
        "additionalProperties": false,
        "properties": {
          "kind": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "ref": {
            "type": "string"
          },
          "values": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "name",
          "label",
          "kind"
        ],
        "type": "object"
      },
      "FieldGrant": {
        "additionalProperties": false,
        "properties": {
          "mode": {
            "enum": [
              "hidden",
              "masked",
              "visible"
            ],
            "type": "string"
          },
          "tag": {
            "type": "string"
          }
        },
        "required": [
          "tag",
          "mode"
        ],
        "type": "object"
      },
      "Flow": {
        "additionalProperties": false,
        "properties": {
          "bot_id": {
            "description": "The flow's bot: what holds conversations and appears in bot reports",
            "format": "int64",
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "inboxes": {
            "items": {
              "$ref": "#/components/schemas/Placement"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "published_at": {
            "format": "date-time",
            "type": "string"
          },
          "revision": {
            "description": "The draft's revision; send it back when saving the draft",
            "format": "int32",
            "type": "integer"
          },
          "stats": {
            "$ref": "#/components/schemas/Stats"
          },
          "status": {
            "enum": [
              "draft",
              "published"
            ],
            "type": "string"
          },
          "unpublished_changes": {
            "description": "The draft differs from the published version",
            "type": "boolean"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "version": {
            "description": "The published version number",
            "format": "int32",
            "type": "integer"
          },
          "version_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "name",
          "description",
          "status",
          "revision",
          "unpublished_changes",
          "updated_at",
          "created_at",
          "inboxes",
          "stats"
        ],
        "type": "object"
      },
      "FlowAnalyticsOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/FlowAnalyticsOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "nodes": {
            "items": {
              "$ref": "#/components/schemas/NodeStats"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "stats": {
            "$ref": "#/components/schemas/Stats"
          }
        },
        "required": [
          "stats",
          "nodes"
        ],
        "type": "object"
      },
      "FlowAttachInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/FlowAttachInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "inbox_id": {
            "format": "int64",
            "minimum": 1,
            "type": "integer"
          },
          "mode": {
            "description": "auto (default): takes the inbox's new conversations that reach it in the order; manual: only when a rule, a proactive start or the previous bot hands one over",
            "enum": [
              "auto",
              "manual",
              ""
            ],
            "type": "string"
          }
        },
        "required": [
          "inbox_id"
        ],
        "type": "object"
      },
      "FlowAttachOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/FlowAttachOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "responders": {
            "description": "The inbox's bots and flows after the change",
            "items": {
              "$ref": "#/components/schemas/Responder"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "responders"
        ],
        "type": "object"
      },
      "FlowCreateInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/FlowCreateInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "description": {
            "maxLength": 300,
            "type": "string"
          },
          "name": {
            "maxLength": 80,
            "minLength": 1,
            "type": "string"
          },
          "template": {
            "description": "Start from a starter flow; omitted starts blank",
            "enum": [
              "lead_capture",
              "faq_router",
              "after_hours",
              ""
            ],
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "FlowDetail": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/FlowDetail.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "bot_id": {
            "description": "The flow's bot: what holds conversations and appears in bot reports",
            "format": "int64",
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "graph": {
            "$ref": "#/components/schemas/Graph"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "inboxes": {
            "items": {
              "$ref": "#/components/schemas/Placement"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "problems": {
            "description": "Validation of the draft; errors block publishing",
            "items": {
              "$ref": "#/components/schemas/Problem"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "published_at": {
            "format": "date-time",
            "type": "string"
          },
          "revision": {
            "description": "The draft's revision; send it back when saving the draft",
            "format": "int32",
            "type": "integer"
          },
          "stats": {
            "$ref": "#/components/schemas/Stats"
          },
          "status": {
            "enum": [
              "draft",
              "published"
            ],
            "type": "string"
          },
          "unpublished_changes": {
            "description": "The draft differs from the published version",
            "type": "boolean"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "version": {
            "description": "The published version number",
            "format": "int32",
            "type": "integer"
          },
          "version_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "graph",
          "problems",
          "id",
          "name",
          "description",
          "status",
          "revision",
          "unpublished_changes",
          "updated_at",
          "created_at",
          "inboxes",
          "stats"
        ],
        "type": "object"
      },
      "FlowDraftInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/FlowDraftInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "graph": {
            "$ref": "#/components/schemas/Graph"
          },
          "revision": {
            "description": "The revision the editor loaded; a newer one on the server answers 409",
            "format": "int32",
            "type": "integer"
          }
        },
        "required": [
          "revision",
          "graph"
        ],
        "type": "object"
      },
      "FlowDraftOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/FlowDraftOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "problems": {
            "items": {
              "$ref": "#/components/schemas/Problem"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "revision": {
            "format": "int32",
            "type": "integer"
          }
        },
        "required": [
          "revision",
          "problems"
        ],
        "type": "object"
      },
      "FlowFile": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/FlowFile.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "content_type": {
            "type": "string"
          },
          "file_name": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "image": {
            "type": "boolean"
          },
          "size": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "file_name",
          "content_type",
          "size",
          "image"
        ],
        "type": "object"
      },
      "FlowFilesOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/FlowFilesOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "files": {
            "items": {
              "$ref": "#/components/schemas/FlowFile"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "files"
        ],
        "type": "object"
      },
      "FlowListOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/FlowListOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "flows": {
            "items": {
              "$ref": "#/components/schemas/Flow"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "node_types": {
            "description": "The step vocabulary with each type's data schema",
            "items": {
              "$ref": "#/components/schemas/NodeType"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "templates": {
            "items": {
              "$ref": "#/components/schemas/FlowTemplate"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "flows",
          "templates",
          "node_types"
        ],
        "type": "object"
      },
      "FlowPublishOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/FlowPublishOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "problems": {
            "items": {
              "$ref": "#/components/schemas/Problem"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "version": {
            "format": "int32",
            "type": "integer"
          },
          "version_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "version",
          "version_id",
          "problems"
        ],
        "type": "object"
      },
      "FlowSimInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/FlowSimInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "channel": {
            "description": "How messages render: web chat shows choices, email and api numbered text",
            "enum": [
              "web_chat",
              "email",
              "api",
              ""
            ],
            "type": "string"
          },
          "context": {
            "additionalProperties": {},
            "description": "Values for Condition steps by field (GET /responders/fields), e.g. business_hours.open",
            "type": "object"
          },
          "graph": {
            "$ref": "#/components/schemas/Graph",
            "description": "The graph to run (the editor's current one); omitted runs the saved draft"
          },
          "input": {
            "$ref": "#/components/schemas/SimInput"
          },
          "state": {
            "$ref": "#/components/schemas/SimState",
            "description": "The state the previous step returned; omitted with input.start"
          }
        },
        "required": [
          "input"
        ],
        "type": "object"
      },
      "FlowSimOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/FlowSimOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "lines": {
            "description": "What this step added to the transcript",
            "items": {
              "$ref": "#/components/schemas/SimLine"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "node": {
            "description": "The step the simulation is at",
            "type": "string"
          },
          "problems": {
            "items": {
              "$ref": "#/components/schemas/Problem"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "state": {
            "$ref": "#/components/schemas/SimState"
          },
          "status": {
            "enum": [
              "active",
              "completed",
              "handed_off"
            ],
            "type": "string"
          },
          "waiting": {
            "enum": [
              "input",
              "timer",
              ""
            ],
            "type": "string"
          }
        },
        "required": [
          "lines",
          "state",
          "status",
          "problems"
        ],
        "type": "object"
      },
      "FlowStartInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/FlowStartInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "contact_id": {
            "description": "On web chat, a signed-in visitor (D-096)",
            "format": "int64",
            "minimum": 1,
            "type": "integer"
          },
          "inbox_id": {
            "description": "An inbox the flow is attached to",
            "format": "int64",
            "minimum": 1,
            "type": "integer"
          },
          "subject": {
            "maxLength": 300,
            "type": "string"
          }
        },
        "required": [
          "inbox_id",
          "contact_id"
        ],
        "type": "object"
      },
      "FlowStartOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/FlowStartOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "conversation_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "conversation_id"
        ],
        "type": "object"
      },
      "FlowTemplate": {
        "additionalProperties": false,
        "properties": {
          "description": {
            "type": "string"
          },
          "key": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "key",
          "name",
          "description"
        ],
        "type": "object"
      },
      "FlowUpdateInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/FlowUpdateInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "description": {
            "maxLength": 300,
            "type": "string"
          },
          "name": {
            "maxLength": 80,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "FlowVersionsOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/FlowVersionsOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "versions": {
            "items": {
              "$ref": "#/components/schemas/Version"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "versions"
        ],
        "type": "object"
      },
      "ForgotInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ForgotInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "email": {
            "format": "email",
            "maxLength": 254,
            "type": "string"
          }
        },
        "required": [
          "email"
        ],
        "type": "object"
      },
      "Frame": {
        "additionalProperties": false,
        "properties": {
          "flow_id": {
            "format": "int64",
            "type": "integer"
          },
          "node": {
            "type": "string"
          },
          "version": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "flow_id",
          "version",
          "node"
        ],
        "type": "object"
      },
      "FromStruct": {
        "additionalProperties": false,
        "properties": {
          "kind": {
            "description": "How the customer is identified",
            "enum": [
              "email",
              "phone",
              "external"
            ],
            "type": "string"
          },
          "name": {
            "description": "Used when the contact is created",
            "maxLength": 200,
            "type": "string"
          },
          "value": {
            "maxLength": 320,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "kind",
          "value"
        ],
        "type": "object"
      },
      "Gap": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/Gap.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "ai_count": {
            "format": "int64",
            "type": "integer"
          },
          "article_id": {
            "description": "The article written for it",
            "format": "int64",
            "type": "integer"
          },
          "examples": {
            "description": "Up to five ways it was asked (personal data removed)",
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "first_seen_at": {
            "format": "date-time",
            "type": "string"
          },
          "handoff_count": {
            "format": "int64",
            "type": "integer"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "last_seen_at": {
            "format": "date-time",
            "type": "string"
          },
          "locale": {
            "type": "string"
          },
          "occurrences": {
            "format": "int64",
            "type": "integer"
          },
          "question": {
            "description": "The most representative question (personal data removed)",
            "type": "string"
          },
          "search_count": {
            "format": "int64",
            "type": "integer"
          },
          "status": {
            "enum": [
              "open",
              "dismissed",
              "resolved"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "question",
          "examples",
          "occurrences",
          "search_count",
          "ai_count",
          "handoff_count",
          "status",
          "first_seen_at",
          "last_seen_at"
        ],
        "type": "object"
      },
      "Graph": {
        "additionalProperties": false,
        "properties": {
          "edges": {
            "items": {
              "$ref": "#/components/schemas/Edge"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "nodes": {
            "items": {
              "$ref": "#/components/schemas/Node"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "settings": {
            "$ref": "#/components/schemas/GraphSettings"
          },
          "variables": {
            "items": {
              "$ref": "#/components/schemas/Variable"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "nodes",
          "edges"
        ],
        "type": "object"
      },
      "GraphSettings": {
        "additionalProperties": false,
        "properties": {
          "text_hint": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "Health": {
        "additionalProperties": false,
        "properties": {
          "consecutive_failures": {
            "format": "int64",
            "type": "integer"
          },
          "delivered": {
            "description": "Delivered in the last 24 hours (latest 50 attempts)",
            "format": "int64",
            "type": "integer"
          },
          "failed": {
            "description": "Failed or retrying in the last 24 hours (latest 50 attempts)",
            "format": "int64",
            "type": "integer"
          },
          "last_delivered_at": {
            "format": "date-time",
            "type": "string"
          },
          "last_error": {
            "type": "string"
          },
          "last_error_at": {
            "format": "date-time",
            "type": "string"
          },
          "state": {
            "enum": [
              "idle",
              "healthy",
              "degraded",
              "failing"
            ],
            "type": "string"
          }
        },
        "required": [
          "state",
          "consecutive_failures",
          "delivered",
          "failed"
        ],
        "type": "object"
      },
      "HealthOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/HealthOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "status": {
            "description": "ok when the process can serve",
            "examples": [
              "ok"
            ],
            "type": "string"
          },
          "version": {
            "examples": [
              "0.1.0"
            ],
            "type": "string"
          }
        },
        "required": [
          "status",
          "version"
        ],
        "type": "object"
      },
      "HelpArticle": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/HelpArticle.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "body_html": {
            "description": "Sanitised HTML; image sources are this server's public paths",
            "type": "string"
          },
          "collection_id": {
            "format": "int64",
            "type": "integer"
          },
          "excerpt": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "locale": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "toc": {
            "items": {
              "$ref": "#/components/schemas/TOCEntry"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "url": {
            "description": "The article on the public help center",
            "type": "string"
          }
        },
        "required": [
          "id",
          "locale",
          "title",
          "excerpt",
          "body_html",
          "toc",
          "updated_at",
          "url"
        ],
        "type": "object"
      },
      "HelpArticleSummary": {
        "additionalProperties": false,
        "properties": {
          "excerpt": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "title": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "title",
          "url"
        ],
        "type": "object"
      },
      "HelpCenterInput": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/HelpCenterInput.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "default_locale": {
            "maxLength": 8,
            "minLength": 2,
            "type": "string"
          },
          "headline": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "locales": {
            "items": {
              "type": "string"
            },
            "maxItems": 13,
            "minItems": 1,
            "type": [
              "array",
              "null"
            ]
          },
          "logo_dark_url": {
            "maxLength": 2000,
            "type": "string"
          },
          "logo_url": {
            "maxLength": 2000,
            "type": "string"
          },
          "name": {
            "maxLength": 120,
            "minLength": 1,
            "type": "string"
          },
          "slug": {
            "description": "Lower-case letters, digits and dashes",
            "maxLength": 60,
            "minLength": 2,
            "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$",
            "type": "string"
          },
          "status": {
            "enum": [
              "draft",
              "active",
              "archived"
            ],
            "type": "string"
          },
          "theme": {}
        },
        "required": [
          "name",
          "slug",
          "default_locale",
          "locales"
        ],
        "type": "object"
      },
      "HelpCenterView": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/HelpCenterView.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "custom_domain": {
            "type": "string"
          },
          "default_locale": {
            "type": "string"
          },
          "dns": {
            "description": "Records to create for the custom domain",
            "items": {
              "$ref": "#/components/schemas/DNSRecord"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "domain_checked_at": {
            "format": "date-time",
            "type": "string"
          },
          "domain_error": {
            "type": "string"
          },
          "domain_status": {
            "enum": [
              "none",
              "pending",
              "verified",
              "failed"
            ],
            "type": "string"
          },
          "domain_txt_value": {
            "description": "The value of the TXT record _kommio.<domain> (public: it proves ownership only from the domain's DNS)",
            "type": "string"
          },
          "domain_verified_at": {
            "format": "date-time",
            "type": "string"
          },
          "headline": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Home page headline per locale",
            "type": "object"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "locales": {
            "description": "Enabled locales; the default is always one of them",
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "logo_dark_url": {
            "type": "string"
          },
          "logo_url": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "public_url": {
            "description": "The home page, when the help center is active",
            "type": "string"
          },
          "slug": {
            "description": "Public address: /help/<slug>/ on the app host",
            "type": "string"
          },
          "status": {
            "description": "Only an active help center is served publicly",
            "enum": [
              "draft",
              "active",
              "archived"
            ],
            "type": "string"
          },
          "theme": {
            "description": "Token overrides over the workspace branding (same keys and dark group as branding.tokens)"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "slug",
          "default_locale",
          "locales",
          "status",
          "theme",
          "headline",
          "domain_status",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "HelpCollection": {
        "additionalProperties": false,
        "properties": {
          "articles": {
            "items": {
              "$ref": "#/components/schemas/HelpArticleSummary"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "children": {
            "items": {
              "$ref": "#/components/schemas/HelpCollection"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "count": {
            "format": "int64",
            "type": "integer"
          },
          "description": {
            "type": "string"
          },
          "icon": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "count"
        ],
        "type": "object"
      },
      "HelpHome": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/HelpHome.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "collections": {
            "items": {
              "$ref": "#/components/schemas/HelpCollection"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "locale": {
            "type": "string"
          },
          "locales": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "popular": {
            "items": {
              "$ref": "#/components/schemas/HelpArticleSummary"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "url",
          "locale",
          "locales",
          "collections",
          "popular"
        ],
        "type": "object"
      },
      "HelpOKOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/HelpOKOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "ok": {
            "type": "boolean"
          }
        },
        "required": [
          "ok"
        ],
        "type": "object"
      },
      "HelpSearchOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/HelpSearchOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "hits": {
            "items": {
              "$ref": "#/components/schemas/KnowledgeHit"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "locale": {
            "type": "string"
          }
        },
        "required": [
          "locale",
          "hits"
        ],
        "type": "object"
      },
      "HelpStats": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/HelpStats.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "deflected": {
            "description": "Of those, sessions that did not start a chat",
            "format": "int64",
            "type": "integer"
          },
          "helpful": {
            "format": "int64",
            "type": "integer"
          },
          "no_result_queries": {
            "description": "Most frequent searches that found nothing",
            "items": {
              "$ref": "#/components/schemas/QueryCount"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "not_helpful": {
            "format": "int64",
            "type": "integer"
          },
          "searches": {
            "format": "int64",
            "type": "integer"
          },
          "top_articles": {
            "items": {
              "$ref": "#/components/schemas/ArticleStat"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "views": {
            "format": "int64",
            "type": "integer"
          },
          "widget_sessions": {
            "description": "Widget Help tab sessions with a search or an article view",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "views",
          "widget_sessions",
          "deflected",
          "helpful",
          "not_helpful",
          "searches",
          "no_result_queries",
          "top_articles"
        ],
        "type": "object"
      },
      "HookSpec": {
        "additionalProperties": false,
        "properties": {
          "required": {
            "description": "Fail closed: when the app does not answer, the action is blocked instead of proceeding",
            "type": "boolean"
          },
          "timeout_ms": {
            "description": "Default 3000, at most 10000",
            "format": "int64",
            "type": "integer"
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "url"
        ],
        "type": "object"
      },
      "IdentityInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/IdentityInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "kind": {
            "enum": [
              "email",
              "phone",
              "visitor",
              "external"
            ],
            "type": "string"
          },
          "value": {
            "maxLength": 320,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "kind",
          "value"
        ],
        "type": "object"
      },
      "IdentitySecretOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/IdentitySecretOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "secret": {
            "description": "The inbox's identity secret: keep it on your server",
            "type": "string"
          }
        },
        "required": [
          "secret"
        ],
        "type": "object"
      },
      "IdentityStruct": {
        "additionalProperties": false,
        "properties": {
          "attributes": {
            "description": "Flat object of string, number or boolean values: at most 30 keys of up to 40 characters, string values up to 200 characters. Requires attributes_hmac"
          },
          "attributes_hmac": {
            "description": "hex HMAC-SHA256 of id + newline + the attributes as canonical JSON (keys sorted, no spaces) with the inbox identity secret",
            "maxLength": 64,
            "minLength": 64,
            "type": "string"
          },
          "email": {
            "description": "Shown on the contact; a matching identity only when email_hmac signs it",
            "maxLength": 200,
            "type": "string"
          },
          "email_hmac": {
            "description": "hex HMAC-SHA256 of id + newline + email (lower-cased, trimmed) with the inbox identity secret",
            "maxLength": 64,
            "minLength": 64,
            "type": "string"
          },
          "hmac": {
            "description": "hex HMAC-SHA256 of id with the inbox identity secret",
            "maxLength": 64,
            "minLength": 64,
            "type": "string"
          },
          "id": {
            "maxLength": 200,
            "minLength": 1,
            "type": "string"
          },
          "name": {
            "maxLength": 120,
            "type": "string"
          }
        },
        "required": [
          "id",
          "hmac"
        ],
        "type": "object"
      },
      "ImpactGroup": {
        "additionalProperties": false,
        "properties": {
          "count": {
            "format": "int64",
            "type": "integer"
          },
          "effect": {
            "enum": [
              "pause",
              "stop",
              "keep",
              "narrow",
              "informational"
            ],
            "type": "string"
          },
          "hidden": {
            "type": "boolean"
          },
          "items": {
            "description": "At most 50",
            "items": {
              "$ref": "#/components/schemas/ImpactItem"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "count",
          "items",
          "effect"
        ],
        "type": "object"
      },
      "ImpactItem": {
        "additionalProperties": false,
        "properties": {
          "detail": {
            "description": "A trigger, a host, a key prefix or a channel",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "last_used_at": {
            "format": "date-time",
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ],
        "type": "object"
      },
      "ImportConnection": {
        "additionalProperties": false,
        "properties": {
          "account_id": {
            "description": "The Chatwoot account",
            "format": "int64",
            "type": "integer"
          },
          "account_name": {
            "type": "string"
          },
          "base_url": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "token_hint": {
            "description": "The token's last four characters",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "base_url",
          "account_id",
          "account_name",
          "token_hint",
          "updated_at"
        ],
        "type": "object"
      },
      "ImportCounts": {
        "additionalProperties": false,
        "properties": {
          "created": {
            "format": "int64",
            "type": "integer"
          },
          "errors": {
            "format": "int64",
            "type": "integer"
          },
          "skipped": {
            "format": "int64",
            "type": "integer"
          },
          "updated": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "created",
          "updated",
          "skipped",
          "errors"
        ],
        "type": "object"
      },
      "ImportJob": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ImportJob.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "cancel_requested": {
            "type": "boolean"
          },
          "counts": {
            "additionalProperties": {
              "additionalProperties": {
                "format": "int64",
                "type": "integer"
              },
              "type": "object"
            },
            "description": "Per entity: source, created, updated, unchanged, matched, skipped, failed, deleted, overwritten, and skipped_silent when contacts were left out as silent",
            "type": "object"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "error": {
            "type": "string"
          },
          "finished_at": {
            "format": "date-time",
            "type": "string"
          },
          "heartbeat_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "enum": [
              "dry_run",
              "full",
              "delta"
            ],
            "type": "string"
          },
          "options": {
            "$ref": "#/components/schemas/JobOptions"
          },
          "report": {
            "$ref": "#/components/schemas/RunReport",
            "description": "The report, once the job ended (and the partial one of a dry run)"
          },
          "run_id": {
            "description": "The import's history entry (not for dry runs)",
            "format": "int64",
            "type": "integer"
          },
          "stalled": {
            "description": "Running, but no progress was recorded for two minutes",
            "type": "boolean"
          },
          "started_at": {
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "enum": [
              "queued",
              "running",
              "succeeded",
              "failed",
              "cancelled",
              "interrupted"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "kind",
          "status",
          "stalled",
          "options",
          "counts",
          "cancel_requested",
          "created_at"
        ],
        "type": "object"
      },
      "ImportListOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ImportListOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "runs": {
            "items": {
              "$ref": "#/components/schemas/ImportRun"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "runs"
        ],
        "type": "object"
      },
      "ImportOptions": {
        "additionalProperties": false,
        "properties": {
          "dedupe_by": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "tag_ids": {
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "update_existing": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "ImportOutcome": {
        "additionalProperties": false,
        "properties": {
          "action": {
            "enum": [
              "created",
              "updated",
              "skipped",
              "error"
            ],
            "type": "string"
          },
          "contact_id": {
            "format": "int64",
            "type": "integer"
          },
          "error": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "row": {
            "description": "Line in the file (the header is line 1)",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "row",
          "action"
        ],
        "type": "object"
      },
      "ImportRun": {
        "additionalProperties": false,
        "properties": {
          "counts": {
            "additionalProperties": {
              "additionalProperties": {
                "format": "int64",
                "type": "integer"
              },
              "type": "object"
            },
            "description": "Per entity: source, created, updated, unchanged, matched, skipped, failed",
            "type": "object"
          },
          "error": {
            "type": "string"
          },
          "finished_at": {
            "format": "date-time",
            "type": "string"
          },
          "heartbeat_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "mode": {
            "enum": [
              "full",
              "delta"
            ],
            "type": "string"
          },
          "since": {
            "description": "Delta runs: changes since this time",
            "format": "date-time",
            "type": "string"
          },
          "source": {
            "description": "chatwoot",
            "type": "string"
          },
          "source_account": {
            "description": "The account id in the source system",
            "type": "string"
          },
          "source_label": {
            "description": "The kind of source: the Chatwoot database, or Chatwoot's API with its address",
            "type": "string"
          },
          "stalled": {
            "description": "Running, but no progress was recorded for two minutes",
            "type": "boolean"
          },
          "started_at": {
            "format": "date-time",
            "type": "string"
          },
          "started_by": {
            "type": "string"
          },
          "status": {
            "enum": [
              "running",
              "succeeded",
              "failed",
              "interrupted"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "source",
          "source_account",
          "mode",
          "status",
          "stalled",
          "counts",
          "started_at",
          "heartbeat_at"
        ],
        "type": "object"
      },
      "ImportRunDetail": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ImportRunDetail.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "counts": {
            "additionalProperties": {
              "additionalProperties": {
                "format": "int64",
                "type": "integer"
              },
              "type": "object"
            },
            "description": "Per entity: source, created, updated, unchanged, matched, skipped, failed",
            "type": "object"
          },
          "error": {
            "type": "string"
          },
          "finished_at": {
            "format": "date-time",
            "type": "string"
          },
          "heartbeat_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "mode": {
            "enum": [
              "full",
              "delta"
            ],
            "type": "string"
          },
          "report": {
            "$ref": "#/components/schemas/RunReport",
            "description": "Everything the run could not map, the attachments it could not copy and notes; absent while running"
          },
          "since": {
            "description": "Delta runs: changes since this time",
            "format": "date-time",
            "type": "string"
          },
          "source": {
            "description": "chatwoot",
            "type": "string"
          },
          "source_account": {
            "description": "The account id in the source system",
            "type": "string"
          },
          "source_label": {
            "description": "The kind of source: the Chatwoot database, or Chatwoot's API with its address",
            "type": "string"
          },
          "stalled": {
            "description": "Running, but no progress was recorded for two minutes",
            "type": "boolean"
          },
          "started_at": {
            "format": "date-time",
            "type": "string"
          },
          "started_by": {
            "type": "string"
          },
          "status": {
            "enum": [
              "running",
              "succeeded",
              "failed",
              "interrupted"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "source",
          "source_account",
          "mode",
          "status",
          "stalled",
          "counts",
          "started_at",
          "heartbeat_at"
        ],
        "type": "object"
      },
      "Inbox": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/Inbox.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "agent_identity_mode": {
            "type": "string"
          },
          "assignment": {
            "$ref": "#/components/schemas/InboxSettings",
            "description": "Assignment of the inbox's conversations without a team among its members (off until saved)"
          },
          "bot_id": {
            "description": "The first external agent bot of the inbox's bots and flows (GET /inboxes/{id}/responders has the whole order)",
            "format": "int64",
            "type": "integer"
          },
          "business_hours": {
            "description": "Schedule override {timezone, weekly}; absent uses the account schedule"
          },
          "capabilities": {
            "$ref": "#/components/schemas/Capabilities",
            "description": "What the inbox's channel can carry; the composer explains anything missing"
          },
          "channel_kind": {
            "type": "string"
          },
          "config": {
            "description": "Present for inboxes:manage only"
          },
          "csat": {
            "$ref": "#/components/schemas/Settings",
            "description": "Satisfaction survey offered when a conversation is resolved (the channel's defaults until saved: on for web chat, off otherwise)"
          },
          "greeting": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "last_sync_error": {
            "description": "Pull channels, inboxes:manage: why the last sync failed",
            "type": "string"
          },
          "last_synced_at": {
            "description": "Pull channels (email), inboxes:manage: when the last sync finished",
            "format": "date-time",
            "type": "string"
          },
          "member_ids": {
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "oauth": {
            "$ref": "#/components/schemas/InboxOAuth",
            "description": "Email inboxes connected with Microsoft 365 or Google sign-in (inboxes:manage): the signed-in account and whether it needs a new sign-in"
          },
          "public_key": {
            "description": "Addresses the inbox on public surfaces such as the widget loader",
            "type": "string"
          },
          "reconnect_to": {
            "description": "An imported history inbox of a channel Kommio now has (telegram): POST /inboxes/{id}/reconnect connects it",
            "type": "string"
          },
          "secrets_set": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "status": {
            "type": "string"
          },
          "status_message": {
            "type": "string"
          },
          "watch": {
            "$ref": "#/components/schemas/InboxWatch",
            "description": "Email, inboxes:manage: what the push-hint (IMAP IDLE) watcher is doing; while live the poll is only a ten-minute safety net (D-214)"
          },
          "widget_last_seen_at": {
            "description": "Web chat: when the widget was last loaded on a website",
            "format": "date-time",
            "type": "string"
          },
          "widget_last_seen_origin": {
            "description": "Web chat: the last website the widget was loaded on",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "channel_kind",
          "status",
          "agent_identity_mode",
          "public_key",
          "capabilities",
          "csat",
          "assignment",
          "member_ids"
        ],
        "type": "object"
      },
      "InboxAccess": {
        "additionalProperties": false,
        "properties": {
          "inbox_id": {
            "format": "int64",
            "type": "integer"
          },
          "reach": {
            "description": "all: every conversation; unassigned: the unassigned ones and their own; team: their teams' and their own; assigned: only their own; none",
            "enum": [
              "all",
              "unassigned",
              "team",
              "assigned",
              "none"
            ],
            "type": "string"
          }
        },
        "required": [
          "inbox_id",
          "reach"
        ],
        "type": "object"
      },
      "InboxCreateInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/InboxCreateInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "agent_identity_mode": {
            "default": "name",
            "enum": [
              "name",
              "display_name",
              "team"
            ],
            "type": "string"
          },
          "channel_kind": {
            "maxLength": 40,
            "minLength": 1,
            "type": "string"
          },
          "config": {
            "description": "Channel configuration including secret fields; secrets are stored encrypted"
          },
          "greeting": {
            "maxLength": 500,
            "type": "string"
          },
          "name": {
            "maxLength": 80,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "name",
          "channel_kind"
        ],
        "type": "object"
      },
      "InboxHealth": {
        "additionalProperties": false,
        "properties": {
          "channel_kind": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "last_sync_error": {
            "type": "string"
          },
          "last_synced_at": {
            "format": "date-time",
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "open_count": {
            "format": "int64",
            "type": "integer"
          },
          "status": {
            "type": "string"
          },
          "status_message": {
            "type": "string"
          },
          "watch": {
            "$ref": "#/components/schemas/InboxWatch"
          }
        },
        "required": [
          "id",
          "name",
          "channel_kind",
          "status",
          "open_count"
        ],
        "type": "object"
      },
      "InboxListOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/InboxListOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "inboxes": {
            "items": {
              "$ref": "#/components/schemas/Inbox"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "inboxes"
        ],
        "type": "object"
      },
      "InboxMembersInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/InboxMembersInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "user_ids": {
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "maxItems": 500,
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "user_ids"
        ],
        "type": "object"
      },
      "InboxOAuth": {
        "additionalProperties": false,
        "properties": {
          "account_email": {
            "type": "string"
          },
          "connection_id": {
            "format": "int64",
            "type": "integer"
          },
          "last_auth_error": {
            "description": "The last IMAP or SMTP refusal of the token",
            "type": "string"
          },
          "provider": {
            "enum": [
              "microsoft",
              "google"
            ],
            "type": "string"
          },
          "status": {
            "description": "needs_sign_in: imported (from Chatwoot) and not signed in yet; needs_reconnect: the provider refused the sign-in, Reauthorise",
            "enum": [
              "active",
              "needs_reconnect",
              "needs_sign_in"
            ],
            "type": "string"
          },
          "status_reason": {
            "type": "string"
          }
        },
        "required": [
          "provider",
          "status"
        ],
        "type": "object"
      },
      "InboxReconnectInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/InboxReconnectInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "channel_kind": {
            "maxLength": 40,
            "minLength": 1,
            "type": "string"
          },
          "config": {
            "description": "Channel configuration including secret fields"
          }
        },
        "required": [
          "channel_kind"
        ],
        "type": "object"
      },
      "InboxSettings": {
        "additionalProperties": false,
        "properties": {
          "assign_outside_hours": {
            "description": "Also assign when the inbox's business hours are closed",
            "type": "boolean"
          },
          "auto_assign": {
            "description": "Assign new conversations without a team among the inbox's online members",
            "type": "boolean"
          },
          "capacity_per_agent": {
            "description": "Open conversations an agent may hold before being skipped; 0 = unlimited; a member's own capacity wins",
            "format": "int32",
            "maximum": 1000,
            "minimum": 0,
            "type": "integer"
          },
          "reassign_after_minutes": {
            "description": "Minutes offline before their conversations move",
            "format": "int32",
            "maximum": 1440,
            "minimum": 1,
            "type": "integer"
          },
          "reassign_offline": {
            "description": "When an assignee goes offline, their open conversations waiting for a reply are kept (off), returned to the queue (queue) or given to someone online (reassign)",
            "enum": [
              "off",
              "queue",
              "reassign"
            ],
            "type": "string"
          },
          "required_skills": {
            "description": "Skills every conversation of the inbox needs; only members holding all of them are picked",
            "items": {
              "type": "string"
            },
            "maxItems": 20,
            "type": [
              "array",
              "null"
            ]
          },
          "routing": {
            "description": "round_robin: the member after the last one given a conversation; balanced: the member with the lowest open load against their capacity",
            "enum": [
              "round_robin",
              "balanced"
            ],
            "type": "string"
          }
        },
        "required": [
          "auto_assign",
          "routing",
          "capacity_per_agent",
          "assign_outside_hours",
          "required_skills",
          "reassign_offline",
          "reassign_after_minutes"
        ],
        "type": "object"
      },
      "InboxUpdateInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/InboxUpdateInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "agent_identity_mode": {
            "description": "Omitted keeps the current mode",
            "enum": [
              "name",
              "display_name",
              "team"
            ],
            "type": "string"
          },
          "assignment": {
            "description": "Assignment by inbox {auto_assign, routing, capacity_per_agent, assign_outside_hours, required_skills, reassign_offline, reassign_after_minutes}; null turns it off, omitted keeps"
          },
          "bot_id": {
            "description": "Compatibility: puts this agent bot first in the inbox's bots and flows; 0 removes the external bots from the list; omitted keeps. PUT /inboxes/{id}/responders sets the whole order",
            "format": "int64",
            "type": "integer"
          },
          "business_hours": {
            "description": "Schedule override {timezone, weekly}; null clears, omitted keeps"
          },
          "config": {
            "description": "Omit a secret field to keep its stored value"
          },
          "csat": {
            "description": "Satisfaction survey {enabled, question, scale, comment}; null restores the channel's defaults, omitted keeps"
          },
          "greeting": {
            "description": "Omitted keeps the current greeting; an empty string clears it",
            "maxLength": 500,
            "type": "string"
          },
          "name": {
            "maxLength": 80,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "InboxWatch": {
        "additionalProperties": false,
        "properties": {
          "error": {
            "description": "The error the connection ended with, while down",
            "type": "string"
          },
          "last_hint_at": {
            "description": "The last change the mailbox reported",
            "format": "date-time",
            "type": "string"
          },
          "since": {
            "description": "When the state was entered",
            "format": "date-time",
            "type": "string"
          },
          "state": {
            "description": "live: the connection holds and hints bring syncs forward; down: it ended with an error and reconnects with a backoff; unsupported: the server has no IDLE; stopped: the worker let the inbox go",
            "enum": [
              "connecting",
              "live",
              "down",
              "unsupported",
              "stopped"
            ],
            "type": "string"
          },
          "updated_at": {
            "description": "The worker's last write (its heartbeat while live)",
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "state",
          "since",
          "updated_at"
        ],
        "type": "object"
      },
      "IndexStatus": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/IndexStatus.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "by_source": {
            "items": {
              "$ref": "#/components/schemas/KindStat"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "dims": {
            "format": "int64",
            "type": "integer"
          },
          "embedded": {
            "description": "Passages with a current vector",
            "format": "int64",
            "type": "integer"
          },
          "index": {
            "description": "provider:model[@dimensions] of the vectors being built",
            "type": "string"
          },
          "last_embed_at": {
            "format": "date-time",
            "type": "string"
          },
          "last_error": {
            "type": "string"
          },
          "last_error_at": {
            "format": "date-time",
            "type": "string"
          },
          "mode": {
            "description": "hybrid when vectors are available and the workspace has an embeddings provider and key; keyword otherwise",
            "enum": [
              "hybrid",
              "keyword"
            ],
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "passages": {
            "description": "Passages the AI may read",
            "format": "int64",
            "type": "integer"
          },
          "passages_built_at": {
            "format": "date-time",
            "type": "string"
          },
          "provider": {
            "type": "string"
          },
          "reindex_pending": {
            "type": "boolean"
          },
          "vectors_available": {
            "description": "The database has pgvector",
            "type": "boolean"
          }
        },
        "required": [
          "mode",
          "vectors_available",
          "provider",
          "passages",
          "embedded",
          "by_source",
          "reindex_pending"
        ],
        "type": "object"
      },
      "InstallInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/InstallInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "approved_scopes": {
            "description": "The entry's scopes, approved; every one is needed",
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "config": {
            "additionalProperties": {},
            "description": "Settings from the entry's form; secret ones are sealed and never returned",
            "type": "object"
          },
          "create_attributes": {
            "type": "boolean"
          },
          "inbox_ids": {
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "maxItems": 200,
            "type": [
              "array",
              "null"
            ]
          },
          "name": {
            "maxLength": 120,
            "type": "string"
          },
          "request_id": {
            "description": "The member request this install fulfils",
            "format": "int64",
            "type": "integer"
          },
          "slug": {
            "maxLength": 100,
            "minLength": 1,
            "type": "string"
          },
          "team_ids": {
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "maxItems": 200,
            "type": [
              "array",
              "null"
            ]
          },
          "version": {
            "description": "Default: the newest version",
            "maxLength": 40,
            "type": "string"
          }
        },
        "required": [
          "slug",
          "approved_scopes"
        ],
        "type": "object"
      },
      "InstallationConfigInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/InstallationConfigInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "config": {
            "additionalProperties": {},
            "description": "Changed settings; a secret left empty keeps the stored one",
            "type": "object"
          },
          "inbox_ids": {
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "maxItems": 200,
            "type": [
              "array",
              "null"
            ]
          },
          "team_ids": {
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "maxItems": 200,
            "type": [
              "array",
              "null"
            ]
          }
        },
        "type": "object"
      },
      "InstallationHealth": {
        "additionalProperties": false,
        "properties": {
          "error_count": {
            "description": "Failures in a row since the last success or resume",
            "format": "int64",
            "type": "integer"
          },
          "last_error": {
            "type": "string"
          },
          "last_error_at": {
            "format": "date-time",
            "type": "string"
          },
          "last_success_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "error_count"
        ],
        "type": "object"
      },
      "InstallationImpact": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/InstallationImpact.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "ai_tool": {
            "type": "boolean"
          },
          "attributes": {
            "$ref": "#/components/schemas/ImpactGroup"
          },
          "confirm": {
            "type": "string"
          },
          "confirm_required": {
            "description": "Something depends on it: type its name to confirm",
            "type": "boolean"
          },
          "conversations": {
            "$ref": "#/components/schemas/ImpactGroup"
          },
          "hooks": {
            "$ref": "#/components/schemas/ImpactGroup"
          },
          "inboxes": {
            "$ref": "#/components/schemas/ImpactGroup"
          },
          "installation_id": {
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "panels": {
            "$ref": "#/components/schemas/ImpactGroup"
          },
          "rules": {
            "$ref": "#/components/schemas/ImpactGroup"
          }
        },
        "required": [
          "installation_id",
          "name",
          "confirm",
          "confirm_required",
          "rules",
          "inboxes",
          "conversations",
          "hooks",
          "panels",
          "attributes",
          "ai_tool"
        ],
        "type": "object"
      },
      "InstallationReconnectInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/InstallationReconnectInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "secrets": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "New values of the secret settings",
            "type": "object"
          }
        },
        "required": [
          "secrets"
        ],
        "type": "object"
      },
      "InstallationUpdateInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/InstallationUpdateInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "approve_scopes": {
            "description": "Approve the scopes the new version adds (you must hold them); without it such an update waits for approval",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "InstallationView": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/InstallationView.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "config": {
            "additionalProperties": {},
            "type": "object"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "created_by_name": {
            "type": "string"
          },
          "entry_name": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "entry_slug": {
            "type": "string"
          },
          "entry_version": {
            "type": "string"
          },
          "granted_scopes": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "health": {
            "$ref": "#/components/schemas/InstallationHealth"
          },
          "icon": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "inbox_ids": {
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "kind": {
            "type": "string"
          },
          "manage_path": {
            "description": "The page of the machinery underneath, when it has one",
            "type": "string"
          },
          "managed": {
            "description": "Configured, reconnected and updated from the catalog",
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "pending_scopes": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "pending_version": {
            "description": "An update waiting for an administrator to approve its new scopes",
            "type": "string"
          },
          "private": {
            "type": "boolean"
          },
          "ref_id": {
            "format": "int64",
            "type": "integer"
          },
          "ref_kind": {
            "enum": [
              "app",
              "connector",
              "bot",
              "inbox",
              ""
            ],
            "type": "string"
          },
          "secrets_set": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "source": {
            "description": "Where the installed version came from: bundled with Kommio, the online feed, or the workspace's own app",
            "enum": [
              "builtin",
              "feed",
              "private"
            ],
            "type": "string"
          },
          "status": {
            "enum": [
              "active",
              "paused",
              "needs_reconnect",
              "error",
              "uninstalled"
            ],
            "type": "string"
          },
          "status_reason": {
            "type": "string"
          },
          "team_ids": {
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "uninstalled_at": {
            "format": "date-time",
            "type": "string"
          },
          "update_available": {
            "description": "A newer version of the entry",
            "type": "string"
          },
          "update_scopes": {
            "description": "Scopes the newer version adds",
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "entry_slug",
          "entry_version",
          "entry_name",
          "icon",
          "kind",
          "name",
          "private",
          "source",
          "status",
          "config",
          "secrets_set",
          "granted_scopes",
          "inbox_ids",
          "team_ids",
          "managed",
          "pending_scopes",
          "update_scopes",
          "health",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "InstallationsOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/InstallationsOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "installations": {
            "items": {
              "$ref": "#/components/schemas/InstallationView"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "modules": {
            "items": {
              "$ref": "#/components/schemas/CoreModuleView"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "installations",
          "modules"
        ],
        "type": "object"
      },
      "Invitation": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/Invitation.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "expires_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "role_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "email",
          "role_id",
          "expires_at"
        ],
        "type": "object"
      },
      "InvitationLookupOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/InvitationLookupOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "user_exists": {
            "description": "When true only the token is needed to accept; otherwise name and password too",
            "type": "boolean"
          },
          "workspace_name": {
            "type": "string"
          }
        },
        "required": [
          "email",
          "workspace_name",
          "user_exists"
        ],
        "type": "object"
      },
      "InviteInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/InviteInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "email": {
            "format": "email",
            "maxLength": 254,
            "type": "string"
          },
          "role_id": {
            "format": "int64",
            "minimum": 1,
            "type": "integer"
          }
        },
        "required": [
          "email",
          "role_id"
        ],
        "type": "object"
      },
      "InvitesOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/InvitesOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "invitations": {
            "items": {
              "$ref": "#/components/schemas/Invitation"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "invitations"
        ],
        "type": "object"
      },
      "Item": {
        "additionalProperties": false,
        "properties": {
          "count": {
            "format": "int64",
            "maximum": 100,
            "minimum": 1,
            "type": "integer"
          },
          "feature": {
            "description": "A client key of the feature registry (contracts/features.yml)",
            "maxLength": 80,
            "type": "string"
          }
        },
        "required": [
          "feature",
          "count"
        ],
        "type": "object"
      },
      "Item1": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "last_activity_at": {
            "format": "date-time",
            "type": "string"
          },
          "last_message": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "status",
          "last_message",
          "last_activity_at"
        ],
        "type": "object"
      },
      "JSError": {
        "additionalProperties": false,
        "properties": {
          "at": {
            "format": "date-time",
            "type": "string"
          },
          "column": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "line": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "message": {
            "maxLength": 500,
            "type": "string"
          },
          "source": {
            "description": "Script URL without its query string",
            "maxLength": 2000,
            "type": "string"
          },
          "stack": {
            "description": "At most 5 lines",
            "maxLength": 2000,
            "type": "string"
          }
        },
        "required": [
          "message",
          "at"
        ],
        "type": "object"
      },
      "JobOptions": {
        "additionalProperties": false,
        "properties": {
          "allow_mass_delete": {
            "type": "boolean"
          },
          "allow_overwrite_kommio_work": {
            "type": "boolean"
          },
          "include_help_center": {
            "type": "boolean"
          },
          "include_silent_contacts": {
            "type": "boolean"
          },
          "only_new": {
            "type": "boolean"
          },
          "publish_articles": {
            "type": "boolean"
          },
          "skip_silent_contacts": {
            "type": "boolean"
          },
          "with_channel_secrets": {
            "type": "boolean"
          }
        },
        "required": [
          "include_help_center",
          "publish_articles",
          "with_channel_secrets"
        ],
        "type": "object"
      },
      "KbArticleView": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/KbArticleView.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "author_id": {
            "format": "int64",
            "type": "integer"
          },
          "author_name": {
            "type": "string"
          },
          "collection_id": {
            "format": "int64",
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "draft_changes": {
            "type": "boolean"
          },
          "help_center_id": {
            "format": "int64",
            "type": "integer"
          },
          "helpful": {
            "format": "int64",
            "type": "integer"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "locales": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "not_helpful": {
            "format": "int64",
            "type": "integer"
          },
          "position": {
            "format": "int64",
            "type": "integer"
          },
          "public_url": {
            "description": "Where the live article can be read, for a live public article of an active help center",
            "type": "string"
          },
          "published_at": {
            "format": "date-time",
            "type": "string"
          },
          "published_locales": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "published_version": {
            "description": "The live snapshot",
            "format": "int64",
            "type": "integer"
          },
          "source_kind": {
            "description": "manual, or conversation for a draft made from a conversation",
            "type": "string"
          },
          "source_ref": {},
          "status": {
            "enum": [
              "draft",
              "published",
              "archived"
            ],
            "type": "string"
          },
          "translations": {
            "items": {
              "$ref": "#/components/schemas/ArticleTranslation"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "updated_by": {
            "format": "int64",
            "type": "integer"
          },
          "updated_by_name": {
            "type": "string"
          },
          "views_30d": {
            "format": "int64",
            "type": "integer"
          },
          "visibility": {
            "enum": [
              "public",
              "internal",
              "ai_only"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "help_center_id",
          "status",
          "visibility",
          "position",
          "source_kind",
          "created_at",
          "updated_at",
          "locales",
          "published_locales",
          "draft_changes",
          "views_30d",
          "helpful",
          "not_helpful"
        ],
        "type": "object"
      },
      "KbArticlesOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/KbArticlesOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "articles": {
            "items": {
              "$ref": "#/components/schemas/Article"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "has_more": {
            "type": "boolean"
          }
        },
        "required": [
          "articles",
          "has_more"
        ],
        "type": "object"
      },
      "KbCentersOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/KbCentersOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "help_centers": {
            "items": {
              "$ref": "#/components/schemas/HelpCenterView"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "help_centers"
        ],
        "type": "object"
      },
      "KbCollectionsOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/KbCollectionsOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "collections": {
            "items": {
              "$ref": "#/components/schemas/ArticleCollection"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "collections"
        ],
        "type": "object"
      },
      "KbDomainInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/KbDomainInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "domain": {
            "description": "help.example.com; empty removes the custom domain",
            "maxLength": 253,
            "type": "string"
          }
        },
        "required": [
          "domain"
        ],
        "type": "object"
      },
      "KbDraftInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/KbDraftInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "collection_id": {
            "format": "int64",
            "type": "integer"
          },
          "help_center_id": {
            "description": "Defaults to the workspace's first help center",
            "format": "int64",
            "type": "integer"
          },
          "visibility": {
            "enum": [
              "public",
              "internal",
              "ai_only"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "KbGapArticleInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/KbGapArticleInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "help_center_id": {
            "description": "Defaults to the workspace's first help center",
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "KbGapsOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/KbGapsOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "gaps": {
            "items": {
              "$ref": "#/components/schemas/Gap"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "has_more": {
            "type": "boolean"
          }
        },
        "required": [
          "gaps",
          "has_more"
        ],
        "type": "object"
      },
      "KbLearningInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/KbLearningInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "inbox_ids": {
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "maxItems": 200,
            "type": [
              "array",
              "null"
            ]
          },
          "order_patterns": {
            "items": {
              "type": "string"
            },
            "maxItems": 20,
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "enabled",
          "inbox_ids"
        ],
        "type": "object"
      },
      "KbOrderInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/KbOrderInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "items": {
            "description": "Every collection, top to bottom, each with its parent (none for the top level)",
            "items": {
              "$ref": "#/components/schemas/CollectionOrderItem"
            },
            "maxItems": 500,
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "items"
        ],
        "type": "object"
      },
      "KbRetrieveInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/KbRetrieveInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "audience": {
            "description": "Default ai; ai_customer is the AI agent talking to a customer (no internal content)",
            "enum": [
              "public",
              "agent",
              "ai",
              "ai_customer"
            ],
            "type": "string"
          },
          "help_center_id": {
            "format": "int64",
            "type": "integer"
          },
          "limit": {
            "format": "int64",
            "maximum": 50,
            "minimum": 0,
            "type": "integer"
          },
          "locale": {
            "maxLength": 8,
            "type": "string"
          },
          "query": {
            "maxLength": 500,
            "minLength": 2,
            "type": "string"
          }
        },
        "required": [
          "query"
        ],
        "type": "object"
      },
      "KbRetrieveOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/KbRetrieveOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "mode": {
            "enum": [
              "hybrid",
              "keyword"
            ],
            "type": "string"
          },
          "passages": {
            "items": {
              "$ref": "#/components/schemas/Passage"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "mode",
          "passages"
        ],
        "type": "object"
      },
      "KbSearchOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/KbSearchOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "hits": {
            "items": {
              "$ref": "#/components/schemas/KnowledgeHit"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "hits"
        ],
        "type": "object"
      },
      "KbSnippetsOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/KbSnippetsOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "has_more": {
            "type": "boolean"
          },
          "snippets": {
            "items": {
              "$ref": "#/components/schemas/Snippet"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "snippets",
          "has_more"
        ],
        "type": "object"
      },
      "KbSourcePageInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/KbSourcePageInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "excluded": {
            "description": "Leave the page out of what the AI reads (kept on re-sync)",
            "type": "boolean"
          }
        },
        "required": [
          "excluded"
        ],
        "type": "object"
      },
      "KbSourcePagesOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/KbSourcePagesOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "has_more": {
            "type": "boolean"
          },
          "pages": {
            "items": {
              "$ref": "#/components/schemas/SourcePage"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "pages",
          "has_more"
        ],
        "type": "object"
      },
      "KbSourcesOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/KbSourcesOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "sources": {
            "items": {
              "$ref": "#/components/schemas/Source"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "sources"
        ],
        "type": "object"
      },
      "KbSuggestionsOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/KbSuggestionsOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "has_more": {
            "type": "boolean"
          },
          "pending": {
            "description": "Suggestions waiting for review",
            "format": "int64",
            "type": "integer"
          },
          "suggestions": {
            "items": {
              "$ref": "#/components/schemas/Suggestion"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "suggestions",
          "has_more",
          "pending"
        ],
        "type": "object"
      },
      "KbVerifyOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/KbVerifyOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "help_center": {
            "$ref": "#/components/schemas/HelpCenterView"
          },
          "result": {
            "$ref": "#/components/schemas/DomainCheck"
          }
        },
        "required": [
          "help_center",
          "result"
        ],
        "type": "object"
      },
      "KbVersionOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/KbVersionOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "translations": {
            "items": {
              "$ref": "#/components/schemas/ArticleTranslation"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "version": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "version",
          "translations"
        ],
        "type": "object"
      },
      "KbVersionsOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/KbVersionsOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "versions": {
            "items": {
              "$ref": "#/components/schemas/ArticleVersion"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "versions"
        ],
        "type": "object"
      },
      "KeysStruct": {
        "additionalProperties": false,
        "properties": {
          "auth": {
            "maxLength": 100,
            "minLength": 1,
            "type": "string"
          },
          "p256dh": {
            "maxLength": 200,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "p256dh",
          "auth"
        ],
        "type": "object"
      },
      "KindStat": {
        "additionalProperties": false,
        "properties": {
          "embedded": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "enum": [
              "article",
              "snippet",
              "website",
              "file"
            ],
            "type": "string"
          },
          "passages": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "kind",
          "passages",
          "embedded"
        ],
        "type": "object"
      },
      "KnowledgeHit": {
        "additionalProperties": false,
        "properties": {
          "collection_id": {
            "format": "int64",
            "type": "integer"
          },
          "help_center_id": {
            "format": "int64",
            "type": "integer"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "enum": [
              "article",
              "snippet",
              "source"
            ],
            "type": "string"
          },
          "locale": {
            "type": "string"
          },
          "rank": {
            "format": "double",
            "type": "number"
          },
          "slug": {
            "type": "string"
          },
          "snippet": {
            "description": "HTML-escaped text with <mark> around matches",
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "visibility": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "locale",
          "slug",
          "title",
          "snippet",
          "rank"
        ],
        "type": "object"
      },
      "KommioWork": {
        "additionalProperties": false,
        "properties": {
          "conversations": {
            "description": "Conversations created in Kommio since then",
            "format": "int64",
            "type": "integer"
          },
          "messages": {
            "description": "Messages (replies, notes) written in Kommio since then",
            "format": "int64",
            "type": "integer"
          },
          "since": {
            "description": "The last run's watermark",
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "since",
          "conversations",
          "messages"
        ],
        "type": "object"
      },
      "LearningSettings": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/LearningSettings.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "ai_ready": {
            "description": "AI is on with a key: learning can run",
            "type": "boolean"
          },
          "enabled": {
            "type": "boolean"
          },
          "enabled_at": {
            "description": "Conversations resolved before this are not read",
            "format": "date-time",
            "type": "string"
          },
          "inbox_ids": {
            "description": "Only resolved conversations of these inboxes are read",
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "order_patterns": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "ai_ready",
          "enabled",
          "inbox_ids"
        ],
        "type": "object"
      },
      "Live": {
        "additionalProperties": false,
        "properties": {
          "agents_online": {
            "format": "int64",
            "type": "integer"
          },
          "open": {
            "format": "int64",
            "type": "integer"
          },
          "unassigned": {
            "format": "int64",
            "type": "integer"
          },
          "waiting_over_1h": {
            "description": "Open with a customer message unanswered for more than an hour",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "open",
          "unassigned",
          "waiting_over_1h",
          "agents_online"
        ],
        "type": "object"
      },
      "LocaleInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/LocaleInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "locale": {
            "description": "One of the 13 app languages (en, pt-BR, es, fr, de, it, nl, pl, tr, id, ja, ko, zh-CN), or null to follow the browser",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "locale"
        ],
        "type": "object"
      },
      "LocaleOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/LocaleOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "locale": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "locale"
        ],
        "type": "object"
      },
      "LoginInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/LoginInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "email": {
            "format": "email",
            "maxLength": 254,
            "type": "string"
          },
          "password": {
            "maxLength": 1024,
            "minLength": 1,
            "type": "string"
          },
          "sso_link": {
            "description": "The sso_link a workspace provider's sign-in returned with: signing in with the password links that provider, so it signs the person in from then on",
            "maxLength": 2000,
            "type": "string"
          }
        },
        "required": [
          "email",
          "password"
        ],
        "type": "object"
      },
      "LoginOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/LoginOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "challenge": {
            "description": "Present when MFA is required; send it to /auth/mfa/verify",
            "type": "string"
          },
          "mfa_required": {
            "type": "boolean"
          },
          "user_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "mfa_required"
        ],
        "type": "object"
      },
      "MFAStanding": {
        "additionalProperties": false,
        "properties": {
          "blocked": {
            "description": "Past the deadline without two-factor: only /auth/* works until they set it up",
            "type": "boolean"
          },
          "deadline": {
            "description": "When the person must have two-factor on; absent when they have it",
            "format": "date-time",
            "type": "string"
          },
          "grace_days": {
            "format": "int64",
            "type": "integer"
          },
          "required": {
            "description": "The workspace requires two-factor",
            "type": "boolean"
          }
        },
        "required": [
          "required",
          "grace_days",
          "blocked"
        ],
        "type": "object"
      },
      "Macro": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/Macro.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "actions": {
            "items": {
              "$ref": "#/components/schemas/Action"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "position": {
            "format": "int32",
            "type": "integer"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "actions",
          "position",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "MacroApplyOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/MacroApplyOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "actions": {
            "items": {
              "$ref": "#/components/schemas/Outcome"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "actions"
        ],
        "type": "object"
      },
      "MacroBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/MacroBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "actions": {
            "items": {
              "$ref": "#/components/schemas/Action"
            },
            "maxItems": 20,
            "type": [
              "array",
              "null"
            ]
          },
          "name": {
            "maxLength": 80,
            "minLength": 1,
            "type": "string"
          },
          "position": {
            "format": "int32",
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "name",
          "actions"
        ],
        "type": "object"
      },
      "MacrosOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/MacrosOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "macros": {
            "items": {
              "$ref": "#/components/schemas/Macro"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "macros"
        ],
        "type": "object"
      },
      "MailServer": {
        "additionalProperties": false,
        "properties": {
          "host": {
            "type": "string"
          },
          "port": {
            "format": "int64",
            "type": "integer"
          },
          "security": {
            "type": "string"
          }
        },
        "required": [
          "host",
          "port",
          "security"
        ],
        "type": "object"
      },
      "Manifest": {
        "additionalProperties": false,
        "properties": {
          "api_version": {
            "description": "Hook contract version; must equal the server's",
            "format": "int64",
            "type": "integer"
          },
          "description": {
            "type": "string"
          },
          "hooks": {
            "additionalProperties": {
              "$ref": "#/components/schemas/HookSpec"
            },
            "description": "Hook name to delivery spec",
            "type": "object"
          },
          "name": {
            "description": "Lower-case identifier, unique per account",
            "type": "string"
          },
          "panels": {
            "items": {
              "$ref": "#/components/schemas/Panel"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "scopes": {
            "description": "Permission keys the app asks for",
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "settings_schema": {
            "description": "JSON Schema for the app's settings section"
          },
          "title": {
            "type": "string"
          },
          "version": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "title",
          "version",
          "api_version"
        ],
        "type": "object"
      },
      "MassDelete": {
        "additionalProperties": false,
        "properties": {
          "deleted": {
            "description": "Imported records gone from the source",
            "format": "int64",
            "type": "integer"
          },
          "entity": {
            "type": "string"
          },
          "mapped": {
            "description": "Records of the kind imported so far",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "entity",
          "deleted",
          "mapped"
        ],
        "type": "object"
      },
      "MeOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/MeOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "account_id": {
            "format": "int64",
            "type": "integer"
          },
          "availability": {
            "enum": [
              "online",
              "busy",
              "away",
              "offline"
            ],
            "type": "string"
          },
          "availability_auto": {
            "type": "boolean"
          },
          "email": {
            "type": "string"
          },
          "fields": {
            "items": {
              "$ref": "#/components/schemas/FieldGrant"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "kind": {
            "type": "string"
          },
          "locale": {
            "description": "The person's chosen app language; absent to follow the browser",
            "type": "string"
          },
          "memberships": {
            "items": {
              "$ref": "#/components/schemas/Membership"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "mfa_enabled": {
            "type": "boolean"
          },
          "mfa_passed": {
            "type": "boolean"
          },
          "mfa_policy": {
            "$ref": "#/components/schemas/MFAStanding"
          },
          "name": {
            "type": "string"
          },
          "permissions": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "platform_admin": {
            "type": "boolean"
          },
          "sso_workspace": {
            "type": "boolean"
          },
          "support_contact": {
            "type": "string"
          },
          "suspended_workspaces": {
            "items": {
              "$ref": "#/components/schemas/SuspendedWorkspace"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "user_id": {
            "format": "int64",
            "type": "integer"
          },
          "visibility": {
            "items": {
              "$ref": "#/components/schemas/Visibility"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "kind",
          "permissions",
          "visibility",
          "fields"
        ],
        "type": "object"
      },
      "Member": {
        "additionalProperties": false,
        "properties": {
          "availability": {
            "enum": [
              "online",
              "busy",
              "away",
              "offline"
            ],
            "type": "string"
          },
          "capacity": {
            "description": "Open conversations this member may hold before assignment skips them; 0 uses the team's or inbox's",
            "format": "int32",
            "type": "integer"
          },
          "email": {
            "type": "string"
          },
          "is_owner": {
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "role_id": {
            "format": "int64",
            "type": "integer"
          },
          "role_name": {
            "type": "string"
          },
          "skills": {
            "description": "Skills assignment matches against a conversation's required skills",
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "status": {
            "type": "string"
          },
          "user_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "user_id",
          "email",
          "name",
          "role_id",
          "role_name",
          "status",
          "is_owner",
          "availability",
          "skills",
          "capacity"
        ],
        "type": "object"
      },
      "MemberImpact": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/MemberImpact.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "action": {
            "enum": [
              "disable",
              "remove",
              "role"
            ],
            "type": "string"
          },
          "api_keys": {
            "$ref": "#/components/schemas/ImpactGroup"
          },
          "apps": {
            "$ref": "#/components/schemas/ImpactGroup"
          },
          "assigned_open": {
            "format": "int64",
            "type": "integer"
          },
          "bots": {
            "$ref": "#/components/schemas/ImpactGroup"
          },
          "confirm": {
            "type": "string"
          },
          "confirm_required": {
            "type": "boolean"
          },
          "email": {
            "type": "string"
          },
          "lost_permissions": {
            "description": "Role change: permissions, visibility and field modes the new role does not have",
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "rules": {
            "$ref": "#/components/schemas/ImpactGroup"
          },
          "shared_views": {
            "$ref": "#/components/schemas/ImpactGroup"
          },
          "sole_member_teams": {
            "$ref": "#/components/schemas/ImpactGroup"
          },
          "transfer_candidates": {
            "items": {
              "$ref": "#/components/schemas/TransferCandidate"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "user_id": {
            "format": "int64",
            "type": "integer"
          },
          "webhooks": {
            "$ref": "#/components/schemas/ImpactGroup"
          }
        },
        "required": [
          "user_id",
          "name",
          "email",
          "role",
          "action",
          "confirm_required",
          "confirm",
          "lost_permissions",
          "rules",
          "bots",
          "webhooks",
          "apps",
          "api_keys",
          "shared_views",
          "assigned_open",
          "sole_member_teams",
          "transfer_candidates"
        ],
        "type": "object"
      },
      "MemberMFA": {
        "additionalProperties": false,
        "properties": {
          "blocked": {
            "type": "boolean"
          },
          "deadline": {
            "format": "date-time",
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "user_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "user_id",
          "name",
          "email",
          "blocked"
        ],
        "type": "object"
      },
      "MemberRoutingInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/MemberRoutingInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "capacity": {
            "description": "0 uses the team's or inbox's capacity",
            "format": "int32",
            "maximum": 1000,
            "minimum": 0,
            "type": "integer"
          },
          "skills": {
            "description": "Tags such as billing or spanish; matched without regard to case",
            "items": {
              "type": "string"
            },
            "maxItems": 50,
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "skills",
          "capacity"
        ],
        "type": "object"
      },
      "MemberRoutingOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/MemberRoutingOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "capacity": {
            "format": "int32",
            "type": "integer"
          },
          "skills": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "skills",
          "capacity"
        ],
        "type": "object"
      },
      "MemberUpdateInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/MemberUpdateInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "confirm": {
            "description": "Required to disable or to narrow the role: the person's email, as GET /account/members/{user_id}/impact names it",
            "maxLength": 254,
            "type": "string"
          },
          "reassign_to": {
            "description": "On disable: left out keeps their open conversations assigned; 0 unassigns them; a member id hands them to that member",
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "role_id": {
            "format": "int64",
            "minimum": 1,
            "type": "integer"
          },
          "status": {
            "default": "active",
            "enum": [
              "active",
              "disabled"
            ],
            "type": "string"
          },
          "transfer_to": {
            "description": "On disable: the member who takes over their rules, bots, webhooks and apps (0: rules are paused, the rest keeps running without an owner)",
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "role_id"
        ],
        "type": "object"
      },
      "MembersOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/MembersOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "_redacted": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "members": {
            "items": {
              "$ref": "#/components/schemas/Member"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "members"
        ],
        "type": "object"
      },
      "Membership": {
        "additionalProperties": false,
        "properties": {
          "AccountID": {
            "format": "int64",
            "type": "integer"
          },
          "AccountName": {
            "type": "string"
          },
          "AccountSlug": {
            "type": "string"
          },
          "RoleID": {
            "format": "int64",
            "type": "integer"
          },
          "RoleName": {
            "type": "string"
          }
        },
        "required": [
          "AccountID",
          "AccountSlug",
          "AccountName",
          "RoleID",
          "RoleName"
        ],
        "type": "object"
      },
      "MentionableMember": {
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string"
          },
          "user_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "user_id",
          "name"
        ],
        "type": "object"
      },
      "MentionableOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/MentionableOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "members": {
            "items": {
              "$ref": "#/components/schemas/MentionableMember"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "members"
        ],
        "type": "object"
      },
      "MergeInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/MergeInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "prefer_source": {
            "description": "Fields whose value comes from the merged contact when it has one: name, company, avatar_url, attributes.<key>. Every other field keeps this contact's value and is filled from the other only when empty.",
            "items": {
              "type": "string"
            },
            "maxItems": 100,
            "type": [
              "array",
              "null"
            ]
          },
          "source_id": {
            "description": "The contact merged into it",
            "format": "int64",
            "minimum": 1,
            "type": "integer"
          }
        },
        "required": [
          "source_id"
        ],
        "type": "object"
      },
      "Message": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/Message.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "attachments": {
            "items": {
              "$ref": "#/components/schemas/Attachment"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "content": {
            "type": "string"
          },
          "content_type": {
            "type": "string"
          },
          "conversation_id": {
            "format": "int64",
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "delivery_error": {
            "type": "string"
          },
          "delivery_status": {
            "type": "string"
          },
          "direction": {
            "enum": [
              "inbound",
              "outbound"
            ],
            "type": "string"
          },
          "headers": {},
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "enum": [
              "reply",
              "note",
              "activity"
            ],
            "type": "string"
          },
          "provider_message_id": {
            "type": "string"
          },
          "read_at": {
            "format": "date-time",
            "type": "string"
          },
          "sender_id": {
            "format": "int64",
            "type": "integer"
          },
          "sender_type": {
            "type": "string"
          },
          "sent_from": {
            "$ref": "#/components/schemas/PageRef",
            "description": "Web chat: the customer's page the visitor wrote this message from"
          }
        },
        "required": [
          "id",
          "conversation_id",
          "direction",
          "kind",
          "sender_type",
          "content",
          "content_type",
          "attachments",
          "created_at"
        ],
        "type": "object"
      },
      "MessageCreateInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/MessageCreateInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "content": {
            "maxLength": 100000,
            "minLength": 1,
            "type": "string"
          },
          "content_type": {
            "default": "text",
            "enum": [
              "text",
              "html",
              "markdown"
            ],
            "type": "string"
          },
          "kind": {
            "default": "reply",
            "enum": [
              "reply",
              "note"
            ],
            "type": "string"
          },
          "mention_ids": {
            "description": "Notes only: the members the note mentions, as the composer's autocomplete picked them (GET /conversations/{id}/mentionable). Left out, \"@Name\" in the text is resolved among the members who can see the conversation",
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "maxItems": 20,
            "type": [
              "array",
              "null"
            ]
          },
          "message_tag": {
            "description": "Replies on a channel with a reply window (Messenger, Instagram) after it has closed: one of the inbox's capabilities.message_tags, such as HUMAN_AGENT",
            "maxLength": 40,
            "pattern": "^[A-Z_]*$",
            "type": "string"
          },
          "quick_replies": {
            "description": "Up to 10 answers the customer can tap (40 characters each); replies only",
            "items": {
              "type": "string"
            },
            "maxItems": 10,
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "content"
        ],
        "type": "object"
      },
      "MessageWithFilesOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/MessageWithFilesOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "attachments": {
            "items": {
              "$ref": "#/components/schemas/Attachment"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "content": {
            "type": "string"
          },
          "content_type": {
            "type": "string"
          },
          "conversation_id": {
            "format": "int64",
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "delivery_error": {
            "type": "string"
          },
          "delivery_status": {
            "type": "string"
          },
          "direction": {
            "enum": [
              "inbound",
              "outbound"
            ],
            "type": "string"
          },
          "headers": {},
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "enum": [
              "reply",
              "note",
              "activity"
            ],
            "type": "string"
          },
          "provider_message_id": {
            "type": "string"
          },
          "read_at": {
            "format": "date-time",
            "type": "string"
          },
          "sender_id": {
            "format": "int64",
            "type": "integer"
          },
          "sender_type": {
            "type": "string"
          },
          "sent_from": {
            "$ref": "#/components/schemas/PageRef",
            "description": "Web chat: the customer's page the visitor wrote this message from"
          }
        },
        "required": [
          "attachments",
          "id",
          "conversation_id",
          "direction",
          "kind",
          "sender_type",
          "content",
          "content_type",
          "created_at"
        ],
        "type": "object"
      },
      "MessagesListOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/MessagesListOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "has_more": {
            "description": "More messages exist past this page: newer ones with after_id (or no cursor), older ones with before_id or latest",
            "type": "boolean"
          },
          "messages": {
            "items": {
              "$ref": "#/components/schemas/Message"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "messages",
          "has_more"
        ],
        "type": "object"
      },
      "Meta": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/Meta.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "analytics": {
            "$ref": "#/components/schemas/MetaAnalytics",
            "description": "Web analytics tags the app should load; absent when the operator configured none"
          },
          "captcha": {
            "$ref": "#/components/schemas/MetaCaptcha",
            "description": "The human check the sign-up form must show; absent when none is configured or sign-up is off"
          },
          "edition": {
            "enum": [
              "community",
              "saas"
            ],
            "type": "string"
          },
          "sentry": {
            "$ref": "#/components/schemas/MetaSentry",
            "description": "Where the app reports its own errors; absent when the operator configured no DSN"
          },
          "signup_enabled": {
            "type": "boolean"
          },
          "version": {
            "description": "The release (tag) this server runs, without the commit; empty for untagged builds",
            "type": "string"
          },
          "ws_path": {
            "examples": [
              "/api/ws"
            ],
            "type": "string"
          }
        },
        "required": [
          "edition",
          "signup_enabled",
          "version",
          "ws_path"
        ],
        "type": "object"
      },
      "MetaAnalytics": {
        "additionalProperties": false,
        "properties": {
          "ga4": {
            "description": "Google Analytics 4 measurement id",
            "examples": [
              "G-XXXXXXXXXX"
            ],
            "type": "string"
          },
          "gtm": {
            "description": "Google Tag Manager container id; when set the app loads the container instead of gtag.js",
            "examples": [
              "GTM-XXXXXXX"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "MetaCaptcha": {
        "additionalProperties": false,
        "properties": {
          "provider": {
            "enum": [
              "turnstile",
              "hcaptcha"
            ],
            "type": "string"
          },
          "site_key": {
            "type": "string"
          }
        },
        "required": [
          "provider",
          "site_key"
        ],
        "type": "object"
      },
      "MetaSentry": {
        "additionalProperties": false,
        "properties": {
          "dsn": {
            "type": "string"
          },
          "environment": {
            "enum": [
              "development",
              "production"
            ],
            "type": "string"
          },
          "release": {
            "description": "The release name events carry (kommio@<version>)",
            "type": "string"
          }
        },
        "required": [
          "dsn",
          "environment",
          "release"
        ],
        "type": "object"
      },
      "MfaCodeInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/MfaCodeInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "code": {
            "description": "A code from the authenticator app, or an unused recovery code",
            "maxLength": 32,
            "minLength": 6,
            "type": "string"
          }
        },
        "required": [
          "code"
        ],
        "type": "object"
      },
      "MfaDisableInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/MfaDisableInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "code": {
            "description": "A code from the authenticator app, or an unused recovery code",
            "maxLength": 32,
            "minLength": 6,
            "type": "string"
          },
          "password": {
            "maxLength": 1024,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "password",
          "code"
        ],
        "type": "object"
      },
      "MfaStatusOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/MfaStatusOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "recovery_codes_left": {
            "description": "Unused recovery codes; 0 when two-factor is off",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "enabled",
          "recovery_codes_left"
        ],
        "type": "object"
      },
      "MfaVerifyInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/MfaVerifyInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "challenge": {
            "minLength": 1,
            "type": "string"
          },
          "code": {
            "maxLength": 32,
            "minLength": 6,
            "type": "string"
          }
        },
        "required": [
          "challenge",
          "code"
        ],
        "type": "object"
      },
      "MissingAttachment": {
        "additionalProperties": false,
        "properties": {
          "file_name": {
            "type": "string"
          },
          "key": {
            "type": "string"
          },
          "message_id": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          }
        },
        "required": [
          "message_id",
          "file_name",
          "reason"
        ],
        "type": "object"
      },
      "Models": {
        "additionalProperties": false,
        "properties": {
          "draft": {
            "type": "string"
          },
          "extra": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "summary": {
            "type": "string"
          },
          "tone": {
            "type": "string"
          },
          "translate": {
            "type": "string"
          }
        },
        "required": [
          "draft",
          "summary",
          "tone",
          "translate"
        ],
        "type": "object"
      },
      "Node": {
        "additionalProperties": false,
        "properties": {
          "data": {},
          "id": {
            "type": "string"
          },
          "position": {
            "$ref": "#/components/schemas/Position"
          },
          "type": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "type"
        ],
        "type": "object"
      },
      "NodeStats": {
        "additionalProperties": false,
        "properties": {
          "answers": {
            "format": "int64",
            "type": "integer"
          },
          "completed": {
            "format": "int64",
            "type": "integer"
          },
          "dropped": {
            "description": "Sessions abandoned while waiting here",
            "format": "int64",
            "type": "integer"
          },
          "entered": {
            "format": "int64",
            "type": "integer"
          },
          "exited": {
            "format": "int64",
            "type": "integer"
          },
          "handed_off": {
            "format": "int64",
            "type": "integer"
          },
          "invalid": {
            "format": "int64",
            "type": "integer"
          },
          "node": {
            "type": "string"
          }
        },
        "required": [
          "node",
          "entered",
          "exited",
          "answers",
          "invalid",
          "dropped",
          "handed_off",
          "completed"
        ],
        "type": "object"
      },
      "NodeType": {
        "additionalProperties": false,
        "properties": {
          "category": {
            "type": "string"
          },
          "input": {
            "type": "boolean"
          },
          "schema": {},
          "terminal": {
            "type": "boolean"
          },
          "type": {
            "type": "string"
          }
        },
        "required": [
          "type",
          "category",
          "schema",
          "terminal",
          "input"
        ],
        "type": "object"
      },
      "NotifListOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/NotifListOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "has_more": {
            "type": "boolean"
          },
          "notifications": {
            "items": {
              "$ref": "#/components/schemas/Notification"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "unread": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "notifications",
          "unread",
          "has_more"
        ],
        "type": "object"
      },
      "Notification": {
        "additionalProperties": false,
        "properties": {
          "actor_id": {
            "format": "int64",
            "type": "integer"
          },
          "body": {
            "type": "string"
          },
          "conversation_id": {
            "format": "int64",
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "type": "string"
          },
          "message_id": {
            "format": "int64",
            "type": "integer"
          },
          "read_at": {
            "format": "date-time",
            "type": "string"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "kind",
          "title",
          "body",
          "created_at"
        ],
        "type": "object"
      },
      "OAuthProviderInfo": {
        "additionalProperties": false,
        "properties": {
          "configured": {
            "description": "The operator registered an app (KOMMIO_OAUTH_<PROVIDER>_CLIENT_ID and _SECRET); otherwise sign-in needs operator setup",
            "type": "boolean"
          },
          "console": {
            "type": "string"
          },
          "env_vars": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "guide_url": {
            "type": "string"
          },
          "id": {
            "enum": [
              "microsoft",
              "google"
            ],
            "type": "string"
          },
          "imap": {
            "$ref": "#/components/schemas/MailServer"
          },
          "name": {
            "type": "string"
          },
          "permissions": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "redirect_url": {
            "description": "The redirect URI to register with the provider",
            "type": "string"
          },
          "scopes": {
            "description": "What an email inbox asks for",
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "shared_mailboxes": {
            "type": "boolean"
          },
          "smtp": {
            "$ref": "#/components/schemas/MailServer"
          }
        },
        "required": [
          "id",
          "name",
          "configured",
          "redirect_url",
          "scopes",
          "console",
          "permissions",
          "env_vars",
          "guide_url",
          "shared_mailboxes",
          "imap",
          "smtp"
        ],
        "type": "object"
      },
      "OauthProvidersOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/OauthProvidersOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "providers": {
            "items": {
              "$ref": "#/components/schemas/OAuthProviderInfo"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "providers"
        ],
        "type": "object"
      },
      "OauthStartInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/OauthStartInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "connection_id": {
            "description": "Reauthorise this connection (the provider refused it, or the account changed)",
            "format": "int64",
            "type": "integer"
          },
          "inbox_id": {
            "description": "Switch this email inbox to the new sign-in (an inbox imported from Chatwoot, or one on a password)",
            "format": "int64",
            "type": "integer"
          },
          "mailbox": {
            "description": "The mailbox address when it differs from the account that signs in (a Microsoft 365 shared mailbox)",
            "maxLength": 254,
            "type": "string"
          },
          "purpose": {
            "default": "email",
            "enum": [
              "email"
            ],
            "type": "string"
          },
          "return_to": {
            "description": "Agent-app path to come back to",
            "maxLength": 500,
            "type": "string"
          }
        },
        "type": "object"
      },
      "OauthStartOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/OauthStartOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "authorize_url": {
            "description": "Send the browser here; the provider comes back to /api/integrations/oauth/{provider}/callback",
            "type": "string"
          }
        },
        "required": [
          "authorize_url"
        ],
        "type": "object"
      },
      "OldestWaiting": {
        "additionalProperties": false,
        "properties": {
          "display_id": {
            "format": "int64",
            "type": "integer"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "since": {
            "description": "The customer's unanswered message",
            "format": "date-time",
            "type": "string"
          },
          "wait_ms": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "display_id",
          "since",
          "wait_ms"
        ],
        "type": "object"
      },
      "OnlineVisitor": {
        "additionalProperties": false,
        "properties": {
          "contact_id": {
            "description": "The visitor's contact; absent while they have none yet",
            "format": "int64",
            "type": "integer"
          },
          "conversation_id": {
            "description": "Their open conversation in this inbox, when one exists",
            "format": "int64",
            "type": "integer"
          },
          "first_seen": {
            "format": "date-time",
            "type": "string"
          },
          "last_seen": {
            "format": "date-time",
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "page": {
            "type": "string"
          },
          "visitor_session_id": {
            "description": "The signed-in session of a visitor who has no contact yet: pass it to POST /conversations to start a chat, which creates the contact",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "name",
          "first_seen",
          "last_seen"
        ],
        "type": "object"
      },
      "Outcome": {
        "additionalProperties": false,
        "properties": {
          "detail": {
            "type": "string"
          },
          "result": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        },
        "required": [
          "type",
          "result"
        ],
        "type": "object"
      },
      "OverviewOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/OverviewOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "business_hours": {
            "description": "Business hours or holidays are set; without them business-hours durations equal wall clock",
            "type": "boolean"
          },
          "from": {
            "type": "string"
          },
          "heatmap": {
            "description": "Conversations created by weekday (Monday first) and hour",
            "items": {
              "items": {
                "format": "int64",
                "type": "integer"
              },
              "maxItems": 24,
              "minItems": 24,
              "type": [
                "array",
                "null"
              ]
            },
            "maxItems": 7,
            "minItems": 7,
            "type": [
              "array",
              "null"
            ]
          },
          "live": {
            "$ref": "#/components/schemas/Live"
          },
          "note": {
            "type": "string"
          },
          "previous": {
            "$ref": "#/components/schemas/Tiles"
          },
          "rebuild_needed": {
            "description": "Filters that combine dimensions, scoped roles and the click-through from messages, satisfaction and bots need a one-time rebuild of this workspace's rollups (POST /reports/backfill)",
            "type": "boolean"
          },
          "rebuild_state": {
            "description": "Where that rebuild stands, when one is pending (GET /reports/backfill has the details)",
            "enum": [
              "needed",
              "queued",
              "running",
              "failed"
            ],
            "type": "string"
          },
          "scoped": {
            "description": "The numbers are limited to what the caller's role sees (its conversation visibility)",
            "type": "boolean"
          },
          "series": {
            "items": {
              "$ref": "#/components/schemas/Point"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "tiles": {
            "$ref": "#/components/schemas/Tiles"
          },
          "to": {
            "type": "string"
          },
          "tz": {
            "description": "The zone the report was computed in",
            "type": "string"
          }
        },
        "required": [
          "from",
          "to",
          "tz",
          "tiles",
          "series",
          "heatmap",
          "live",
          "note",
          "business_hours",
          "scoped",
          "rebuild_needed"
        ],
        "type": "object"
      },
      "OverwrittenField": {
        "additionalProperties": false,
        "properties": {
          "field": {
            "type": "string"
          },
          "kommio": {
            "description": "The value Kommio had, now lost (reports written before 2026-09-26: the value kept)",
            "type": "string"
          },
          "source": {
            "description": "The source's value, applied (reports written before 2026-09-26: not applied)",
            "type": "string"
          }
        },
        "required": [
          "field",
          "kommio",
          "source"
        ],
        "type": "object"
      },
      "PageRef": {
        "additionalProperties": false,
        "properties": {
          "title": {
            "maxLength": 300,
            "type": "string"
          },
          "url": {
            "maxLength": 2000,
            "type": "string"
          }
        },
        "required": [
          "url"
        ],
        "type": "object"
      },
      "PageVisit": {
        "additionalProperties": false,
        "properties": {
          "at": {
            "format": "date-time",
            "type": "string"
          },
          "title": {
            "maxLength": 300,
            "type": "string"
          },
          "url": {
            "maxLength": 2000,
            "type": "string"
          }
        },
        "required": [
          "url",
          "at"
        ],
        "type": "object"
      },
      "Panel": {
        "additionalProperties": false,
        "properties": {
          "key": {
            "type": "string"
          },
          "location": {
            "enum": [
              "conversation",
              "contact",
              "inbox"
            ],
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "key",
          "title",
          "url",
          "location"
        ],
        "type": "object"
      },
      "Passage": {
        "additionalProperties": false,
        "properties": {
          "audience": {
            "enum": [
              "public",
              "internal",
              "ai_only"
            ],
            "type": "string"
          },
          "help_center_id": {
            "format": "int64",
            "type": "integer"
          },
          "id": {
            "description": "The passage",
            "format": "int64",
            "type": "integer"
          },
          "keyword_rank": {
            "format": "int64",
            "type": "integer"
          },
          "locale": {
            "type": "string"
          },
          "page_id": {
            "format": "int64",
            "type": "integer"
          },
          "score": {
            "format": "double",
            "type": "number"
          },
          "similarity": {
            "format": "double",
            "type": "number"
          },
          "slug": {
            "type": "string"
          },
          "snippet": {
            "type": "string"
          },
          "source_id": {
            "format": "int64",
            "type": "integer"
          },
          "source_kind": {
            "enum": [
              "article",
              "snippet",
              "website",
              "file"
            ],
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "vector_rank": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "source_kind",
          "source_id",
          "audience",
          "locale",
          "title",
          "snippet",
          "text",
          "score"
        ],
        "type": "object"
      },
      "Placement": {
        "additionalProperties": false,
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "inbox_id": {
            "format": "int64",
            "type": "integer"
          },
          "inbox_name": {
            "type": "string"
          },
          "mode": {
            "type": "string"
          },
          "position": {
            "description": "0-based place in the inbox's order",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "inbox_id",
          "inbox_name",
          "position",
          "mode",
          "enabled"
        ],
        "type": "object"
      },
      "PluginActionInfo": {
        "additionalProperties": false,
        "properties": {
          "key": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "params_schema": {}
        },
        "required": [
          "key",
          "label",
          "params_schema"
        ],
        "type": "object"
      },
      "PluginInfo": {
        "additionalProperties": false,
        "properties": {
          "actions": {
            "items": {
              "$ref": "#/components/schemas/PluginActionInfo"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "channels": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "description": {
            "type": "string"
          },
          "hooks": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "sections": {
            "description": "Settings sections; values are read and written through /settings/{key}",
            "items": {
              "$ref": "#/components/schemas/SettingsSection"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "version": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "version",
          "hooks",
          "channels",
          "sections",
          "actions"
        ],
        "type": "object"
      },
      "PluginsOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/PluginsOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "api_version": {
            "format": "int64",
            "type": "integer"
          },
          "plugins": {
            "items": {
              "$ref": "#/components/schemas/PluginInfo"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "api_version",
          "plugins"
        ],
        "type": "object"
      },
      "Point": {
        "additionalProperties": false,
        "properties": {
          "created": {
            "format": "int64",
            "type": "integer"
          },
          "day": {
            "type": "string"
          },
          "first_response_bh_median_ms": {
            "description": "The same in business hours",
            "format": "int64",
            "type": "integer"
          },
          "first_response_bh_p90_ms": {
            "format": "int64",
            "type": "integer"
          },
          "first_response_median_ms": {
            "format": "int64",
            "type": "integer"
          },
          "first_response_p90_ms": {
            "format": "int64",
            "type": "integer"
          },
          "resolved": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "day",
          "created",
          "resolved",
          "first_response_median_ms",
          "first_response_p90_ms",
          "first_response_bh_median_ms",
          "first_response_bh_p90_ms"
        ],
        "type": "object"
      },
      "Policy": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/Policy.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "allowlist": {
            "description": "When not empty, only these slugs may be installed (private apps are always allowed)",
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "auto_pause_after": {
            "description": "Pause an installation after this many failures in a row and tell administrators (0 off, 2 to 50)",
            "format": "int64",
            "type": "integer"
          },
          "install_policy": {
            "description": "admins: only people with integrations:manage install; request: other members may ask, and an administrator decides",
            "enum": [
              "admins",
              "request"
            ],
            "type": "string"
          }
        },
        "required": [
          "install_policy",
          "allowlist",
          "auto_pause_after"
        ],
        "type": "object"
      },
      "Position": {
        "additionalProperties": false,
        "properties": {
          "x": {
            "format": "double",
            "type": "number"
          },
          "y": {
            "format": "double",
            "type": "number"
          }
        },
        "required": [
          "x",
          "y"
        ],
        "type": "object"
      },
      "Prechat": {
        "additionalProperties": false,
        "properties": {
          "require_email": {
            "type": "boolean"
          },
          "require_name": {
            "type": "boolean"
          }
        },
        "required": [
          "require_name",
          "require_email"
        ],
        "type": "object"
      },
      "Preference": {
        "additionalProperties": false,
        "properties": {
          "email": {
            "type": "boolean"
          },
          "in_app": {
            "type": "boolean"
          },
          "kind": {
            "type": "string"
          },
          "push": {
            "description": "Browser push, to every browser the person turned push on in (no message content unless the workspace allows previews)",
            "type": "boolean"
          }
        },
        "required": [
          "kind",
          "in_app",
          "email",
          "push"
        ],
        "type": "object"
      },
      "PreferenceInput": {
        "additionalProperties": false,
        "properties": {
          "email": {
            "type": "boolean"
          },
          "in_app": {
            "type": "boolean"
          },
          "kind": {
            "type": "string"
          },
          "push": {
            "type": "boolean"
          }
        },
        "required": [
          "kind",
          "in_app",
          "email"
        ],
        "type": "object"
      },
      "PrefsBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/PrefsBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "auto_away_minutes": {
            "description": "Minutes without activity in any tab before the app sets Away; 0 never does",
            "enum": [
              0,
              5,
              10,
              15,
              30
            ],
            "format": "int32",
            "type": "integer"
          },
          "desktop_notifications": {
            "description": "Show a desktop notification for the same events while the app's tab is hidden",
            "type": "boolean"
          },
          "email_digest": {
            "description": "Batch notification emails into one digest an hour instead of one email per event",
            "type": "boolean"
          },
          "muted_inbox_ids": {
            "description": "Inboxes the person muted: no reply notifications, sounds or desktop alerts from them; mentions and assignments still arrive",
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "preferences": {
            "items": {
              "$ref": "#/components/schemas/Preference"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "sound_new_conversation": {
            "description": "Play a chime when a conversation arrives in one of the caller's inboxes",
            "type": "boolean"
          },
          "sound_new_message": {
            "description": "Play a soft chime when a customer writes on a conversation assigned to the caller",
            "type": "boolean"
          }
        },
        "required": [
          "preferences",
          "sound_new_conversation",
          "sound_new_message",
          "desktop_notifications",
          "auto_away_minutes",
          "email_digest",
          "muted_inbox_ids"
        ],
        "type": "object"
      },
      "PrefsInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/PrefsInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "auto_away_minutes": {
            "description": "Left out keeps the current value; 0 turns auto-away off",
            "enum": [
              0,
              5,
              10,
              15,
              30
            ],
            "format": "int32",
            "type": "integer"
          },
          "desktop_notifications": {
            "description": "Left out keeps the current value",
            "type": "boolean"
          },
          "email_digest": {
            "description": "Left out keeps the current value",
            "type": "boolean"
          },
          "muted_inbox_ids": {
            "description": "Replaces the muted inboxes; left out keeps them",
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "maxItems": 500,
            "type": "array"
          },
          "preferences": {
            "description": "Kinds to change; kinds left out keep their value",
            "items": {
              "$ref": "#/components/schemas/PreferenceInput"
            },
            "maxItems": 10,
            "type": [
              "array",
              "null"
            ]
          },
          "sound_new_conversation": {
            "description": "Left out keeps the current value",
            "type": "boolean"
          },
          "sound_new_message": {
            "description": "Left out keeps the current value",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "PreviewConversation": {
        "additionalProperties": false,
        "properties": {
          "assignee_id": {
            "format": "int64",
            "type": "integer"
          },
          "channel": {
            "type": "string"
          },
          "display_id": {
            "format": "int64",
            "type": "integer"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "inbox_name": {
            "type": "string"
          },
          "last_activity_at": {
            "format": "date-time",
            "type": "string"
          },
          "last_message_preview": {
            "type": "string"
          },
          "priority": {
            "type": "string"
          },
          "status": {
            "description": "The status category: open, pending, snoozed, resolved or closed",
            "type": "string"
          },
          "subject": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "display_id",
          "status",
          "priority",
          "last_activity_at",
          "inbox_name",
          "channel"
        ],
        "type": "object"
      },
      "Price": {
        "additionalProperties": false,
        "properties": {
          "cache_read": {
            "format": "double",
            "type": "number"
          },
          "cache_write": {
            "format": "double",
            "type": "number"
          },
          "input": {
            "format": "double",
            "type": "number"
          },
          "output": {
            "format": "double",
            "type": "number"
          }
        },
        "required": [
          "input",
          "output"
        ],
        "type": "object"
      },
      "Problem": {
        "additionalProperties": false,
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "node_id": {
            "type": "string"
          },
          "severity": {
            "enum": [
              "error",
              "warning"
            ],
            "type": "string"
          }
        },
        "required": [
          "severity",
          "code",
          "message"
        ],
        "type": "object"
      },
      "Provenance": {
        "additionalProperties": false,
        "properties": {
          "at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "description": "user, api_key, app, website_signin, automation, flow, bot, connector, import or system",
            "type": "string"
          },
          "name": {
            "description": "The person, key, app, rule, bot or data connector, when it still exists",
            "type": "string"
          }
        },
        "required": [
          "kind",
          "at"
        ],
        "type": "object"
      },
      "ProvenanceOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ProvenanceOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "provenance": {
            "additionalProperties": {
              "$ref": "#/components/schemas/Provenance"
            },
            "description": "Who or what last set each attribute value, by key",
            "type": "object"
          }
        },
        "required": [
          "provenance"
        ],
        "type": "object"
      },
      "PublicSSOOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/PublicSSOOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "providers": {
            "items": {
              "$ref": "#/components/schemas/PublicSSOProvider"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "providers"
        ],
        "type": "object"
      },
      "PublicSSOProvider": {
        "additionalProperties": false,
        "properties": {
          "key": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "start_url": {
            "type": "string"
          }
        },
        "required": [
          "key",
          "label",
          "start_url"
        ],
        "type": "object"
      },
      "PublicSurvey": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/PublicSurvey.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "color": {
            "description": "The workspace brand colour (#RRGGBB)",
            "type": "string"
          },
          "inbox": {
            "type": "string"
          },
          "logo": {
            "type": "string"
          },
          "logo_dark": {
            "type": "string"
          },
          "survey": {
            "$ref": "#/components/schemas/SurveyView"
          },
          "workspace": {
            "type": "string"
          }
        },
        "required": [
          "workspace",
          "inbox",
          "survey"
        ],
        "type": "object"
      },
      "PushStateOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/PushStateOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "public_key": {
            "description": "The deployment's VAPID public key, the applicationServerKey for PushManager.subscribe",
            "type": "string"
          },
          "subscriptions": {
            "items": {
              "$ref": "#/components/schemas/PushSubscription"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "public_key",
          "subscriptions"
        ],
        "type": "object"
      },
      "PushSubscribeInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/PushSubscribeInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "endpoint": {
            "maxLength": 2000,
            "minLength": 1,
            "type": "string"
          },
          "keys": {
            "$ref": "#/components/schemas/KeysStruct"
          }
        },
        "required": [
          "endpoint",
          "keys"
        ],
        "type": "object"
      },
      "PushSubscription": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/PushSubscription.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "last_success_at": {
            "format": "date-time",
            "type": "string"
          },
          "user_agent": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "user_agent",
          "created_at"
        ],
        "type": "object"
      },
      "PushUnsubscribeInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/PushUnsubscribeInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "endpoint": {
            "maxLength": 2000,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "endpoint"
        ],
        "type": "object"
      },
      "QualityOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/QualityOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "from": {
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "previous": {
            "$ref": "#/components/schemas/QualityTotals",
            "description": "The previous period of equal length"
          },
          "scoped": {
            "type": "boolean"
          },
          "to": {
            "type": "string"
          },
          "totals": {
            "$ref": "#/components/schemas/QualityTotals"
          },
          "tz": {
            "type": "string"
          }
        },
        "required": [
          "from",
          "to",
          "tz",
          "totals",
          "scoped",
          "note"
        ],
        "type": "object"
      },
      "QualityTotals": {
        "additionalProperties": false,
        "properties": {
          "missed": {
            "description": "Website chats resolved without a reply from a person (not resolved by a bot)",
            "format": "int64",
            "type": "integer"
          },
          "missed_rate": {
            "description": "missed ÷ web_chat_resolved, 0..1",
            "format": "double",
            "type": "number"
          },
          "missed_wait_median_ms": {
            "description": "How long the visitor of a missed chat waited: to leaving the page, else to the resolution",
            "format": "int64",
            "type": "integer"
          },
          "missed_wait_p90_ms": {
            "format": "int64",
            "type": "integer"
          },
          "one_touch": {
            "description": "Resolved with exactly one reply from a person",
            "format": "int64",
            "type": "integer"
          },
          "one_touch_rate": {
            "description": "one_touch ÷ resolved, 0..1",
            "format": "double",
            "type": "number"
          },
          "reopen_rate": {
            "description": "reopened_resolutions ÷ (resolved + reopened_resolutions), 0..1",
            "format": "double",
            "type": "number"
          },
          "reopened_resolutions": {
            "description": "Resolutions made in the window and reopened since",
            "format": "int64",
            "type": "integer"
          },
          "repeat": {
            "description": "Resolved conversations whose contact opened another conversation within 7 days",
            "format": "int64",
            "type": "integer"
          },
          "repeat_rate": {
            "description": "repeat ÷ resolved, 0..1; the last 7 days of a window are still filling",
            "format": "double",
            "type": "number"
          },
          "replies": {
            "description": "Replies from people before those resolutions",
            "format": "int64",
            "type": "integer"
          },
          "replies_per_resolution": {
            "format": "double",
            "type": "number"
          },
          "resolved": {
            "description": "Conversations resolved in the window and resolved now",
            "format": "int64",
            "type": "integer"
          },
          "web_chat_resolved": {
            "description": "Website chats resolved",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "resolved",
          "reopened_resolutions",
          "reopen_rate",
          "one_touch",
          "one_touch_rate",
          "replies",
          "replies_per_resolution",
          "repeat",
          "repeat_rate",
          "web_chat_resolved",
          "missed",
          "missed_rate",
          "missed_wait_median_ms",
          "missed_wait_p90_ms"
        ],
        "type": "object"
      },
      "QueryCount": {
        "additionalProperties": false,
        "properties": {
          "count": {
            "format": "int64",
            "type": "integer"
          },
          "query": {
            "type": "string"
          }
        },
        "required": [
          "query",
          "count"
        ],
        "type": "object"
      },
      "QuotaList": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/QuotaList.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "enforced": {
            "type": "boolean"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/Status"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "items",
          "enforced"
        ],
        "type": "object"
      },
      "RebuildStatus": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/RebuildStatus.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "error": {
            "type": "string"
          },
          "finished_at": {
            "description": "Of a failed run",
            "format": "date-time",
            "type": "string"
          },
          "requested_at": {
            "format": "date-time",
            "type": "string"
          },
          "started_at": {
            "format": "date-time",
            "type": "string"
          },
          "state": {
            "description": "none: nothing pending; needed: an upgrade asks for a one-time rebuild; queued and running: under way; failed: see error",
            "enum": [
              "none",
              "needed",
              "queued",
              "running",
              "failed"
            ],
            "type": "string"
          }
        },
        "required": [
          "state"
        ],
        "type": "object"
      },
      "RecipeView": {
        "additionalProperties": false,
        "properties": {
          "missing_attributes": {
            "items": {
              "$ref": "#/components/schemas/ConnectorRecipeAttribute"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "recipe": {
            "$ref": "#/components/schemas/ConnectorRecipe"
          }
        },
        "required": [
          "recipe",
          "missing_attributes"
        ],
        "type": "object"
      },
      "RefUsage": {
        "additionalProperties": false,
        "properties": {
          "calls": {
            "format": "int64",
            "type": "integer"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "calls"
        ],
        "type": "object"
      },
      "ReplayFailedOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ReplayFailedOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "remaining": {
            "description": "Failed deliveries left for a later call (at most 100 per call)",
            "format": "int64",
            "type": "integer"
          },
          "replayed": {
            "description": "Failed deliveries queued again",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "replayed",
          "remaining"
        ],
        "type": "object"
      },
      "Report-schedules-listResponse": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/Report-schedules-listResponse.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "schedules": {
            "items": {
              "$ref": "#/components/schemas/ReportSchedule"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "schedules"
        ],
        "type": "object"
      },
      "Report-views-duplicateRequest": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/Report-views-duplicateRequest.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "name": {
            "description": "The copy's name (default: the view's name and \"(copy)\")",
            "maxLength": 80,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Report-views-listResponse": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/Report-views-listResponse.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "views": {
            "items": {
              "$ref": "#/components/schemas/ReportView"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "views"
        ],
        "type": "object"
      },
      "Report-views-pinRequest": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/Report-views-pinRequest.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "pinned": {
            "type": "boolean"
          },
          "position": {
            "description": "Where among my pins (default: last)",
            "format": "int64",
            "maximum": 1000,
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "pinned"
        ],
        "type": "object"
      },
      "ReportDeletion": {
        "additionalProperties": false,
        "properties": {
          "action": {
            "enum": [
              "deleted",
              "erased",
              "merged",
              "disabled",
              "kept",
              "held"
            ],
            "type": "string"
          },
          "entity": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "source_id": {
            "type": "string"
          },
          "target_id": {
            "description": "The Kommio row",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "entity",
          "source_id",
          "action"
        ],
        "type": "object"
      },
      "ReportIssue": {
        "additionalProperties": false,
        "properties": {
          "entity": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "severity": {
            "enum": [
              "unmapped",
              "skipped",
              "warning",
              "error"
            ],
            "type": "string"
          },
          "source_id": {
            "type": "string"
          }
        },
        "required": [
          "entity",
          "severity",
          "reason"
        ],
        "type": "object"
      },
      "ReportOverwrite": {
        "additionalProperties": false,
        "properties": {
          "entity": {
            "type": "string"
          },
          "fields": {
            "description": "The fields that differed (empty when only the whole record could be compared)",
            "items": {
              "$ref": "#/components/schemas/OverwrittenField"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "source_id": {
            "type": "string"
          },
          "target_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "entity",
          "source_id",
          "fields"
        ],
        "type": "object"
      },
      "ReportSchedule": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ReportSchedule.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "agent_id": {
            "format": "int64",
            "type": "integer"
          },
          "attachment": {
            "description": "Attach the breakdown as a file (a link instead when it is too large)",
            "enum": [
              "csv",
              "xlsx",
              ""
            ],
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "frequency": {
            "enum": [
              "daily",
              "weekly"
            ],
            "type": "string"
          },
          "hour": {
            "description": "The local hour it leaves (0-23)",
            "format": "int64",
            "type": "integer"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "inbox_id": {
            "format": "int64",
            "type": "integer"
          },
          "last_sent_at": {
            "format": "date-time",
            "type": "string"
          },
          "last_status": {
            "description": "sent, skipped_permission (the person no longer holds reports:read, is not an active member, or no longer sees the saved view) or failed",
            "type": "string"
          },
          "next_run_at": {
            "format": "date-time",
            "type": "string"
          },
          "team_id": {
            "format": "int64",
            "type": "integer"
          },
          "timezone": {
            "description": "IANA zone; empty uses the workspace's, else UTC",
            "type": "string"
          },
          "view_id": {
            "description": "A saved view it sends: the view's filters and grouping instead of inbox_id, team_id and agent_id",
            "format": "int64",
            "type": "integer"
          },
          "weekday": {
            "description": "Weekly: the day it leaves, 1 = Monday .. 7 = Sunday",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "frequency",
          "weekday",
          "hour",
          "timezone",
          "enabled",
          "next_run_at",
          "created_at"
        ],
        "type": "object"
      },
      "ReportView": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ReportView.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "can_manage": {
            "description": "The viewer may rename, change, share or delete it",
            "type": "boolean"
          },
          "config": {
            "$ref": "#/components/schemas/ReportViewConfig"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "mine": {
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "owner_id": {
            "format": "int64",
            "type": "integer"
          },
          "owner_name": {
            "type": "string"
          },
          "pinned": {
            "description": "Pinned to the viewer's Reports sidebar",
            "type": "boolean"
          },
          "position": {
            "description": "Order among the viewer's pins",
            "format": "int64",
            "type": "integer"
          },
          "shared": {
            "description": "Shared with the workspace; it still shows each person only what they may see",
            "type": "boolean"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "shared",
          "config",
          "owner_id",
          "owner_name",
          "mine",
          "can_manage",
          "pinned",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "ReportViewBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ReportViewBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "config": {
            "$ref": "#/components/schemas/ReportViewConfig"
          },
          "name": {
            "maxLength": 80,
            "minLength": 1,
            "type": "string"
          },
          "shared": {
            "description": "Share with the workspace (reports:share)",
            "type": "boolean"
          }
        },
        "required": [
          "name",
          "config"
        ],
        "type": "object"
      },
      "ReportViewConfig": {
        "additionalProperties": false,
        "properties": {
          "agent_id": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "clock": {
            "description": "Durations in wall clock (the default) or business hours",
            "enum": [
              "wall",
              "business",
              ""
            ],
            "type": "string"
          },
          "dimension": {
            "description": "The breakdown's grouping",
            "enum": [
              "agent",
              "team",
              "inbox",
              "tag",
              ""
            ],
            "type": "string"
          },
          "from": {
            "description": "Custom range: first day",
            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
            "type": "string"
          },
          "inbox_id": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "options": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Settings of other report pages (short strings)",
            "maxProperties": 20,
            "type": "object"
          },
          "range": {
            "description": "A window of days ending today when opened (the default is 30), or custom (from and to)",
            "enum": [
              "today",
              "7",
              "30",
              "90",
              "custom",
              ""
            ],
            "type": "string"
          },
          "report": {
            "description": "The report page: overview (the Reports page) unless another report names itself",
            "maxLength": 40,
            "pattern": "^[a-z][a-z0-9_-]*$",
            "type": "string"
          },
          "team_id": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "to": {
            "description": "Custom range: last day",
            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
            "type": "string"
          }
        },
        "required": [
          "report"
        ],
        "type": "object"
      },
      "ReportViewPatch": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ReportViewPatch.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "config": {
            "$ref": "#/components/schemas/ReportViewConfig"
          },
          "name": {
            "maxLength": 80,
            "minLength": 1,
            "type": "string"
          },
          "shared": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "Request": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/Request.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "decided_at": {
            "format": "date-time",
            "type": "string"
          },
          "decided_by": {
            "format": "int64",
            "type": "integer"
          },
          "entry_slug": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "installation_id": {
            "format": "int64",
            "type": "integer"
          },
          "note": {
            "type": "string"
          },
          "requested_by": {
            "format": "int64",
            "type": "integer"
          },
          "requested_by_name": {
            "type": "string"
          },
          "status": {
            "enum": [
              "pending",
              "approved",
              "declined",
              "installed"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "entry_slug",
          "note",
          "status",
          "created_at"
        ],
        "type": "object"
      },
      "RequestCreateInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/RequestCreateInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "note": {
            "maxLength": 1000,
            "type": "string"
          },
          "slug": {
            "maxLength": 100,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "slug"
        ],
        "type": "object"
      },
      "RequestDecideInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/RequestDecideInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "decision": {
            "enum": [
              "approve",
              "decline"
            ],
            "type": "string"
          }
        },
        "required": [
          "decision"
        ],
        "type": "object"
      },
      "RequestsOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/RequestsOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "requests": {
            "items": {
              "$ref": "#/components/schemas/Request"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "requests"
        ],
        "type": "object"
      },
      "ResetInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ResetInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "password": {
            "maxLength": 1024,
            "minLength": 1,
            "type": "string"
          },
          "token": {
            "maxLength": 200,
            "minLength": 20,
            "type": "string"
          }
        },
        "required": [
          "token",
          "password"
        ],
        "type": "object"
      },
      "Responder": {
        "additionalProperties": false,
        "properties": {
          "bot_id": {
            "description": "The bot that holds conversations (for a flow, the flow's own bot; for the AI agent, its bot)",
            "format": "int64",
            "type": "integer"
          },
          "conditions": {
            "description": "Condition over the conversation context (GET /responders/fields); empty matches every conversation"
          },
          "enabled": {
            "type": "boolean"
          },
          "flow_id": {
            "format": "int64",
            "type": "integer"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "inbox_id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "enum": [
              "bot",
              "flow",
              "ai_agent"
            ],
            "type": "string"
          },
          "mode": {
            "enum": [
              "auto",
              "manual"
            ],
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "position": {
            "format": "int64",
            "type": "integer"
          },
          "status": {
            "description": "active, paused (bot) or unpublished (flow): only active responders hold conversations",
            "type": "string"
          }
        },
        "required": [
          "id",
          "inbox_id",
          "position",
          "kind",
          "mode",
          "enabled",
          "name",
          "status"
        ],
        "type": "object"
      },
      "ResponderEntry": {
        "additionalProperties": false,
        "properties": {
          "bot_id": {
            "description": "For kind bot: the agent bot",
            "format": "int64",
            "type": "integer"
          },
          "conditions": {
            "description": "Condition DSL over the conversation context; omitted or null matches every conversation"
          },
          "enabled": {
            "description": "Default true",
            "type": "boolean"
          },
          "flow_id": {
            "description": "For kind flow: the flow",
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "enum": [
              "bot",
              "flow",
              "ai_agent"
            ],
            "type": "string"
          },
          "mode": {
            "description": "auto (default) holds matching new conversations; manual only when assigned",
            "enum": [
              "auto",
              "manual",
              ""
            ],
            "type": "string"
          }
        },
        "required": [
          "kind"
        ],
        "type": "object"
      },
      "RespondersOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/RespondersOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "responders": {
            "items": {
              "$ref": "#/components/schemas/Responder"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "responders"
        ],
        "type": "object"
      },
      "RespondersPutInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/RespondersPutInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "responders": {
            "description": "The whole list, first to last",
            "items": {
              "$ref": "#/components/schemas/ResponderEntry"
            },
            "maxItems": 20,
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "responders"
        ],
        "type": "object"
      },
      "RevealActor": {
        "additionalProperties": false,
        "properties": {
          "actor_id": {
            "format": "int64",
            "type": "integer"
          },
          "actor_type": {
            "type": "string"
          },
          "count": {
            "format": "int64",
            "type": "integer"
          },
          "last_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "actor_type",
          "count",
          "last_at"
        ],
        "type": "object"
      },
      "RevealInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/RevealInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "field": {
            "description": "emails, display_email and phones of a contact; visitor.ip of a web chat conversation; attributes.<key> for a sensitive custom attribute of either; file for a flagged file on a message",
            "maxLength": 80,
            "pattern": "^(emails|display_email|phones|visitor\\.ip|file|attributes\\.[a-z][a-z0-9_]{0,59})$",
            "type": "string"
          },
          "id": {
            "description": "The record's id",
            "format": "int64",
            "minimum": 1,
            "type": "integer"
          },
          "object": {
            "description": "The kind of record",
            "enum": [
              "contact",
              "conversation",
              "attachment"
            ],
            "type": "string"
          },
          "reason": {
            "description": "Why the value is needed; kept in the audit log",
            "maxLength": 500,
            "type": "string"
          }
        },
        "required": [
          "object",
          "id",
          "field"
        ],
        "type": "object"
      },
      "RevealItem": {
        "additionalProperties": false,
        "properties": {
          "actor_id": {
            "format": "int64",
            "type": "integer"
          },
          "actor_type": {
            "type": "string"
          },
          "field": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "ip": {
            "type": "string"
          },
          "object_id": {
            "format": "int64",
            "type": "integer"
          },
          "object_type": {
            "description": "contact, conversation or attachment",
            "type": "string"
          },
          "occurred_at": {
            "format": "date-time",
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "tag": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "actor_type",
          "object_type",
          "object_id",
          "field",
          "tag",
          "occurred_at"
        ],
        "type": "object"
      },
      "RevealOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/RevealOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "field": {
            "type": "string"
          },
          "url": {
            "description": "A file: where to download it for the next ten minutes, through the API",
            "type": "string"
          },
          "values": {
            "description": "The clear values; one for single-valued fields (a file: its name)",
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "field",
          "values"
        ],
        "type": "object"
      },
      "RevealsOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/RevealsOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "_redacted": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "by_actor": {
            "description": "Who revealed, most reveals first",
            "items": {
              "$ref": "#/components/schemas/RevealActor"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "days": {
            "format": "int64",
            "type": "integer"
          },
          "recent": {
            "description": "The 50 newest reveals",
            "items": {
              "$ref": "#/components/schemas/RevealItem"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "since": {
            "format": "date-time",
            "type": "string"
          },
          "total": {
            "description": "Reveals in the window",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "days",
          "since",
          "total",
          "by_actor",
          "recent"
        ],
        "type": "object"
      },
      "RevokedOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/RevokedOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "revoked": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "revoked"
        ],
        "type": "object"
      },
      "Role": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/Role.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "description": {
            "maxLength": 500,
            "type": "string"
          },
          "fields": {
            "items": {
              "$ref": "#/components/schemas/FieldGrant"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "is_system": {
            "type": "boolean"
          },
          "name": {
            "maxLength": 80,
            "minLength": 1,
            "type": "string"
          },
          "permissions": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "visibility": {
            "items": {
              "$ref": "#/components/schemas/Visibility"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "name",
          "description",
          "is_system",
          "permissions",
          "visibility",
          "fields"
        ],
        "type": "object"
      },
      "RoleInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/RoleInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "description": {
            "maxLength": 500,
            "type": "string"
          },
          "fields": {
            "items": {
              "$ref": "#/components/schemas/FieldGrant"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "name": {
            "maxLength": 80,
            "minLength": 1,
            "type": "string"
          },
          "permissions": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "visibility": {
            "items": {
              "$ref": "#/components/schemas/Visibility"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "name",
          "permissions",
          "visibility",
          "fields"
        ],
        "type": "object"
      },
      "RoleListOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/RoleListOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "permissions": {
            "description": "The catalogue a role may hold",
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "roles": {
            "items": {
              "$ref": "#/components/schemas/Role"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "tags": {
            "description": "The field sensitivity tags",
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "roles",
          "permissions",
          "tags"
        ],
        "type": "object"
      },
      "RoleUpdateInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/RoleUpdateInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "description": {
            "maxLength": 500,
            "type": "string"
          },
          "fields": {
            "items": {
              "$ref": "#/components/schemas/FieldGrant"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "name": {
            "maxLength": 80,
            "minLength": 1,
            "type": "string"
          },
          "permissions": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "visibility": {
            "items": {
              "$ref": "#/components/schemas/Visibility"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "name",
          "permissions",
          "visibility",
          "fields"
        ],
        "type": "object"
      },
      "Row": {
        "additionalProperties": false,
        "properties": {
          "assigned": {
            "format": "int64",
            "type": "integer"
          },
          "created": {
            "format": "int64",
            "type": "integer"
          },
          "csat_responses": {
            "format": "int64",
            "type": "integer"
          },
          "csat_score": {
            "description": "Percent of responses rated 4 or 5; absent without responses",
            "format": "double",
            "type": "number"
          },
          "dimension_id": {
            "format": "int64",
            "type": "integer"
          },
          "first_response_bh_median_ms": {
            "format": "int64",
            "type": "integer"
          },
          "first_response_count": {
            "format": "int64",
            "type": "integer"
          },
          "first_response_median_ms": {
            "format": "int64",
            "type": "integer"
          },
          "label": {
            "type": "string"
          },
          "messages_out": {
            "format": "int64",
            "type": "integer"
          },
          "resolution_bh_median_ms": {
            "format": "int64",
            "type": "integer"
          },
          "resolution_median_ms": {
            "format": "int64",
            "type": "integer"
          },
          "resolved": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "dimension_id",
          "label",
          "created",
          "assigned",
          "resolved",
          "messages_out",
          "first_response_count",
          "first_response_median_ms",
          "resolution_median_ms",
          "first_response_bh_median_ms",
          "resolution_bh_median_ms",
          "csat_responses"
        ],
        "type": "object"
      },
      "Rule": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/Rule.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "actions": {
            "items": {
              "$ref": "#/components/schemas/Action"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "business_time": {
            "type": "boolean"
          },
          "conditions": {},
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "created_by": {
            "format": "int64",
            "type": "integer"
          },
          "delay_seconds": {
            "format": "int32",
            "type": "integer"
          },
          "description": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "last_run_at": {
            "format": "date-time",
            "type": "string"
          },
          "max_runs_per_hour": {
            "description": "Budget: how often the rule may act on one conversation in an hour",
            "format": "int32",
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "next_due_at": {
            "format": "date-time",
            "type": "string"
          },
          "next_due_conversation_id": {
            "description": "The conversation that is due then",
            "format": "int64",
            "type": "integer"
          },
          "paused_at": {
            "format": "date-time",
            "type": "string"
          },
          "paused_reason": {
            "enum": [
              "author_inactive"
            ],
            "type": "string"
          },
          "position": {
            "description": "Rules run in this order (ascending) for the same trigger",
            "format": "int32",
            "type": "integer"
          },
          "run_count": {
            "format": "int64",
            "type": "integer"
          },
          "threshold_seconds": {
            "format": "int32",
            "type": "integer"
          },
          "trigger": {
            "enum": [
              "conversation.created",
              "conversation.updated",
              "conversation.resolved",
              "conversation.reopened",
              "message.created",
              "conversation.handoff",
              "csat.submitted",
              "conversation.sla_breached",
              "time.customer_waiting",
              "time.no_customer_reply",
              "time.open_for"
            ],
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "description",
          "trigger",
          "conditions",
          "actions",
          "delay_seconds",
          "threshold_seconds",
          "business_time",
          "max_runs_per_hour",
          "enabled",
          "position",
          "run_count",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "RuleBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/RuleBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "actions": {
            "items": {
              "$ref": "#/components/schemas/Action"
            },
            "maxItems": 20,
            "type": [
              "array",
              "null"
            ]
          },
          "business_time": {
            "description": "Time triggers: count only the account's business hours",
            "type": "boolean"
          },
          "conditions": {
            "description": "Condition tree; {\"all\":[]} matches everything"
          },
          "delay_seconds": {
            "description": "Event triggers only: wait, then re-check the conditions",
            "format": "int32",
            "maximum": 604800,
            "minimum": 0,
            "type": "integer"
          },
          "description": {
            "maxLength": 1000,
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "max_runs_per_hour": {
            "default": 20,
            "description": "Budget per conversation per hour; past it runs are skipped as a possible loop",
            "format": "int32",
            "maximum": 100,
            "minimum": 1,
            "type": "integer"
          },
          "name": {
            "maxLength": 120,
            "minLength": 1,
            "type": "string"
          },
          "position": {
            "description": "Ignored on create (a new rule goes last); use PUT /automations/order to reorder",
            "format": "int32",
            "minimum": 0,
            "type": "integer"
          },
          "threshold_seconds": {
            "description": "Time triggers: how long the conversation must be in the state (60 s to 90 days)",
            "format": "int32",
            "maximum": 7776000,
            "minimum": 0,
            "type": "integer"
          },
          "trigger": {
            "enum": [
              "conversation.created",
              "conversation.updated",
              "conversation.resolved",
              "conversation.reopened",
              "message.created",
              "conversation.handoff",
              "csat.submitted",
              "conversation.sla_breached",
              "time.customer_waiting",
              "time.no_customer_reply",
              "time.open_for"
            ],
            "type": "string"
          }
        },
        "required": [
          "name",
          "trigger",
          "conditions",
          "actions"
        ],
        "type": "object"
      },
      "RuleOrderInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/RuleOrderInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "ids": {
            "description": "Every rule id of the workspace, in the new order",
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "maxItems": 1000,
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "ids"
        ],
        "type": "object"
      },
      "RuleTestOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/RuleTestOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "matches": {
            "type": "boolean"
          },
          "reason": {
            "type": "string"
          }
        },
        "required": [
          "matches"
        ],
        "type": "object"
      },
      "RuleTransferInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/RuleTransferInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "user_id": {
            "description": "The member who becomes the rule's author",
            "format": "int64",
            "minimum": 1,
            "type": "integer"
          }
        },
        "required": [
          "user_id"
        ],
        "type": "object"
      },
      "RulesOrderOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/RulesOrderOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "rules": {
            "items": {
              "$ref": "#/components/schemas/Rule"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "rules"
        ],
        "type": "object"
      },
      "RulesOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/RulesOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "actions": {
            "items": {
              "$ref": "#/components/schemas/ActionInfo"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "rules": {
            "items": {
              "$ref": "#/components/schemas/Rule"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "triggers": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "rules",
          "triggers",
          "actions"
        ],
        "type": "object"
      },
      "Run": {
        "additionalProperties": false,
        "properties": {
          "actions": {
            "items": {
              "$ref": "#/components/schemas/Outcome"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "conversation_id": {
            "format": "int64",
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "event_id": {
            "format": "int64",
            "type": "integer"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "reason": {
            "type": "string"
          },
          "status": {
            "enum": [
              "matched",
              "skipped",
              "failed",
              "scheduled"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "status",
          "reason",
          "actions",
          "created_at"
        ],
        "type": "object"
      },
      "RunReport": {
        "additionalProperties": false,
        "properties": {
          "conflicts": {
            "description": "Reports written before 2026-09-26 only: records changed on both sides where Kommio's version was kept",
            "items": {
              "$ref": "#/components/schemas/ReportOverwrite"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "conflicts_total": {
            "description": "Reports written before 2026-09-26 only",
            "format": "int64",
            "type": "integer"
          },
          "counts": {
            "additionalProperties": {
              "$ref": "#/components/schemas/EntityCount"
            },
            "type": "object"
          },
          "deletions": {
            "items": {
              "$ref": "#/components/schemas/ReportDeletion"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "deletions_total": {
            "format": "int64",
            "type": "integer"
          },
          "finished_at": {
            "format": "date-time",
            "type": "string"
          },
          "issues": {
            "items": {
              "$ref": "#/components/schemas/ReportIssue"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "issues_total": {
            "format": "int64",
            "type": "integer"
          },
          "kommio_work": {
            "$ref": "#/components/schemas/KommioWork"
          },
          "mass_deletes": {
            "items": {
              "$ref": "#/components/schemas/MassDelete"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "missing_attachments": {
            "items": {
              "$ref": "#/components/schemas/MissingAttachment"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "missing_attachments_total": {
            "format": "int64",
            "type": "integer"
          },
          "mode": {
            "enum": [
              "dry_run",
              "full",
              "delta"
            ],
            "type": "string"
          },
          "notes": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "overwritten": {
            "items": {
              "$ref": "#/components/schemas/ReportOverwrite"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "overwritten_total": {
            "format": "int64",
            "type": "integer"
          },
          "since": {
            "format": "date-time",
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "source_account": {
            "type": "string"
          },
          "source_label": {
            "type": "string"
          },
          "source_name": {
            "description": "The source account's name",
            "type": "string"
          },
          "started_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "source",
          "source_account",
          "mode",
          "started_at",
          "counts",
          "issues",
          "issues_total",
          "missing_attachments",
          "missing_attachments_total",
          "notes",
          "deletions",
          "deletions_total",
          "overwritten",
          "overwritten_total"
        ],
        "type": "object"
      },
      "RunsOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/RunsOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "runs": {
            "items": {
              "$ref": "#/components/schemas/Run"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "runs"
        ],
        "type": "object"
      },
      "SLALive": {
        "additionalProperties": false,
        "properties": {
          "first_response_breached": {
            "format": "int64",
            "type": "integer"
          },
          "first_response_due_soon": {
            "description": "Due within the next hour",
            "format": "int64",
            "type": "integer"
          },
          "resolution_breached": {
            "format": "int64",
            "type": "integer"
          },
          "resolution_due_soon": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "first_response_breached",
          "first_response_due_soon",
          "resolution_breached",
          "resolution_due_soon"
        ],
        "type": "object"
      },
      "SLAPoint": {
        "additionalProperties": false,
        "properties": {
          "day": {
            "type": "string"
          },
          "first_response_attainment": {
            "description": "met ÷ (met + breached), 0..1",
            "format": "double",
            "type": "number"
          },
          "first_response_breached": {
            "format": "int64",
            "type": "integer"
          },
          "first_response_met": {
            "format": "int64",
            "type": "integer"
          },
          "resolution_attainment": {
            "description": "met ÷ (met + breached), 0..1",
            "format": "double",
            "type": "number"
          },
          "resolution_breached": {
            "format": "int64",
            "type": "integer"
          },
          "resolution_met": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "day",
          "first_response_met",
          "first_response_breached",
          "first_response_attainment",
          "resolution_met",
          "resolution_breached",
          "resolution_attainment"
        ],
        "type": "object"
      },
      "SLAPolicy": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/SLAPolicy.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "business_hours": {
            "description": "Count only the inbox's business hours (its own, else the workspace's, with holidays)",
            "type": "boolean"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "first_response_minutes": {
            "description": "First response target in minutes; 0: none",
            "format": "int32",
            "type": "integer"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "inbox_ids": {
            "description": "The inboxes it applies to; empty: every inbox",
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "position": {
            "format": "int32",
            "type": "integer"
          },
          "priorities": {
            "description": "The priorities it applies to; empty: every priority",
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "resolution_minutes": {
            "description": "Resolution target (creation to resolution) in minutes; 0: none",
            "format": "int32",
            "type": "integer"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "enabled",
          "position",
          "inbox_ids",
          "priorities",
          "first_response_minutes",
          "resolution_minutes",
          "business_hours",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "SLARow": {
        "additionalProperties": false,
        "properties": {
          "deleted": {
            "description": "The policy no longer exists; its history still counts",
            "type": "boolean"
          },
          "first_response_attainment": {
            "description": "met ÷ (met + breached), 0..1",
            "format": "double",
            "type": "number"
          },
          "first_response_breached": {
            "format": "int64",
            "type": "integer"
          },
          "first_response_met": {
            "format": "int64",
            "type": "integer"
          },
          "label": {
            "type": "string"
          },
          "policy_id": {
            "format": "int64",
            "type": "integer"
          },
          "resolution_attainment": {
            "description": "met ÷ (met + breached), 0..1",
            "format": "double",
            "type": "number"
          },
          "resolution_breached": {
            "format": "int64",
            "type": "integer"
          },
          "resolution_met": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "policy_id",
          "label",
          "first_response_met",
          "first_response_breached",
          "first_response_attainment",
          "resolution_met",
          "resolution_breached",
          "resolution_attainment"
        ],
        "type": "object"
      },
      "SLATotals": {
        "additionalProperties": false,
        "properties": {
          "first_response_attainment": {
            "description": "met ÷ (met + breached), 0..1",
            "format": "double",
            "type": "number"
          },
          "first_response_breached": {
            "format": "int64",
            "type": "integer"
          },
          "first_response_met": {
            "format": "int64",
            "type": "integer"
          },
          "resolution_attainment": {
            "description": "met ÷ (met + breached), 0..1",
            "format": "double",
            "type": "number"
          },
          "resolution_breached": {
            "format": "int64",
            "type": "integer"
          },
          "resolution_met": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "first_response_met",
          "first_response_breached",
          "first_response_attainment",
          "resolution_met",
          "resolution_breached",
          "resolution_attainment"
        ],
        "type": "object"
      },
      "SSOProvider": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/SSOProvider.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "allowed_domains": {
            "description": "Only emails at these domains may sign in; empty allows any member",
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "button_label": {
            "type": "string"
          },
          "client_id": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "enabled": {
            "description": "Shown on the sign-in page and signs people in; a disabled provider can still be tested",
            "type": "boolean"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "issuer": {
            "type": "string"
          },
          "key": {
            "description": "The provider's segment in the sign-in and callback URLs",
            "type": "string"
          },
          "name": {
            "description": "Short identifier, unique in the workspace",
            "type": "string"
          },
          "redirect_url": {
            "description": "Register this redirect URI at the identity provider",
            "type": "string"
          },
          "scopes": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "secret_set": {
            "description": "The client secret is stored; it is never returned",
            "type": "boolean"
          },
          "test_url": {
            "description": "Opens a test sign-in that reports the outcome without signing in",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "key",
          "issuer",
          "client_id",
          "secret_set",
          "scopes",
          "button_label",
          "allowed_domains",
          "enabled",
          "redirect_url",
          "test_url",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "ScheduleBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ScheduleBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "agent_id": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "attachment": {
            "description": "Attach the breakdown as CSV or Excel",
            "enum": [
              "csv",
              "xlsx",
              ""
            ],
            "type": "string"
          },
          "frequency": {
            "enum": [
              "daily",
              "weekly"
            ],
            "type": "string"
          },
          "hour": {
            "description": "Local hour it leaves (default 8)",
            "format": "int64",
            "maximum": 23,
            "minimum": 0,
            "type": "integer"
          },
          "inbox_id": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "team_id": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "timezone": {
            "description": "IANA zone; empty uses the workspace's",
            "maxLength": 64,
            "type": "string"
          },
          "view_id": {
            "description": "Send a saved view (mine or a shared one)",
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "weekday": {
            "description": "Weekly: 1 = Monday .. 7 = Sunday (default Monday)",
            "format": "int64",
            "maximum": 7,
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "frequency"
        ],
        "type": "object"
      },
      "SchedulePatch": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/SchedulePatch.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "agent_id": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "attachment": {
            "enum": [
              "csv",
              "xlsx",
              ""
            ],
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "frequency": {
            "enum": [
              "daily",
              "weekly",
              ""
            ],
            "type": "string"
          },
          "hour": {
            "format": "int64",
            "maximum": 23,
            "minimum": 0,
            "type": "integer"
          },
          "inbox_id": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "team_id": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "timezone": {
            "maxLength": 64,
            "type": "string"
          },
          "view_id": {
            "description": "0 to send the schedule's own filters",
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "weekday": {
            "format": "int64",
            "maximum": 7,
            "minimum": 1,
            "type": "integer"
          }
        },
        "type": "object"
      },
      "SearchHit": {
        "additionalProperties": false,
        "properties": {
          "conversation": {
            "$ref": "#/components/schemas/Conversation"
          },
          "matched_in": {
            "enum": [
              "message",
              "subject",
              "contact"
            ],
            "type": "string"
          },
          "message_id": {
            "description": "The best matching message",
            "format": "int64",
            "type": "integer"
          },
          "rank": {
            "format": "double",
            "type": "number"
          },
          "snippet": {
            "description": "Matching fragment with <b> marks",
            "type": "string"
          }
        },
        "required": [
          "conversation",
          "snippet",
          "matched_in",
          "rank"
        ],
        "type": "object"
      },
      "SearchOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/SearchOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "_redacted": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "has_more": {
            "type": "boolean"
          },
          "hits": {
            "items": {
              "$ref": "#/components/schemas/SearchHit"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "q": {
            "type": "string"
          }
        },
        "required": [
          "hits",
          "has_more",
          "q"
        ],
        "type": "object"
      },
      "SecurityPolicy": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/SecurityPolicy.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "caller_mfa_enabled": {
            "description": "Whether the caller has two-factor on (it must be on to turn the requirement on)",
            "readOnly": true,
            "type": "boolean"
          },
          "grace_days": {
            "enum": [
              0,
              7,
              14
            ],
            "format": "int64",
            "type": "integer"
          },
          "members_without_mfa": {
            "items": {
              "$ref": "#/components/schemas/MemberMFA"
            },
            "readOnly": true,
            "type": [
              "array",
              "null"
            ]
          },
          "require_mfa": {
            "type": "boolean"
          },
          "since": {
            "description": "When the requirement was turned on",
            "format": "date-time",
            "readOnly": true,
            "type": "string"
          }
        },
        "required": [
          "require_mfa",
          "grace_days",
          "caller_mfa_enabled",
          "members_without_mfa"
        ],
        "type": "object"
      },
      "SecurityPolicyInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/SecurityPolicyInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "grace_days": {
            "description": "Days members without two-factor may keep working (7 when left out)",
            "enum": [
              0,
              7,
              14
            ],
            "format": "int64",
            "type": "integer"
          },
          "require_mfa": {
            "type": "boolean"
          }
        },
        "required": [
          "require_mfa"
        ],
        "type": "object"
      },
      "SeriesPoint": {
        "additionalProperties": false,
        "properties": {
          "assigned": {
            "format": "int64",
            "type": "integer"
          },
          "created": {
            "format": "int64",
            "type": "integer"
          },
          "first_response_bh_median_ms": {
            "format": "int64",
            "type": "integer"
          },
          "first_response_bh_p90_ms": {
            "format": "int64",
            "type": "integer"
          },
          "first_response_count": {
            "format": "int64",
            "type": "integer"
          },
          "first_response_median_ms": {
            "format": "int64",
            "type": "integer"
          },
          "first_response_p90_ms": {
            "format": "int64",
            "type": "integer"
          },
          "messages_in": {
            "format": "int64",
            "type": "integer"
          },
          "messages_out": {
            "format": "int64",
            "type": "integer"
          },
          "period": {
            "description": "First local day of the period (YYYY-MM-DD); a week starts on Monday, a month on the 1st, clipped to the window",
            "type": "string"
          },
          "reopened": {
            "format": "int64",
            "type": "integer"
          },
          "resolution_bh_median_ms": {
            "format": "int64",
            "type": "integer"
          },
          "resolution_bh_p90_ms": {
            "format": "int64",
            "type": "integer"
          },
          "resolution_count": {
            "format": "int64",
            "type": "integer"
          },
          "resolution_median_ms": {
            "format": "int64",
            "type": "integer"
          },
          "resolution_p90_ms": {
            "format": "int64",
            "type": "integer"
          },
          "resolved": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "period",
          "created",
          "resolved",
          "reopened",
          "assigned",
          "messages_in",
          "messages_out",
          "first_response_count",
          "first_response_median_ms",
          "first_response_p90_ms",
          "first_response_bh_median_ms",
          "first_response_bh_p90_ms",
          "resolution_count",
          "resolution_median_ms",
          "resolution_p90_ms",
          "resolution_bh_median_ms",
          "resolution_bh_p90_ms"
        ],
        "type": "object"
      },
      "SessionView": {
        "additionalProperties": false,
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "current": {
            "description": "The session making this request",
            "type": "boolean"
          },
          "expires_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "ip": {
            "type": "string"
          },
          "last_seen_at": {
            "description": "Updated at most once a minute",
            "format": "date-time",
            "type": "string"
          },
          "user_agent": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "current",
          "created_at",
          "last_seen_at",
          "expires_at"
        ],
        "type": "object"
      },
      "SessionsOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/SessionsOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/SessionView"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "items"
        ],
        "type": "object"
      },
      "Setting": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/Setting.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "default": {},
          "description": {
            "type": "string"
          },
          "editable": {
            "description": "Whether the caller may change it here (false for settings with their own endpoint)",
            "type": "boolean"
          },
          "enum": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "is_set": {
            "description": "For secrets: whether a value is stored",
            "type": "boolean"
          },
          "key": {
            "type": "string"
          },
          "managed_by": {
            "description": "The endpoint that changes this setting, when it is not PUT /settings/{key}",
            "type": "string"
          },
          "permission": {
            "type": "string"
          },
          "secret": {
            "type": "boolean"
          },
          "type": {
            "type": "string"
          },
          "value": {
            "description": "Absent for secrets"
          }
        },
        "required": [
          "key",
          "type",
          "description",
          "is_set",
          "secret",
          "permission",
          "editable"
        ],
        "type": "object"
      },
      "SettingPutInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/SettingPutInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "value": {
            "description": "The new value; type depends on the setting"
          }
        },
        "required": [
          "value"
        ],
        "type": "object"
      },
      "Settings": {
        "additionalProperties": false,
        "properties": {
          "comment": {
            "description": "Comment box: none, optional, or required for a rating of 1 or 2",
            "enum": [
              "off",
              "optional",
              "required_on_low"
            ],
            "type": "string"
          },
          "enabled": {
            "description": "Offer a survey when a conversation of this inbox is resolved",
            "type": "boolean"
          },
          "question": {
            "description": "The question asked; empty uses the localized default",
            "maxLength": 200,
            "type": "string"
          },
          "scale": {
            "description": "Five faces, five stars, or thumbs up and down",
            "enum": [
              "faces5",
              "stars5",
              "thumbs"
            ],
            "type": "string"
          }
        },
        "required": [
          "enabled",
          "scale",
          "comment"
        ],
        "type": "object"
      },
      "SettingsField": {
        "additionalProperties": false,
        "properties": {
          "default": {},
          "description": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "integer": {
            "type": "boolean"
          },
          "key": {
            "type": "string"
          },
          "kind": {
            "enum": [
              "string",
              "secret",
              "url",
              "enum",
              "number",
              "boolean",
              "multi_select"
            ],
            "type": "string"
          },
          "max_items": {
            "format": "int64",
            "type": "integer"
          },
          "max_length": {
            "format": "int64",
            "type": "integer"
          },
          "maximum": {
            "format": "double",
            "type": "number"
          },
          "min_items": {
            "format": "int64",
            "type": "integer"
          },
          "min_length": {
            "format": "int64",
            "type": "integer"
          },
          "minimum": {
            "format": "double",
            "type": "number"
          },
          "options": {
            "items": {
              "$ref": "#/components/schemas/SettingsOption"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "pattern": {
            "type": "string"
          },
          "placeholder": {
            "type": "string"
          },
          "required": {
            "type": "boolean"
          },
          "title": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          }
        },
        "required": [
          "key",
          "kind",
          "required",
          "title"
        ],
        "type": "object"
      },
      "SettingsListOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/SettingsListOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "settings": {
            "items": {
              "$ref": "#/components/schemas/Setting"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "settings"
        ],
        "type": "object"
      },
      "SettingsOption": {
        "additionalProperties": false,
        "properties": {
          "label": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "value": {
            "type": "string"
          }
        },
        "required": [
          "value",
          "label"
        ],
        "type": "object"
      },
      "SettingsSection": {
        "additionalProperties": false,
        "properties": {
          "default": {},
          "description": {
            "type": "string"
          },
          "key": {
            "type": "string"
          },
          "schema": {},
          "title": {
            "type": "string"
          }
        },
        "required": [
          "key",
          "title",
          "schema",
          "default"
        ],
        "type": "object"
      },
      "SignatureCheck": {
        "additionalProperties": false,
        "properties": {
          "message": {
            "description": "What was signed, or why the input is unusable",
            "type": "string"
          },
          "result": {
            "enum": [
              "valid",
              "invalid",
              "missing",
              "unusable"
            ],
            "type": "string"
          }
        },
        "required": [
          "result"
        ],
        "type": "object"
      },
      "SignatureTestInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/SignatureTestInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "attributes": {
            "description": "The attributes object, as your site sends it"
          },
          "attributes_hmac": {
            "maxLength": 200,
            "type": "string"
          },
          "email": {
            "maxLength": 200,
            "type": "string"
          },
          "email_hmac": {
            "maxLength": 200,
            "type": "string"
          },
          "hmac": {
            "maxLength": 200,
            "type": "string"
          },
          "user_id": {
            "description": "The identity's id, as your site sends it",
            "maxLength": 200,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "user_id"
        ],
        "type": "object"
      },
      "SignatureTestOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/SignatureTestOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "attributes_hmac": {
            "$ref": "#/components/schemas/SignatureCheck"
          },
          "email_hmac": {
            "$ref": "#/components/schemas/SignatureCheck"
          },
          "hmac": {
            "$ref": "#/components/schemas/SignatureCheck"
          }
        },
        "required": [
          "hmac",
          "email_hmac",
          "attributes_hmac"
        ],
        "type": "object"
      },
      "SimInput": {
        "additionalProperties": false,
        "properties": {
          "choice": {
            "description": "Index of a tapped choice on the prompt line",
            "format": "int64",
            "type": "integer"
          },
          "prompt": {
            "format": "int64",
            "type": "integer"
          },
          "resume": {
            "description": "Skip a Wait step's time",
            "type": "boolean"
          },
          "start": {
            "type": "boolean"
          },
          "text": {
            "maxLength": 4000,
            "type": "string"
          }
        },
        "type": "object"
      },
      "SimLine": {
        "additionalProperties": false,
        "properties": {
          "card": {
            "$ref": "#/components/schemas/Card"
          },
          "files": {
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "from": {
            "enum": [
              "bot",
              "visitor",
              "system"
            ],
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "node": {
            "type": "string"
          },
          "text": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "from",
          "text"
        ],
        "type": "object"
      },
      "SimState": {
        "additionalProperties": false,
        "properties": {
          "next_id": {
            "format": "int64",
            "type": "integer"
          },
          "prompt": {
            "format": "int64",
            "type": "integer"
          },
          "session": {
            "$ref": "#/components/schemas/State"
          },
          "status": {
            "type": "string"
          },
          "vars": {
            "additionalProperties": {},
            "type": "object"
          }
        },
        "required": [
          "session",
          "vars",
          "status",
          "next_id"
        ],
        "type": "object"
      },
      "SkippedWorkspace": {
        "additionalProperties": false,
        "properties": {
          "account_id": {
            "format": "int64",
            "type": "integer"
          },
          "account_name": {
            "type": "string"
          },
          "account_slug": {
            "type": "string"
          },
          "reason": {
            "description": "no_access: the person's role there cannot read conversations; two_factor_required: that workspace requires two-factor and the grace period is over; rate_limited: that workspace's request limit is spent for the moment",
            "enum": [
              "no_access",
              "two_factor_required",
              "rate_limited"
            ],
            "type": "string"
          }
        },
        "required": [
          "account_id",
          "account_slug",
          "account_name",
          "reason"
        ],
        "type": "object"
      },
      "SlaOrderInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/SlaOrderInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "ids": {
            "description": "Every policy's id, in the new order",
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "maxItems": 200,
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "ids"
        ],
        "type": "object"
      },
      "SlaPolicyBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/SlaPolicyBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "business_hours": {
            "description": "Count only the inbox's business hours",
            "type": "boolean"
          },
          "enabled": {
            "type": "boolean"
          },
          "first_response_minutes": {
            "description": "0: no first response target",
            "format": "int32",
            "maximum": 525600,
            "minimum": 0,
            "type": "integer"
          },
          "inbox_ids": {
            "description": "Empty: every inbox",
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "maxItems": 500,
            "type": [
              "array",
              "null"
            ]
          },
          "name": {
            "maxLength": 120,
            "minLength": 1,
            "type": "string"
          },
          "priorities": {
            "description": "none, low, medium, high, urgent; empty: every priority",
            "items": {
              "type": "string"
            },
            "maxItems": 5,
            "type": [
              "array",
              "null"
            ]
          },
          "resolution_minutes": {
            "description": "0: no resolution target",
            "format": "int32",
            "maximum": 525600,
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "name",
          "enabled"
        ],
        "type": "object"
      },
      "SlaPolicyListOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/SlaPolicyListOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "policies": {
            "description": "In the order they are tried: the first enabled one that matches a conversation applies",
            "items": {
              "$ref": "#/components/schemas/SLAPolicy"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "policies"
        ],
        "type": "object"
      },
      "SlaReportOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/SlaReportOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "from": {
            "type": "string"
          },
          "live": {
            "$ref": "#/components/schemas/SLALive"
          },
          "note": {
            "type": "string"
          },
          "policies": {
            "description": "Enabled SLA policies",
            "format": "int64",
            "type": "integer"
          },
          "rows": {
            "description": "One per policy; only without filters, for roles that see every conversation",
            "items": {
              "$ref": "#/components/schemas/SLARow"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "scoped": {
            "type": "boolean"
          },
          "series": {
            "items": {
              "$ref": "#/components/schemas/SLAPoint"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "to": {
            "type": "string"
          },
          "totals": {
            "$ref": "#/components/schemas/SLATotals"
          },
          "tz": {
            "type": "string"
          }
        },
        "required": [
          "from",
          "to",
          "tz",
          "policies",
          "totals",
          "series",
          "rows",
          "live",
          "scoped",
          "note"
        ],
        "type": "object"
      },
      "SlackChannelOption": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string"
          },
          "inbox_name": {
            "type": "string"
          },
          "member": {
            "description": "The app is in the channel; a private or Slack Connect channel it is not in needs /invite first",
            "type": "boolean"
          },
          "members": {
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "private": {
            "type": "boolean"
          },
          "selected": {
            "description": "The inbox listens to it",
            "type": "boolean"
          },
          "shared": {
            "description": "A Slack Connect channel shared with another organisation",
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "name",
          "private",
          "shared",
          "member",
          "selected"
        ],
        "type": "object"
      },
      "SlackChannelsOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/SlackChannelsOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "channels": {
            "items": {
              "$ref": "#/components/schemas/SlackChannelOption"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "team_name": {
            "type": "string"
          }
        },
        "required": [
          "team_name",
          "channels"
        ],
        "type": "object"
      },
      "SlackSetup": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/SlackSetup.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "configured": {
            "description": "The operator set KOMMIO_OAUTH_SLACK_CLIENT_ID, _CLIENT_SECRET and KOMMIO_SLACK_SIGNING_SECRET",
            "type": "boolean"
          },
          "env_vars": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "events": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "events_url": {
            "description": "The app's Event Subscriptions request URL",
            "type": "string"
          },
          "guide_url": {
            "type": "string"
          },
          "manifest": {
            "description": "An app manifest (YAML) with this server's addresses",
            "type": "string"
          },
          "redirect_url": {
            "description": "The app's OAuth redirect URL",
            "type": "string"
          },
          "scopes": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "configured",
          "events_url",
          "redirect_url",
          "scopes",
          "events",
          "manifest",
          "env_vars",
          "guide_url"
        ],
        "type": "object"
      },
      "SlackStartInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/SlackStartInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "inbox_id": {
            "description": "Reconnect this Slack inbox (a new token after the app was removed or its scopes changed)",
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "description": "The new inbox's name; empty names it after the workspace",
            "maxLength": 80,
            "type": "string"
          },
          "return_to": {
            "description": "Agent-app path to come back to; the new inbox's id is added as slack_inbox",
            "maxLength": 500,
            "type": "string"
          }
        },
        "type": "object"
      },
      "SlackStartOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/SlackStartOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "authorize_url": {
            "description": "Send the browser here (Slack's Add to Slack page); Slack comes back to /api/integrations/slack/callback",
            "type": "string"
          }
        },
        "required": [
          "authorize_url"
        ],
        "type": "object"
      },
      "Snippet": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/Snippet.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "body": {
            "description": "Plain text",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "locale": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "updated_by_name": {
            "type": "string"
          },
          "visibility": {
            "enum": [
              "internal",
              "ai_only"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "title",
          "body",
          "locale",
          "visibility",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "SnippetInput": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/SnippetInput.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "body": {
            "maxLength": 10000,
            "minLength": 1,
            "type": "string"
          },
          "locale": {
            "type": "string"
          },
          "title": {
            "maxLength": 200,
            "minLength": 1,
            "type": "string"
          },
          "visibility": {
            "enum": [
              "internal",
              "ai_only"
            ],
            "type": "string"
          }
        },
        "required": [
          "title",
          "body"
        ],
        "type": "object"
      },
      "Source": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/Source.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "exclude": {
            "description": "Path patterns (with *) that leave a page out",
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "file_name": {
            "type": "string"
          },
          "file_size": {
            "format": "int64",
            "type": "integer"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "include": {
            "description": "Path patterns (with *) a page must match; empty includes every page",
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "kind": {
            "enum": [
              "website",
              "file"
            ],
            "type": "string"
          },
          "last_error": {
            "type": "string"
          },
          "last_synced_at": {
            "format": "date-time",
            "type": "string"
          },
          "locale": {
            "type": "string"
          },
          "max_depth": {
            "format": "int64",
            "type": "integer"
          },
          "max_pages": {
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "page_count": {
            "description": "Pages or files giving text",
            "format": "int64",
            "type": "integer"
          },
          "start_url": {
            "type": "string"
          },
          "status": {
            "enum": [
              "queued",
              "syncing",
              "ok",
              "error"
            ],
            "type": "string"
          },
          "sync_every_hours": {
            "description": "0: only when asked",
            "format": "int64",
            "type": "integer"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "visibility": {
            "enum": [
              "internal",
              "ai_only"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "kind",
          "name",
          "max_pages",
          "max_depth",
          "include",
          "exclude",
          "sync_every_hours",
          "visibility",
          "locale",
          "status",
          "page_count",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "SourceInput": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/SourceInput.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "exclude": {
            "items": {
              "type": "string"
            },
            "maxItems": 20,
            "type": [
              "array",
              "null"
            ]
          },
          "include": {
            "items": {
              "type": "string"
            },
            "maxItems": 20,
            "type": [
              "array",
              "null"
            ]
          },
          "locale": {
            "type": "string"
          },
          "max_depth": {
            "description": "Link hops from the start page; default 3",
            "format": "int64",
            "maximum": 10,
            "minimum": 0,
            "type": "integer"
          },
          "max_pages": {
            "description": "Default 50",
            "format": "int64",
            "maximum": 500,
            "minimum": 0,
            "type": "integer"
          },
          "name": {
            "maxLength": 120,
            "minLength": 1,
            "type": "string"
          },
          "start_url": {
            "description": "A page to start from, or a sitemap (.xml)",
            "maxLength": 2000,
            "type": "string"
          },
          "sync_every_hours": {
            "description": "Default 168 (weekly); 0 syncs only when asked",
            "format": "int64",
            "maximum": 720,
            "minimum": 0,
            "type": "integer"
          },
          "visibility": {
            "description": "Default ai_only",
            "enum": [
              "internal",
              "ai_only"
            ],
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "SourcePage": {
        "additionalProperties": false,
        "properties": {
          "chars": {
            "description": "Characters of text",
            "format": "int64",
            "type": "integer"
          },
          "depth": {
            "format": "int64",
            "type": "integer"
          },
          "error": {
            "type": "string"
          },
          "excluded": {
            "type": "boolean"
          },
          "fetched_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "passages": {
            "format": "int64",
            "type": "integer"
          },
          "status": {
            "enum": [
              "ok",
              "error",
              "skipped"
            ],
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "url",
          "title",
          "status",
          "excluded",
          "chars",
          "passages",
          "depth"
        ],
        "type": "object"
      },
      "Spend": {
        "additionalProperties": false,
        "properties": {
          "period": {
            "format": "date-time",
            "type": "string"
          },
          "reserved_micros": {
            "format": "int64",
            "type": "integer"
          },
          "reserved_tokens": {
            "format": "int64",
            "type": "integer"
          },
          "used_micros": {
            "format": "int64",
            "type": "integer"
          },
          "used_tokens": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "period",
          "used_tokens",
          "used_micros",
          "reserved_tokens",
          "reserved_micros"
        ],
        "type": "object"
      },
      "SsoListOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/SsoListOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "providers": {
            "items": {
              "$ref": "#/components/schemas/SSOProvider"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "sign_in_url": {
            "description": "The sign-in page that shows this workspace's providers",
            "type": "string"
          }
        },
        "required": [
          "providers",
          "sign_in_url"
        ],
        "type": "object"
      },
      "SsoProviderBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/SsoProviderBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "allowed_domains": {
            "items": {
              "type": "string"
            },
            "maxItems": 50,
            "type": [
              "array",
              "null"
            ]
          },
          "button_label": {
            "maxLength": 60,
            "type": "string"
          },
          "client_id": {
            "maxLength": 300,
            "minLength": 1,
            "type": "string"
          },
          "client_secret": {
            "description": "Required when creating; omit on update to keep the stored one",
            "maxLength": 2000,
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "issuer": {
            "description": "The issuer URL; its /.well-known/openid-configuration must be reachable",
            "maxLength": 500,
            "minLength": 1,
            "type": "string"
          },
          "name": {
            "description": "Lower-case letters, digits and hyphens",
            "maxLength": 40,
            "minLength": 1,
            "pattern": "^[a-z0-9][a-z0-9-]*$",
            "type": "string"
          },
          "scopes": {
            "description": "Defaults to openid, email, profile; must include openid",
            "items": {
              "type": "string"
            },
            "maxItems": 20,
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "name",
          "issuer",
          "client_id",
          "enabled"
        ],
        "type": "object"
      },
      "StaffingHeat": {
        "additionalProperties": false,
        "properties": {
          "inbound": {
            "description": "Conversations created",
            "items": {
              "items": {
                "format": "int64",
                "type": "integer"
              },
              "maxItems": 24,
              "minItems": 24,
              "type": [
                "array",
                "null"
              ]
            },
            "maxItems": 7,
            "minItems": 7,
            "type": [
              "array",
              "null"
            ]
          },
          "messages": {
            "description": "Replies received from customers",
            "items": {
              "items": {
                "format": "int64",
                "type": "integer"
              },
              "maxItems": 24,
              "minItems": 24,
              "type": [
                "array",
                "null"
              ]
            },
            "maxItems": 7,
            "minItems": 7,
            "type": [
              "array",
              "null"
            ]
          },
          "online": {
            "description": "Agents online on average",
            "items": {
              "items": {
                "format": "double",
                "type": "number"
              },
              "maxItems": 24,
              "minItems": 24,
              "type": [
                "array",
                "null"
              ]
            },
            "maxItems": 7,
            "minItems": 7,
            "type": [
              "array",
              "null"
            ]
          },
          "per_agent_hour": {
            "description": "Conversations created per agent-hour online (0 without anyone online)",
            "items": {
              "items": {
                "format": "double",
                "type": "number"
              },
              "maxItems": 24,
              "minItems": 24,
              "type": [
                "array",
                "null"
              ]
            },
            "maxItems": 7,
            "minItems": 7,
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "inbound",
          "messages",
          "online",
          "per_agent_hour"
        ],
        "type": "object"
      },
      "StaffingOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/StaffingOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "from": {
            "type": "string"
          },
          "heatmap": {
            "$ref": "#/components/schemas/StaffingHeat"
          },
          "note": {
            "type": "string"
          },
          "rows": {
            "description": "One per agent online in the window; not for roles that see part of the workspace",
            "items": {
              "$ref": "#/components/schemas/StaffingRow"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "scoped": {
            "type": "boolean"
          },
          "to": {
            "type": "string"
          },
          "totals": {
            "$ref": "#/components/schemas/StaffingTotals"
          },
          "tz": {
            "type": "string"
          }
        },
        "required": [
          "from",
          "to",
          "tz",
          "totals",
          "heatmap",
          "rows",
          "scoped",
          "note"
        ],
        "type": "object"
      },
      "StaffingRow": {
        "additionalProperties": false,
        "properties": {
          "agent_id": {
            "format": "int64",
            "type": "integer"
          },
          "concurrency": {
            "format": "double",
            "type": "number"
          },
          "label": {
            "type": "string"
          },
          "occupancy": {
            "format": "double",
            "type": "number"
          },
          "online_hours": {
            "format": "double",
            "type": "number"
          }
        },
        "required": [
          "agent_id",
          "label",
          "online_hours",
          "occupancy",
          "concurrency"
        ],
        "type": "object"
      },
      "StaffingTotals": {
        "additionalProperties": false,
        "properties": {
          "avg_online": {
            "description": "Agents online at a time, on average over the samples",
            "format": "double",
            "type": "number"
          },
          "concurrency": {
            "description": "Open conversations held at once by an agent while holding any, on average",
            "format": "double",
            "type": "number"
          },
          "inbound": {
            "description": "Conversations created",
            "format": "int64",
            "type": "integer"
          },
          "inbound_per_agent_hour": {
            "description": "Conversations created per agent-hour online",
            "format": "double",
            "type": "number"
          },
          "occupancy": {
            "description": "Share of online time spent holding at least one open conversation, 0..1",
            "format": "double",
            "type": "number"
          },
          "online_hours": {
            "description": "Agent-hours online (each online agent in a sample counts 15 minutes)",
            "format": "double",
            "type": "number"
          },
          "people": {
            "description": "Whose presence the online numbers count: the filtered agent's, the filtered team's members', else the whole workspace's",
            "enum": [
              "workspace",
              "team",
              "agent"
            ],
            "type": "string"
          },
          "samples": {
            "description": "Staffing samples taken in the window (every 15 minutes while the workspace's agents use the app)",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "samples",
          "online_hours",
          "avg_online",
          "occupancy",
          "concurrency",
          "inbound",
          "inbound_per_agent_hour",
          "people"
        ],
        "type": "object"
      },
      "State": {
        "additionalProperties": false,
        "properties": {
          "flow_id": {
            "format": "int64",
            "type": "integer"
          },
          "node": {
            "type": "string"
          },
          "retries": {
            "format": "int64",
            "type": "integer"
          },
          "stack": {
            "items": {
              "$ref": "#/components/schemas/Frame"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "version": {
            "format": "int64",
            "type": "integer"
          },
          "waiting": {
            "type": "string"
          }
        },
        "required": [
          "flow_id",
          "version",
          "node"
        ],
        "type": "object"
      },
      "Stats": {
        "additionalProperties": false,
        "properties": {
          "abandoned": {
            "format": "int64",
            "type": "integer"
          },
          "active": {
            "format": "int64",
            "type": "integer"
          },
          "completed": {
            "format": "int64",
            "type": "integer"
          },
          "completion_rate": {
            "description": "Completed sessions over sessions that ended (0 to 1)",
            "format": "double",
            "type": "number"
          },
          "handed_off": {
            "format": "int64",
            "type": "integer"
          },
          "handoff_rate": {
            "description": "Handed-off sessions over sessions that ended (0 to 1)",
            "format": "double",
            "type": "number"
          },
          "sessions": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "sessions",
          "completed",
          "handed_off",
          "abandoned",
          "active",
          "completion_rate",
          "handoff_rate"
        ],
        "type": "object"
      },
      "Status": {
        "additionalProperties": false,
        "properties": {
          "default": {
            "description": "The installation's default for this limit; 0 is unlimited",
            "format": "int64",
            "type": "integer"
          },
          "key": {
            "enum": [
              "members",
              "inboxes",
              "contacts",
              "apps",
              "storage_bytes",
              "conversations_per_month",
              "messages_per_month",
              "outbound_messages_per_day",
              "webhook_deliveries_per_day"
            ],
            "type": "string"
          },
          "limit": {
            "description": "0 is unlimited",
            "format": "int64",
            "type": "integer"
          },
          "metered": {
            "description": "False when the use cannot be measured on this installation (storage without a meter)",
            "type": "boolean"
          },
          "overridden": {
            "description": "A platform admin set this workspace's limit",
            "type": "boolean"
          },
          "period": {
            "enum": [
              "total",
              "day",
              "month"
            ],
            "type": "string"
          },
          "resets_at": {
            "description": "When a daily or monthly count starts over",
            "format": "date-time",
            "type": "string"
          },
          "used": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "key",
          "period",
          "limit",
          "used",
          "metered",
          "overridden",
          "default"
        ],
        "type": "object"
      },
      "StorageUsage": {
        "additionalProperties": false,
        "properties": {
          "bytes": {
            "format": "int64",
            "type": "integer"
          },
          "category": {
            "enum": [
              "attachments",
              "previews",
              "knowledge",
              "flows",
              "branding",
              "raw_mail"
            ],
            "type": "string"
          },
          "files": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "category",
          "bytes",
          "files"
        ],
        "type": "object"
      },
      "Suggestion": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/Suggestion.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "answer": {
            "type": "string"
          },
          "article_id": {
            "format": "int64",
            "type": "integer"
          },
          "conversation_ids": {
            "description": "Where it was learned (the newest 20)",
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "locale": {
            "type": "string"
          },
          "occurrences": {
            "description": "Conversations it came up in (near-duplicates merged)",
            "format": "int64",
            "type": "integer"
          },
          "question": {
            "type": "string"
          },
          "reviewed_at": {
            "format": "date-time",
            "type": "string"
          },
          "reviewed_by_name": {
            "type": "string"
          },
          "snippet_id": {
            "format": "int64",
            "type": "integer"
          },
          "status": {
            "enum": [
              "pending",
              "approved",
              "rejected"
            ],
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "question",
          "answer",
          "locale",
          "status",
          "occurrences",
          "conversation_ids",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "SuggestionEdit": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/SuggestionEdit.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "answer": {
            "maxLength": 5000,
            "minLength": 3,
            "type": "string"
          },
          "question": {
            "maxLength": 300,
            "minLength": 3,
            "type": "string"
          }
        },
        "required": [
          "question",
          "answer"
        ],
        "type": "object"
      },
      "SurveyAnswerBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/SurveyAnswerBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "comment": {
            "maxLength": 1000,
            "type": "string"
          },
          "value": {
            "description": "1 to 5 on faces5 and stars5; up or down on thumbs",
            "maxLength": 8,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "value"
        ],
        "type": "object"
      },
      "SurveyView": {
        "additionalProperties": false,
        "properties": {
          "closed_reason": {
            "description": "Why it cannot: the conversation was reopened, the 7 days passed, or the answer can no longer be changed",
            "enum": [
              "reopened",
              "expired",
              "rated"
            ],
            "type": "string"
          },
          "comment": {
            "enum": [
              "off",
              "optional",
              "required_on_low"
            ],
            "type": "string"
          },
          "expires_at": {
            "format": "date-time",
            "type": "string"
          },
          "open": {
            "description": "The survey can be answered (or the answer changed) now",
            "type": "boolean"
          },
          "question": {
            "description": "The inbox's own question; empty means the localized default",
            "type": "string"
          },
          "response": {
            "$ref": "#/components/schemas/SurveyViewAnswer"
          },
          "scale": {
            "enum": [
              "faces5",
              "stars5",
              "thumbs"
            ],
            "type": "string"
          }
        },
        "required": [
          "scale",
          "comment",
          "open",
          "expires_at"
        ],
        "type": "object"
      },
      "SurveyViewAnswer": {
        "additionalProperties": false,
        "properties": {
          "comment": {
            "type": "string"
          },
          "editable_until": {
            "format": "date-time",
            "type": "string"
          },
          "rating": {
            "format": "int64",
            "maximum": 5,
            "minimum": 1,
            "type": "integer"
          },
          "value": {
            "type": "string"
          }
        },
        "required": [
          "value",
          "rating"
        ],
        "type": "object"
      },
      "SuspendedWorkspace": {
        "additionalProperties": false,
        "properties": {
          "account_id": {
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "account_id",
          "name"
        ],
        "type": "object"
      },
      "SwitchInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/SwitchInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "account_id": {
            "format": "int64",
            "minimum": 1,
            "type": "integer"
          }
        },
        "required": [
          "account_id"
        ],
        "type": "object"
      },
      "TOCEntry": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string"
          },
          "level": {
            "format": "int64",
            "type": "integer"
          },
          "text": {
            "type": "string"
          }
        },
        "required": [
          "level",
          "id",
          "text"
        ],
        "type": "object"
      },
      "TableOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/TableOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "dimension": {
            "type": "string"
          },
          "next_cursor": {
            "description": "Pass as cursor for the next page; absent on the last",
            "type": "string"
          },
          "rows": {
            "description": "Ordered by dimension_id",
            "items": {
              "$ref": "#/components/schemas/Row"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "total": {
            "description": "Rows in the whole breakdown (every page)",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "dimension",
          "rows",
          "total"
        ],
        "type": "object"
      },
      "Tag": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/Tag.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "color": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ],
        "type": "object"
      },
      "TagInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/TagInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "color": {
            "maxLength": 20,
            "type": "string"
          },
          "name": {
            "maxLength": 60,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "TagUpdateInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/TagUpdateInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "color": {
            "maxLength": 20,
            "type": "string"
          },
          "name": {
            "maxLength": 60,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "TagsOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/TagsOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "tags": {
            "items": {
              "$ref": "#/components/schemas/Tag"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "tags"
        ],
        "type": "object"
      },
      "Team": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/Team.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "assign_outside_hours": {
            "description": "Also assign when the business hours are closed",
            "type": "boolean"
          },
          "auto_assign": {
            "description": "Round robin new conversations of this team to its online members",
            "type": "boolean"
          },
          "capacity_per_agent": {
            "description": "Open conversations an agent may hold before being skipped; 0 = unlimited",
            "format": "int32",
            "type": "integer"
          },
          "description": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "member_ids": {
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "reassign_after_minutes": {
            "description": "Minutes offline before their conversations move",
            "format": "int32",
            "type": "integer"
          },
          "reassign_offline": {
            "description": "When a member goes offline, their open conversations of this team waiting for a reply are kept (off), returned to the queue (queue) or given to someone online (reassign)",
            "enum": [
              "off",
              "queue",
              "reassign"
            ],
            "type": "string"
          },
          "routing": {
            "description": "round_robin: the member after the last one given a conversation; balanced: the member with the lowest open load against their capacity",
            "enum": [
              "round_robin",
              "balanced"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "description",
          "member_ids",
          "auto_assign",
          "capacity_per_agent",
          "assign_outside_hours",
          "routing",
          "reassign_offline",
          "reassign_after_minutes"
        ],
        "type": "object"
      },
      "TeamBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/TeamBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "assign_outside_hours": {
            "type": "boolean"
          },
          "auto_assign": {
            "type": "boolean"
          },
          "capacity_per_agent": {
            "format": "int32",
            "maximum": 1000,
            "minimum": 0,
            "type": "integer"
          },
          "description": {
            "maxLength": 500,
            "type": "string"
          },
          "name": {
            "maxLength": 80,
            "minLength": 1,
            "type": "string"
          },
          "reassign_after_minutes": {
            "description": "Omitted keeps",
            "format": "int32",
            "maximum": 1440,
            "minimum": 1,
            "type": "integer"
          },
          "reassign_offline": {
            "description": "Omitted keeps",
            "enum": [
              "off",
              "queue",
              "reassign",
              ""
            ],
            "type": "string"
          },
          "routing": {
            "description": "Omitted keeps",
            "enum": [
              "round_robin",
              "balanced",
              ""
            ],
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "TeamListOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/TeamListOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "teams": {
            "items": {
              "$ref": "#/components/schemas/Team"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "teams"
        ],
        "type": "object"
      },
      "TeamMembersInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/TeamMembersInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "user_ids": {
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "maxItems": 500,
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "user_ids"
        ],
        "type": "object"
      },
      "Tiles": {
        "additionalProperties": false,
        "properties": {
          "assigned": {
            "format": "int64",
            "type": "integer"
          },
          "created": {
            "format": "int64",
            "type": "integer"
          },
          "first_response_bh_median_ms": {
            "description": "First response counted in business hours (the inbox's, else the workspace's, with holidays)",
            "format": "int64",
            "type": "integer"
          },
          "first_response_bh_p90_ms": {
            "format": "int64",
            "type": "integer"
          },
          "first_response_count": {
            "format": "int64",
            "type": "integer"
          },
          "first_response_median_ms": {
            "format": "int64",
            "type": "integer"
          },
          "first_response_p90_ms": {
            "format": "int64",
            "type": "integer"
          },
          "messages_in": {
            "format": "int64",
            "type": "integer"
          },
          "messages_out": {
            "format": "int64",
            "type": "integer"
          },
          "reopened": {
            "format": "int64",
            "type": "integer"
          },
          "resolution_bh_median_ms": {
            "description": "Resolution counted in business hours",
            "format": "int64",
            "type": "integer"
          },
          "resolution_bh_p90_ms": {
            "format": "int64",
            "type": "integer"
          },
          "resolution_count": {
            "format": "int64",
            "type": "integer"
          },
          "resolution_median_ms": {
            "format": "int64",
            "type": "integer"
          },
          "resolution_p90_ms": {
            "format": "int64",
            "type": "integer"
          },
          "resolved": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "created",
          "resolved",
          "reopened",
          "assigned",
          "messages_in",
          "messages_out",
          "first_response_median_ms",
          "first_response_p90_ms",
          "first_response_count",
          "resolution_median_ms",
          "resolution_p90_ms",
          "resolution_count",
          "first_response_bh_median_ms",
          "first_response_bh_p90_ms",
          "resolution_bh_median_ms",
          "resolution_bh_p90_ms"
        ],
        "type": "object"
      },
      "TimeseriesOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/TimeseriesOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "from": {
            "type": "string"
          },
          "interval": {
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "points": {
            "description": "One per period, oldest first; at most 400 days, so never paginated",
            "items": {
              "$ref": "#/components/schemas/SeriesPoint"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "scoped": {
            "description": "The numbers are limited to what the caller (or the key's maker) may see",
            "type": "boolean"
          },
          "to": {
            "type": "string"
          },
          "tz": {
            "description": "The zone the series was computed in",
            "type": "string"
          }
        },
        "required": [
          "from",
          "to",
          "tz",
          "interval",
          "points",
          "scoped",
          "note"
        ],
        "type": "object"
      },
      "TransferCandidate": {
        "additionalProperties": false,
        "properties": {
          "email": {
            "type": "string"
          },
          "missing": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "takes": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "user_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "user_id",
          "name",
          "email",
          "role",
          "takes"
        ],
        "type": "object"
      },
      "TranslationInput": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/TranslationInput.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "body_html": {
            "maxLength": 500000,
            "type": "string"
          },
          "body_markdown": {
            "description": "Used instead of body_html when set",
            "maxLength": 500000,
            "type": "string"
          },
          "excerpt": {
            "description": "Derived from the body when empty",
            "maxLength": 300,
            "type": "string"
          },
          "seo_description": {
            "maxLength": 300,
            "type": "string"
          },
          "seo_title": {
            "maxLength": 120,
            "type": "string"
          },
          "slug": {
            "description": "Derived from the title when empty",
            "maxLength": 120,
            "type": "string"
          },
          "title": {
            "maxLength": 200,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "title"
        ],
        "type": "object"
      },
      "URLMatch": {
        "additionalProperties": false,
        "properties": {
          "kind": {
            "type": "string"
          },
          "pattern": {
            "type": "string"
          }
        },
        "required": [
          "kind",
          "pattern"
        ],
        "type": "object"
      },
      "UTM": {
        "additionalProperties": false,
        "properties": {
          "campaign": {
            "maxLength": 200,
            "type": "string"
          },
          "content": {
            "maxLength": 200,
            "type": "string"
          },
          "medium": {
            "maxLength": 200,
            "type": "string"
          },
          "source": {
            "maxLength": 200,
            "type": "string"
          },
          "term": {
            "maxLength": 200,
            "type": "string"
          }
        },
        "type": "object"
      },
      "UndeclaredKey": {
        "additionalProperties": false,
        "properties": {
          "contacts": {
            "description": "Contacts whose signed attributes carry it",
            "format": "int64",
            "type": "integer"
          },
          "example": {
            "description": "One value, cut to 60 characters",
            "type": "string"
          },
          "key": {
            "type": "string"
          },
          "type": {
            "description": "The type its values suggest",
            "enum": [
              "text",
              "number",
              "bool",
              "date",
              "link"
            ],
            "type": "string"
          }
        },
        "required": [
          "key",
          "contacts",
          "type",
          "example"
        ],
        "type": "object"
      },
      "UndeclaredOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/UndeclaredOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "keys": {
            "items": {
              "$ref": "#/components/schemas/UndeclaredKey"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "keys"
        ],
        "type": "object"
      },
      "UnsubOutBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/UnsubOutBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "frequency": {
            "type": "string"
          },
          "workspace": {
            "type": "string"
          }
        },
        "required": [
          "workspace",
          "frequency",
          "enabled"
        ],
        "type": "object"
      },
      "Usage": {
        "additionalProperties": false,
        "properties": {
          "cache_read_tokens": {
            "format": "int64",
            "type": "integer"
          },
          "cache_write_tokens": {
            "format": "int64",
            "type": "integer"
          },
          "input_tokens": {
            "format": "int64",
            "type": "integer"
          },
          "output_tokens": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "input_tokens",
          "output_tokens",
          "cache_read_tokens",
          "cache_write_tokens"
        ],
        "type": "object"
      },
      "UsageEventsInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/UsageEventsInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "events": {
            "items": {
              "$ref": "#/components/schemas/Item"
            },
            "maxItems": 50,
            "minItems": 1,
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "events"
        ],
        "type": "object"
      },
      "UsageRow": {
        "additionalProperties": false,
        "properties": {
          "calls": {
            "format": "int64",
            "type": "integer"
          },
          "cost_micros": {
            "description": "Estimated cost in millionths of a US dollar",
            "format": "int64",
            "type": "integer"
          },
          "errors": {
            "format": "int64",
            "type": "integer"
          },
          "input_tokens": {
            "description": "Input tokens, cache reads and writes included",
            "format": "int64",
            "type": "integer"
          },
          "key": {
            "description": "The feature, the user id, the day (YYYY-MM-DD) or the model",
            "type": "string"
          },
          "label": {
            "description": "The person's name for the by-user groups",
            "type": "string"
          },
          "output_tokens": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "key",
          "calls",
          "errors",
          "input_tokens",
          "output_tokens",
          "cost_micros"
        ],
        "type": "object"
      },
      "Variable": {
        "additionalProperties": false,
        "properties": {
          "label": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "Version": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "published_at": {
            "format": "date-time",
            "type": "string"
          },
          "published_by": {
            "format": "int64",
            "type": "integer"
          },
          "version": {
            "format": "int32",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "version",
          "published_at"
        ],
        "type": "object"
      },
      "View": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/View.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "conditions": {
            "description": "Condition tree: {all|any:[...]}, {not:{...}} or {field, op, value}"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "description": {
            "description": "The condition in words",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "maxLength": 80,
            "type": "string"
          },
          "object": {
            "description": "What the view filters",
            "enum": [
              "conversation",
              "contact"
            ],
            "type": "string"
          },
          "owner_user_id": {
            "format": "int64",
            "type": "integer"
          },
          "position": {
            "format": "int32",
            "type": "integer"
          },
          "shared": {
            "description": "Visible to everyone in the account; otherwise only to its owner",
            "type": "boolean"
          },
          "sort": {
            "enum": [
              "last_activity",
              "oldest_waiting",
              "priority",
              "created"
            ],
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "object",
          "name",
          "shared",
          "conditions",
          "description",
          "sort",
          "position",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "ViewInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ViewInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "conditions": {},
          "name": {
            "maxLength": 80,
            "minLength": 1,
            "type": "string"
          },
          "object": {
            "description": "What the view filters; conversation when left out. Fixed once saved",
            "enum": [
              "conversation",
              "contact",
              ""
            ],
            "type": "string"
          },
          "position": {
            "format": "int32",
            "minimum": 0,
            "type": "integer"
          },
          "shared": {
            "type": "boolean"
          },
          "sort": {
            "enum": [
              "last_activity",
              "oldest_waiting",
              "priority",
              "created",
              ""
            ],
            "type": "string"
          }
        },
        "required": [
          "name",
          "conditions"
        ],
        "type": "object"
      },
      "ViewSchema": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ViewSchema.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "fields": {
            "items": {
              "$ref": "#/components/schemas/Field"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "ops": {
            "additionalProperties": {
              "items": {
                "type": "string"
              },
              "type": [
                "array",
                "null"
              ]
            },
            "type": "object"
          }
        },
        "required": [
          "fields",
          "ops"
        ],
        "type": "object"
      },
      "ViewUpdateInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ViewUpdateInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "conditions": {},
          "name": {
            "maxLength": 80,
            "minLength": 1,
            "type": "string"
          },
          "position": {
            "format": "int32",
            "minimum": 0,
            "type": "integer"
          },
          "shared": {
            "type": "boolean"
          },
          "sort": {
            "enum": [
              "last_activity",
              "oldest_waiting",
              "priority",
              "created",
              ""
            ],
            "type": "string"
          }
        },
        "required": [
          "name",
          "conditions"
        ],
        "type": "object"
      },
      "ViewsOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/ViewsOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "views": {
            "items": {
              "$ref": "#/components/schemas/View"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "views"
        ],
        "type": "object"
      },
      "Visibility": {
        "additionalProperties": false,
        "properties": {
          "resource": {
            "enum": [
              "conversations",
              "contacts"
            ],
            "type": "string"
          },
          "scope": {
            "enum": [
              "all",
              "team",
              "inbox",
              "assigned",
              "unassigned"
            ],
            "type": "string"
          },
          "verb": {
            "enum": [
              "read",
              "reply",
              "manage"
            ],
            "type": "string"
          }
        },
        "required": [
          "resource",
          "scope",
          "verb"
        ],
        "type": "object"
      },
      "VisitorContext": {
        "additionalProperties": false,
        "properties": {
          "ad_platform": {
            "type": "string"
          },
          "asn": {
            "format": "int64",
            "type": "integer"
          },
          "browser": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "collected_at": {
            "description": "When the visitor's first message (or first session after writing) delivered it",
            "format": "date-time",
            "type": "string"
          },
          "conversation_id": {
            "format": "int64",
            "type": "integer"
          },
          "country": {
            "type": "string"
          },
          "country_code": {
            "type": "string"
          },
          "current_page": {
            "$ref": "#/components/schemas/PageVisit"
          },
          "device": {
            "enum": [
              "desktop",
              "mobile",
              "tablet",
              "bot"
            ],
            "type": "string"
          },
          "first_seen_at": {
            "format": "date-time",
            "type": "string"
          },
          "geo_attribution": {
            "description": "Credit to show next to the location (DB-IP licence)",
            "type": "string"
          },
          "ip": {
            "description": "Full, shortened (IPv4 /24, IPv6 /48) or absent per the workspace's privacy.visitor_ip",
            "type": "string"
          },
          "js_errors": {
            "items": {
              "$ref": "#/components/schemas/JSError"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "landing_page": {
            "type": "string"
          },
          "languages": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "likely_vpn": {
            "description": "The network belongs to a hosting or VPN provider (best effort)",
            "type": "boolean"
          },
          "org": {
            "description": "The network's organisation",
            "type": "string"
          },
          "os": {
            "type": "string"
          },
          "page_context": {
            "additionalProperties": {},
            "description": "Provided by the customer's page through Kommio.setContext; unverified",
            "type": "object"
          },
          "page_context_at": {
            "format": "date-time",
            "type": "string"
          },
          "referrer": {
            "type": "string"
          },
          "region": {
            "type": "string"
          },
          "screen": {
            "type": "string"
          },
          "session_started_at": {
            "format": "date-time",
            "type": "string"
          },
          "timezone": {
            "type": "string"
          },
          "tor": {
            "type": "boolean"
          },
          "trail": {
            "items": {
              "$ref": "#/components/schemas/PageVisit"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "user_agent": {
            "type": "string"
          },
          "utm": {
            "$ref": "#/components/schemas/UTM"
          },
          "visit_count": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "conversation_id",
          "collected_at",
          "updated_at",
          "tor",
          "likely_vpn",
          "languages",
          "trail",
          "js_errors"
        ],
        "type": "object"
      },
      "VisitorContextOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/VisitorContextOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "_redacted": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "online": {
            "type": "boolean"
          },
          "past_conversations": {
            "format": "int64",
            "type": "integer"
          },
          "visitor": {
            "$ref": "#/components/schemas/VisitorContext"
          }
        },
        "required": [
          "online",
          "past_conversations"
        ],
        "type": "object"
      },
      "VisitorsOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/VisitorsOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "visitors": {
            "items": {
              "$ref": "#/components/schemas/OnlineVisitor"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "visitors"
        ],
        "type": "object"
      },
      "Webhook": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/Webhook.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "consecutive_failures": {
            "format": "int32",
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "events": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "secret": {
            "description": "Shown once",
            "type": "string"
          },
          "status": {
            "enum": [
              "active",
              "paused",
              "failing"
            ],
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "url",
          "events",
          "status",
          "created_at",
          "consecutive_failures"
        ],
        "type": "object"
      },
      "WebhookBudget": {
        "additionalProperties": false,
        "properties": {
          "failing_notice_after": {
            "description": "Failed deliveries in a row after which the administrators are notified; 0 is off (setting webhooks.failing_notice_after)",
            "format": "int64",
            "type": "integer"
          },
          "limit": {
            "description": "Deliveries per UTC day; 0 is unlimited (setting webhooks.daily_budget)",
            "format": "int64",
            "type": "integer"
          },
          "over_budget_today": {
            "description": "Deliveries recorded today as over budget and not sent",
            "format": "int64",
            "type": "integer"
          },
          "reached": {
            "type": "boolean"
          },
          "resets_at": {
            "description": "Start of the next UTC day",
            "format": "date-time",
            "type": "string"
          },
          "used_today": {
            "description": "Deliveries recorded today within the budget",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "limit",
          "used_today",
          "over_budget_today",
          "reached",
          "resets_at",
          "failing_notice_after"
        ],
        "type": "object"
      },
      "WebhookHealth": {
        "additionalProperties": false,
        "properties": {
          "delivered_24h": {
            "format": "int64",
            "type": "integer"
          },
          "failed_24h": {
            "format": "int64",
            "type": "integer"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "pending": {
            "format": "int64",
            "type": "integer"
          },
          "status": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "status",
          "pending",
          "failed_24h",
          "delivered_24h"
        ],
        "type": "object"
      },
      "WebhookInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/WebhookInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "events": {
            "description": "Event types, or [\"*\"]",
            "items": {
              "type": "string"
            },
            "maxItems": 50,
            "minItems": 1,
            "type": [
              "array",
              "null"
            ]
          },
          "name": {
            "maxLength": 80,
            "minLength": 1,
            "type": "string"
          },
          "url": {
            "format": "uri",
            "maxLength": 2000,
            "type": "string"
          }
        },
        "required": [
          "name",
          "url",
          "events"
        ],
        "type": "object"
      },
      "WebhookUpdateInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/WebhookUpdateInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "events": {
            "items": {
              "type": "string"
            },
            "maxItems": 50,
            "minItems": 1,
            "type": [
              "array",
              "null"
            ]
          },
          "name": {
            "maxLength": 80,
            "minLength": 1,
            "type": "string"
          },
          "status": {
            "enum": [
              "active",
              "paused",
              ""
            ],
            "type": "string"
          },
          "url": {
            "format": "uri",
            "maxLength": 2000,
            "type": "string"
          }
        },
        "required": [
          "name",
          "url",
          "events"
        ],
        "type": "object"
      },
      "WebhooksOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/WebhooksOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "budget": {
            "$ref": "#/components/schemas/WebhookBudget"
          },
          "event_types": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "webhooks": {
            "items": {
              "$ref": "#/components/schemas/Webhook"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "webhooks",
          "event_types",
          "budget"
        ],
        "type": "object"
      },
      "WeekActivity": {
        "additionalProperties": false,
        "properties": {
          "active_agents": {
            "format": "int64",
            "type": "integer"
          },
          "end": {
            "type": "string"
          },
          "sign_in_people": {
            "format": "int64",
            "type": "integer"
          },
          "sign_ins": {
            "format": "int64",
            "type": "integer"
          },
          "start": {
            "type": "string"
          }
        },
        "required": [
          "start",
          "end",
          "active_agents",
          "sign_ins",
          "sign_in_people"
        ],
        "type": "object"
      },
      "WeekTrend": {
        "additionalProperties": false,
        "properties": {
          "active_agents": {
            "format": "int64",
            "type": "integer"
          },
          "prev_active_agents": {
            "format": "int64",
            "type": "integer"
          },
          "prev_sign_ins": {
            "format": "int64",
            "type": "integer"
          },
          "sign_ins": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "active_agents",
          "prev_active_agents",
          "sign_ins",
          "prev_sign_ins"
        ],
        "type": "object"
      },
      "WidgetAgent": {
        "additionalProperties": false,
        "properties": {
          "initials": {
            "type": "string"
          },
          "name": {
            "description": "First name",
            "type": "string"
          }
        },
        "required": [
          "name",
          "initials"
        ],
        "type": "object"
      },
      "WidgetAttachment": {
        "additionalProperties": false,
        "properties": {
          "content_type": {
            "type": "string"
          },
          "file_name": {
            "type": "string"
          },
          "height": {
            "format": "int32",
            "type": "integer"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "image": {
            "description": "Shown inline (PNG, JPEG, GIF or WebP)",
            "type": "boolean"
          },
          "removed": {
            "description": "The virus scanner flagged the file and it was removed: url is empty",
            "type": "boolean"
          },
          "size": {
            "format": "int64",
            "type": "integer"
          },
          "thumb_url": {
            "description": "The same link for a preview 320 pixels on the long edge, once made",
            "type": "string"
          },
          "url": {
            "description": "Signed download link, valid for 10 minutes",
            "type": "string"
          },
          "width": {
            "format": "int32",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "file_name",
          "content_type",
          "size",
          "image",
          "url"
        ],
        "type": "object"
      },
      "WidgetChoice": {
        "additionalProperties": false,
        "properties": {
          "index": {
            "format": "int64",
            "maximum": 9,
            "minimum": 0,
            "type": "integer"
          },
          "message_id": {
            "description": "The message that offered the choice",
            "format": "int64",
            "minimum": 1,
            "type": "integer"
          }
        },
        "required": [
          "message_id",
          "index"
        ],
        "type": "object"
      },
      "WidgetConfig": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/WidgetConfig.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "ask_email": {
            "description": "Whether the chat asks for an email while nobody can answer (offline or outside business hours)",
            "enum": [
              "off",
              "optional",
              "required"
            ],
            "type": "string"
          },
          "capture_js_errors": {
            "description": "The widget may send the page's recent JavaScript errors with the visitor context",
            "type": "boolean"
          },
          "color": {
            "type": "string"
          },
          "files": {
            "$ref": "#/components/schemas/WidgetFileRules",
            "description": "What the visitor may attach"
          },
          "fingerprinting": {
            "description": "The widget may send a browser fingerprint for anonymous continuity",
            "type": "boolean"
          },
          "greeting": {
            "type": "string"
          },
          "help": {
            "$ref": "#/components/schemas/WidgetHelpInfo"
          },
          "hours_open": {
            "description": "The inbox is within its business hours now",
            "type": "boolean"
          },
          "launcher": {
            "$ref": "#/components/schemas/WidgetLauncher",
            "description": "How the launcher looks (the inbox's launcher setting with the defaults filled in)"
          },
          "logo": {
            "description": "Wordmark URL for the header: the inbox's (config.brand), else the workspace's published branding.logo_url; shown 32 px tall",
            "type": "string"
          },
          "logo_dark": {
            "description": "Wordmark for the dark theme (the dark variant of the same source, else its light one)",
            "type": "string"
          },
          "mark": {
            "description": "Square mark URL for the launcher: the inbox's (config.brand), else the workspace's published branding.mark_url; shown at 28 px",
            "type": "string"
          },
          "mark_dark": {
            "description": "Square mark for the dark theme (the dark variant of the same source, else its light one)",
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "offline_message": {
            "type": "string"
          },
          "online": {
            "description": "At least one inbox member is connected",
            "type": "boolean"
          },
          "prechat": {
            "$ref": "#/components/schemas/Prechat"
          },
          "preview_text": {
            "description": "The preview bubble beside the closed chat may show the start of an agent's message; off, it says only who wrote",
            "type": "boolean"
          },
          "proactive": {
            "$ref": "#/components/schemas/WidgetProactive",
            "description": "Proactive rules the loader evaluates on the page"
          },
          "reply_time": {
            "$ref": "#/components/schemas/WidgetReplyTime",
            "description": "The expected reply time for the header; absent when off or unknown"
          },
          "show_seen": {
            "description": "The visitor sees when an agent has read their message (seen_at)",
            "type": "boolean"
          },
          "team": {
            "description": "Up to three members there to answer now: first name and initials",
            "items": {
              "$ref": "#/components/schemas/WidgetAgent"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "theme": {
            "description": "The inbox's colour scheme; auto follows the page and the visitor's system. A page's data-theme or Kommio.init({theme}) wins",
            "enum": [
              "auto",
              "light",
              "dark"
            ],
            "type": "string"
          },
          "transcript": {
            "description": "The visitor may email themselves the transcript",
            "type": "boolean"
          },
          "visitor_sound": {
            "description": "The widget may chime when an agent writes (the visitor can mute it)",
            "type": "boolean"
          },
          "ws_path": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "prechat",
          "online",
          "ws_path",
          "fingerprinting",
          "capture_js_errors",
          "visitor_sound",
          "preview_text",
          "files",
          "theme",
          "launcher",
          "hours_open",
          "ask_email",
          "transcript",
          "show_seen"
        ],
        "type": "object"
      },
      "WidgetContextInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/WidgetContextInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "context": {
            "$ref": "#/components/schemas/BrowserContext"
          },
          "conversation_id": {
            "format": "int64",
            "minimum": 1,
            "type": "integer"
          }
        },
        "required": [
          "conversation_id",
          "context"
        ],
        "type": "object"
      },
      "WidgetConversationsOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/WidgetConversationsOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "conversations": {
            "items": {
              "$ref": "#/components/schemas/Item1"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "conversations"
        ],
        "type": "object"
      },
      "WidgetEmailInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/WidgetEmailInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "email": {
            "description": "Where replies go while the visitor is away; shown on the contact, never used to identify them (D-099)",
            "maxLength": 200,
            "minLength": 3,
            "type": "string"
          }
        },
        "required": [
          "email"
        ],
        "type": "object"
      },
      "WidgetEmailOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/WidgetEmailOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "email_known": {
            "type": "boolean"
          }
        },
        "required": [
          "email_known"
        ],
        "type": "object"
      },
      "WidgetFileRules": {
        "additionalProperties": false,
        "properties": {
          "extensions": {
            "description": "Accepted extensions (lower case, with the dot); empty: visitors cannot attach files",
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "max_per_message": {
            "description": "Files per message",
            "format": "int64",
            "type": "integer"
          },
          "max_size_mb": {
            "description": "Largest file in MB",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "max_size_mb",
          "max_per_message",
          "extensions"
        ],
        "type": "object"
      },
      "WidgetHelpEventInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/WidgetHelpEventInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "kind": {
            "description": "chat: the visitor started a chat after using the Help tab",
            "enum": [
              "search",
              "view",
              "chat"
            ],
            "type": "string"
          },
          "session": {
            "description": "A random UUID the widget draws per page session",
            "maxLength": 36,
            "minLength": 36,
            "type": "string"
          }
        },
        "required": [
          "session",
          "kind"
        ],
        "type": "object"
      },
      "WidgetHelpFeedbackInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/WidgetHelpFeedbackInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "comment": {
            "maxLength": 1000,
            "type": "string"
          },
          "helpful": {
            "type": "boolean"
          },
          "locale": {
            "maxLength": 16,
            "type": "string"
          }
        },
        "required": [
          "helpful"
        ],
        "type": "object"
      },
      "WidgetHelpInfo": {
        "additionalProperties": false,
        "properties": {
          "locales": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "locales"
        ],
        "type": "object"
      },
      "WidgetLauncher": {
        "additionalProperties": false,
        "properties": {
          "bottom_offset": {
            "description": "Distance from the bottom of the screen in px (the tab is centred vertically)",
            "format": "int64",
            "maximum": 120,
            "minimum": 0,
            "type": "integer"
          },
          "icon": {
            "description": "The closed launcher's icon; mark is the workspace's square mark (mark, mark_dark), the chat icon without one",
            "enum": [
              "chat",
              "chats",
              "headset",
              "question",
              "smile",
              "wave",
              "mark"
            ],
            "type": "string"
          },
          "label": {
            "description": "The pill's and the tab's text, plain; absent: \"Chat with us\" in the visitor's language",
            "maxLength": 30,
            "type": "string"
          },
          "open_icon": {
            "description": "The icon while the chat is open",
            "enum": [
              "close",
              "chevron"
            ],
            "type": "string"
          },
          "shape": {
            "description": "circle (default), square (rounded), pill (icon and label; a circle on screens up to 480 px) or tab (a vertical tab on the screen's edge)",
            "enum": [
              "circle",
              "square",
              "pill",
              "tab"
            ],
            "type": "string"
          },
          "side_offset": {
            "description": "Distance from the side of the screen in px (the tab sits on the edge)",
            "format": "int64",
            "maximum": 120,
            "minimum": 0,
            "type": "integer"
          },
          "size": {
            "description": "48, 56 or 64 px",
            "enum": [
              "small",
              "medium",
              "large"
            ],
            "type": "string"
          }
        },
        "required": [
          "shape",
          "icon",
          "open_icon",
          "size",
          "side_offset",
          "bottom_offset"
        ],
        "type": "object"
      },
      "WidgetMessage": {
        "additionalProperties": false,
        "properties": {
          "ai": {
            "$ref": "#/components/schemas/AgentReplyInfo",
            "description": "Set on the AI agent's replies: its name, avatar and the articles it cites"
          },
          "attachments": {
            "items": {
              "$ref": "#/components/schemas/WidgetAttachment"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "card": {
            "$ref": "#/components/schemas/Card",
            "description": "A chatbot flow's choices or expected answer; answer a choice with choice {message_id, index}"
          },
          "card_active": {
            "type": "boolean"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "direction": {
            "enum": [
              "inbound",
              "outbound"
            ],
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "seen_at": {
            "description": "When an agent read this visitor message; only when the inbox shows it (show_seen)",
            "format": "date-time",
            "type": "string"
          },
          "sender_name": {
            "type": "string"
          },
          "text": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "direction",
          "text",
          "created_at"
        ],
        "type": "object"
      },
      "WidgetMessageInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/WidgetMessageInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "choice": {
            "$ref": "#/components/schemas/WidgetChoice",
            "description": "A tapped choice of a flow card; text carries its label"
          },
          "client_id": {
            "description": "Client-generated id; resending with the same id is a no-op",
            "maxLength": 64,
            "minLength": 8,
            "type": "string"
          },
          "context": {
            "$ref": "#/components/schemas/BrowserContext",
            "description": "Visitor context collected by the browser; stored with the conversation"
          },
          "conversation_id": {
            "description": "Write in this conversation of the visitor's (reopening it when resolved); omitted uses the open one or starts a new one",
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "email": {
            "maxLength": 200,
            "type": "string"
          },
          "name": {
            "maxLength": 120,
            "type": "string"
          },
          "page": {
            "$ref": "#/components/schemas/PageRef",
            "description": "The customer's page the visitor is writing from"
          },
          "proactive": {
            "description": "The id of the proactive rule whose opener the visitor answers",
            "maxLength": 32,
            "type": "string"
          },
          "text": {
            "description": "Required unless the message carries files",
            "maxLength": 4000,
            "type": "string"
          },
          "uploads": {
            "description": "Files for this message: handles from POST /widget/uploads (at most the inbox's files per message, 5 by default)",
            "items": {
              "type": "string"
            },
            "maxItems": 10,
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "client_id"
        ],
        "type": "object"
      },
      "WidgetMessageOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/WidgetMessageOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "contact_id": {
            "description": "The contact this message created, with token",
            "format": "int64",
            "type": "integer"
          },
          "conversation_id": {
            "format": "int64",
            "type": "integer"
          },
          "message": {
            "$ref": "#/components/schemas/WidgetMessage"
          },
          "token": {
            "description": "A refreshed visitor token, returned when this message created the visitor's contact; use it from now on",
            "type": "string"
          }
        },
        "required": [
          "conversation_id",
          "message"
        ],
        "type": "object"
      },
      "WidgetMessagesOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/WidgetMessagesOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "messages": {
            "items": {
              "$ref": "#/components/schemas/WidgetMessage"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "messages"
        ],
        "type": "object"
      },
      "WidgetProactive": {
        "additionalProperties": false,
        "properties": {
          "quiet_minutes": {
            "description": "No proactive message for this long after the visitor closed the chat",
            "format": "int64",
            "type": "integer"
          },
          "rules": {
            "items": {
              "$ref": "#/components/schemas/WidgetRule"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "quiet_minutes",
          "rules"
        ],
        "type": "object"
      },
      "WidgetReplyTime": {
        "additionalProperties": false,
        "properties": {
          "minutes": {
            "description": "Median first reply time of the last 7 days in business time, rounded up (automatic mode)",
            "format": "int64",
            "type": "integer"
          },
          "preset": {
            "description": "A fixed preset the widget translates",
            "enum": [
              "few_minutes",
              "hour",
              "few_hours",
              "day",
              ""
            ],
            "type": "string"
          },
          "text": {
            "description": "The operator's own words, shown as written",
            "type": "string"
          }
        },
        "type": "object"
      },
      "WidgetResumeConfirm": {
        "additionalProperties": false,
        "properties": {
          "email": {
            "description": "The address the follow-up went to, masked (ma•••@example.com)",
            "type": "string"
          }
        },
        "type": "object"
      },
      "WidgetRule": {
        "additionalProperties": false,
        "properties": {
          "action": {
            "enum": [
              "bubble",
              "open"
            ],
            "type": "string"
          },
          "days": {
            "format": "int64",
            "type": "integer"
          },
          "exit_intent": {
            "type": "boolean"
          },
          "frequency": {
            "enum": [
              "session",
              "days"
            ],
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "scroll_percent": {
            "format": "int64",
            "type": "integer"
          },
          "time_on_page": {
            "format": "int64",
            "type": "integer"
          },
          "translations": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "The opener per agent-app language code",
            "type": "object"
          },
          "url": {
            "$ref": "#/components/schemas/URLMatch"
          },
          "visitor": {
            "enum": [
              "any",
              "new",
              "returning"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "action",
          "message",
          "visitor",
          "frequency"
        ],
        "type": "object"
      },
      "WidgetSeenInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/WidgetSeenInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "up_to": {
            "description": "The newest message the visitor has on screen",
            "format": "int64",
            "minimum": 1,
            "type": "integer"
          }
        },
        "required": [
          "up_to"
        ],
        "type": "object"
      },
      "WidgetSession": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/WidgetSession.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "contact_id": {
            "description": "Set once the visitor has a contact: after their first message, or with a signed identity that a contact already carries. Subscribe to visitor.{contact_id} to learn of conversations agents start",
            "format": "int64",
            "type": "integer"
          },
          "contact_name": {
            "description": "The contact's name, or the name the site signed for a visitor without a contact yet",
            "type": "string"
          },
          "conversation_id": {
            "description": "The open conversation, when one exists; else one resolved in the last 24 hours, so the visitor still sees it ended (and its survey)",
            "format": "int64",
            "type": "integer"
          },
          "conversation_status": {
            "enum": [
              "open",
              "pending",
              "snoozed",
              "resolved",
              "closed"
            ],
            "type": "string"
          },
          "email_known": {
            "type": "boolean"
          },
          "resume_confirm": {
            "$ref": "#/components/schemas/WidgetResumeConfirm"
          },
          "token": {
            "type": "string"
          },
          "visitor_id": {
            "description": "The visitor's id; stable for as long as the token is kept",
            "type": "string"
          },
          "visitor_session_id": {
            "description": "Set for a signed-in visitor who has no contact yet (D-208): the contact is created when they first write or an agent starts a chat with them. Subscribe to visitor.s.{visitor_session_id} to learn of conversations agents start",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "token"
        ],
        "type": "object"
      },
      "WidgetSessionInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/WidgetSessionInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "fingerprint": {
            "description": "Hex hash of stable browser traits; used only when the inbox enables fingerprinting",
            "maxLength": 64,
            "minLength": 16,
            "pattern": "^[a-f0-9]+$",
            "type": "string"
          },
          "identity": {
            "$ref": "#/components/schemas/IdentityStruct"
          },
          "resume": {
            "description": "The token of a follow-up email's continue link (#kommio-chat=…): continues that conversation's anonymous visitor. It works once; when the browser already chats as another contact the answer asks first (resume_confirm)",
            "maxLength": 2000,
            "type": "string"
          },
          "resume_confirmed": {
            "description": "The visitor confirmed resume_confirm: switch to the linked conversation's visitor",
            "type": "boolean"
          },
          "token": {
            "description": "A previous session token to continue",
            "maxLength": 2000,
            "type": "string"
          }
        },
        "type": "object"
      },
      "WidgetStatusOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/WidgetStatusOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "hours_open": {
            "description": "The inbox is within its business hours now",
            "type": "boolean"
          },
          "online": {
            "description": "At least one inbox member is online or busy with the agent app connected",
            "type": "boolean"
          },
          "team": {
            "description": "Up to three members there to answer now",
            "items": {
              "$ref": "#/components/schemas/WidgetAgent"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "online",
          "hours_open"
        ],
        "type": "object"
      },
      "WidgetSurveyOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/WidgetSurveyOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "conversation_id": {
            "format": "int64",
            "type": "integer"
          },
          "status": {
            "description": "The conversation's status category",
            "type": "string"
          },
          "survey": {
            "$ref": "#/components/schemas/SurveyView",
            "description": "Present when the conversation is resolved and a survey is offered"
          }
        },
        "required": [
          "conversation_id",
          "status"
        ],
        "type": "object"
      },
      "WidgetTranscriptInputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/WidgetTranscriptInputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "email": {
            "description": "Where to send it when the visitor has no email on file yet (then kept as their display email)",
            "maxLength": 200,
            "type": "string"
          },
          "locale": {
            "description": "The widget's language",
            "maxLength": 20,
            "type": "string"
          }
        },
        "type": "object"
      },
      "WidgetTranscriptOutputBody": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/WidgetTranscriptOutputBody.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "to": {
            "description": "The address the transcript goes to",
            "type": "string"
          }
        },
        "required": [
          "to"
        ],
        "type": "object"
      },
      "WidgetUpload": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/WidgetUpload.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "content_type": {
            "type": "string"
          },
          "file_name": {
            "type": "string"
          },
          "height": {
            "format": "int32",
            "type": "integer"
          },
          "image": {
            "type": "boolean"
          },
          "size": {
            "format": "int64",
            "type": "integer"
          },
          "upload": {
            "description": "Name it in the message's uploads within an hour",
            "type": "string"
          },
          "width": {
            "format": "int32",
            "type": "integer"
          }
        },
        "required": [
          "upload",
          "file_name",
          "content_type",
          "size",
          "image"
        ],
        "type": "object"
      },
      "WorkspaceStorage": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "/api/schemas/WorkspaceStorage.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "categories": {
            "description": "By category, largest first: attachments (files on messages), previews (their image thumbnails), knowledge (help center images), flows (files bot flows send)",
            "items": {
              "$ref": "#/components/schemas/StorageUsage"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "files": {
            "description": "Files stored for the workspace (previews not counted as files)",
            "format": "int64",
            "type": "integer"
          },
          "total_bytes": {
            "description": "Every category together",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "total_bytes",
          "files",
          "categories"
        ],
        "type": "object"
      }
    }
  },
  "info": {
    "description": "Kommio customer support platform. Every operation is tenant scoped and lives under /api.",
    "title": "Kommio API",
    "version": "dev"
  },
  "openapi": "3.1.0",
  "paths": {
    "/access/overview": {
      "get": {
        "operationId": "access-overview",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessOverviewOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Who can see which inbox, with which verb, what they may do and how they see each kind of personal data (agents:manage or roles:manage); inbox and team managers get the reduced overview of the inboxes they reach",
        "tags": [
          "roles"
        ]
      }
    },
    "/access/overview.csv": {
      "get": {
        "operationId": "access-overview-csv",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "contentEncoding": "base64",
                  "type": "string"
                }
              }
            },
            "description": "OK",
            "headers": {
              "Content-Disposition": {
                "schema": {
                  "type": "string"
                }
              },
              "Content-Type": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "The access overview as CSV, one row per person and inbox; audited (access.exported)",
        "tags": [
          "roles"
        ]
      }
    },
    "/account": {
      "delete": {
        "operationId": "account-delete",
        "responses": {
          "204": {
            "description": "No Content"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Close the workspace (owner only); data is deleted after the retention period",
        "tags": [
          "account"
        ]
      },
      "get": {
        "operationId": "account-get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Account"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "The current workspace",
        "tags": [
          "account"
        ]
      },
      "put": {
        "operationId": "account-update",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountUpdateInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Account"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Rename the workspace",
        "tags": [
          "account"
        ]
      }
    },
    "/account/api-keys": {
      "get": {
        "operationId": "api-keys-list",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeysOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "API keys of the workspace",
        "tags": [
          "account"
        ]
      },
      "post": {
        "operationId": "api-keys-create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiKeyCreateInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIKey"
                }
              }
            },
            "description": "Created"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Create an API key; the key is returned once",
        "tags": [
          "account"
        ]
      }
    },
    "/account/api-keys/{id}": {
      "delete": {
        "operationId": "api-keys-revoke",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "description": "Required: the key's name, as GET /account/api-keys/{id}/impact names it",
            "explode": false,
            "in": "query",
            "name": "confirm",
            "schema": {
              "description": "Required: the key's name, as GET /account/api-keys/{id}/impact names it",
              "maxLength": 80,
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Revoke a key; it stops working at once (needs confirm from GET .../impact)",
        "tags": [
          "account"
        ]
      }
    },
    "/account/api-keys/{id}/impact": {
      "get": {
        "operationId": "api-keys-impact",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIKeyImpact"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "What revoking a key stops: whatever uses it (last use, permissions)",
        "tags": [
          "account"
        ]
      }
    },
    "/account/checklist": {
      "get": {
        "operationId": "account-checklist",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Checklist"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "First-run checklist: which setup steps the workspace has done",
        "tags": [
          "account"
        ]
      }
    },
    "/account/me/availability": {
      "put": {
        "operationId": "me-availability",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AvailabilityInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AvailabilityOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Set your own availability (online, busy, away, offline); only online agents receive auto-assigned conversations",
        "tags": [
          "account"
        ]
      }
    },
    "/account/members": {
      "get": {
        "operationId": "members-list",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MembersOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "List workspace members (agents:manage, or conversations:assign to pick an assignee)",
        "tags": [
          "account"
        ]
      }
    },
    "/account/members/{user_id}": {
      "delete": {
        "operationId": "members-remove",
        "parameters": [
          {
            "in": "path",
            "name": "user_id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "Required: the person's email, as GET /account/members/{user_id}/impact names it",
            "explode": false,
            "in": "query",
            "name": "confirm",
            "schema": {
              "description": "Required: the person's email, as GET /account/members/{user_id}/impact names it",
              "maxLength": 254,
              "type": "string"
            }
          },
          {
            "description": "The member who takes over their rules, bots, webhooks and apps (0: rules are paused, the rest keeps running without an owner)",
            "explode": false,
            "in": "query",
            "name": "transfer_to",
            "schema": {
              "description": "The member who takes over their rules, bots, webhooks and apps (0: rules are paused, the rest keeps running without an owner)",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "0 (or left out) unassigns their conversations; a member id hands the open ones to that member",
            "explode": false,
            "in": "query",
            "name": "reassign_to",
            "schema": {
              "description": "0 (or left out) unassigns their conversations; a member id hands the open ones to that member",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Remove a member from the workspace (needs confirm from GET .../impact)",
        "tags": [
          "account"
        ]
      },
      "put": {
        "operationId": "members-update",
        "parameters": [
          {
            "in": "path",
            "name": "user_id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MemberUpdateInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MembersOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Change a member's role or disable them",
        "tags": [
          "account"
        ]
      }
    },
    "/account/members/{user_id}/impact": {
      "get": {
        "operationId": "members-impact",
        "parameters": [
          {
            "in": "path",
            "name": "user_id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "action",
            "schema": {
              "default": "remove",
              "enum": [
                "disable",
                "remove",
                "role"
              ],
              "type": "string"
            }
          },
          {
            "description": "For action=role: the new role",
            "explode": false,
            "in": "query",
            "name": "role_id",
            "schema": {
              "description": "For action=role: the new role",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemberImpact"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "What disabling, removing or narrowing the role of a member stops: rules they authored, bots, webhooks, apps and API keys they created, shared views, open conversations, teams left empty, and who could take over",
        "tags": [
          "account"
        ]
      }
    },
    "/account/members/{user_id}/routing": {
      "put": {
        "operationId": "members-routing",
        "parameters": [
          {
            "in": "path",
            "name": "user_id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MemberRoutingInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemberRoutingOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Set a member's skills and own capacity, which assignment matches and weighs (agents:manage)",
        "tags": [
          "account"
        ]
      }
    },
    "/account/quotas": {
      "get": {
        "operationId": "account-quotas",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuotaList"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "The workspace's fair-use limits and its use of each (limit 0 is unlimited)",
        "tags": [
          "account"
        ]
      }
    },
    "/account/security-policy": {
      "get": {
        "operationId": "security-policy-get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecurityPolicy"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "The workspace's two-factor requirement and the members who have not turned it on",
        "tags": [
          "account"
        ]
      },
      "put": {
        "operationId": "security-policy-update",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SecurityPolicyInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecurityPolicy"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Require two-factor for every member (you must have it on yourself to turn this on); audited",
        "tags": [
          "account"
        ]
      }
    },
    "/account/sso-providers": {
      "get": {
        "operationId": "sso-providers-list",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SsoListOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Single sign-on providers of the workspace",
        "tags": [
          "account"
        ]
      },
      "post": {
        "operationId": "sso-providers-create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SsoProviderBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SSOProvider"
                }
              }
            },
            "description": "Created"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Add a single sign-on provider",
        "tags": [
          "account"
        ]
      }
    },
    "/account/sso-providers/{id}": {
      "delete": {
        "operationId": "sso-providers-delete",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Remove a single sign-on provider",
        "tags": [
          "account"
        ]
      },
      "put": {
        "operationId": "sso-providers-update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SsoProviderBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SSOProvider"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Change a single sign-on provider; an omitted client secret is kept",
        "tags": [
          "account"
        ]
      }
    },
    "/account/storage": {
      "get": {
        "operationId": "account-storage",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceStorage"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "What the workspace's files take, by category",
        "tags": [
          "account"
        ]
      }
    },
    "/activity": {
      "get": {
        "operationId": "activity-report",
        "parameters": [
          {
            "description": "The range: the last 7, 30 or 90 days (UTC days ending today)",
            "explode": false,
            "in": "query",
            "name": "days",
            "schema": {
              "default": 30,
              "description": "The range: the last 7, 30 or 90 days (UTC days ending today)",
              "enum": [
                7,
                30,
                90
              ],
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActivityOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Sign-ins, active agents and feature usage per day for the last 7, 30 or 90 days",
        "tags": [
          "activity"
        ]
      }
    },
    "/activity/usage": {
      "post": {
        "operationId": "activity-usage",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UsageEventsInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "No Content"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Report features used in the agent app that never reach the API (counts only)",
        "tags": [
          "activity"
        ]
      }
    },
    "/admin/health": {
      "get": {
        "operationId": "admin-health",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdminHealth"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Inbox sync, webhook delivery, bots, automation failures and backlog of this workspace",
        "tags": [
          "admin"
        ]
      }
    },
    "/ai/agent": {
      "get": {
        "operationId": "ai-agent-get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AIAgentView"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "The AI agent's settings and the inboxes it answers in",
        "tags": [
          "ai"
        ]
      },
      "put": {
        "description": "The agent answers only while it is on here and AI is on with a key (Settings → AI). It is listed in each chosen inbox after the bots and flows already there; reorder it and give it conditions on the inbox's Bots and flows page.",
        "operationId": "ai-agent-put",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AiAgentPutInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AIAgentView"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Change the AI agent's settings and the inboxes it answers in",
        "tags": [
          "ai"
        ]
      }
    },
    "/ai/agent/report": {
      "get": {
        "operationId": "ai-agent-report",
        "parameters": [
          {
            "explode": false,
            "in": "query",
            "name": "days",
            "schema": {
              "default": 30,
              "format": "int64",
              "maximum": 365,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentReport"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "The AI agent's resolution and hand-off rates, hand-off reasons and questions without answers",
        "tags": [
          "ai"
        ]
      }
    },
    "/ai/agent/test": {
      "post": {
        "description": "The real pipeline (hand-off signals, retrieval from the workspace's knowledge, the model, the checks on its answer) on the given messages. Data connectors are not called and conversation actions are only reported. The call is metered as feature agent_test and counts against the budget.",
        "operationId": "ai-agent-test",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AiAgentTestInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AIAgentTestResult"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Run the AI agent on a simulated conversation (nothing is sent or written)",
        "tags": [
          "ai"
        ]
      }
    },
    "/ai/conversations/{id}/rewrite": {
      "post": {
        "operationId": "ai-rewrite",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AiRewriteInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiRewriteOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Rewrite the composer's draft: friendlier, more formal, shorter, fixed grammar or translated",
        "tags": [
          "ai"
        ]
      }
    },
    "/ai/conversations/{id}/suggest": {
      "post": {
        "description": "Answers text/event-stream: `delta` events carry `{\"text\": \"…\"}` as it arrives, then one `done` event with `{\"text\", \"model\", \"usage\"}` or one `error` event with `{\"kind\", \"status\", \"message\"}`. Nothing is sent to the customer: the agent edits and sends. Refusals known before the stream starts (AI off, budget reached, conversation not visible) are ordinary error responses.",
        "operationId": "ai-suggest",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AiSuggestInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "text/event-stream": {}
            },
            "description": "An event stream"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Stream a reply suggestion (or an improved draft) as server-sent events",
        "tags": [
          "ai"
        ]
      }
    },
    "/ai/conversations/{id}/summarize": {
      "post": {
        "description": "The note is written through the normal message path (message.created, realtime, reports) with headers.kommio_ai.kind = summary and the structured summary in headers.kommio_ai.summary. Needs messages:write_private.",
        "operationId": "ai-summarize",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AiConvInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Message"
                }
              }
            },
            "description": "Created"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Summarise the conversation into a private note flagged as an AI summary",
        "tags": [
          "ai"
        ]
      }
    },
    "/ai/embeddings": {
      "get": {
        "operationId": "ai-embeddings-get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmbeddingSettings"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "The workspace's embeddings configuration for knowledge search (the key is never returned)",
        "tags": [
          "ai"
        ]
      },
      "put": {
        "description": "Changing the provider, the model or the dimensions makes every passage stale: the knowledge base embeds them again in the background (metered against the AI budget) and searches by keywords for passages not yet embedded.",
        "operationId": "ai-embeddings-put",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AiEmbeddingsInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmbeddingSettings"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Change the embeddings configuration; an omitted key is kept",
        "tags": [
          "ai"
        ]
      }
    },
    "/ai/embeddings/test": {
      "post": {
        "description": "Recorded in the usage as feature test; not blocked by the budget and works while AI is still off.",
        "operationId": "ai-embeddings-test",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AiEmbeddingsTestInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmbeddingTestResult"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Embed one word with the saved or the given embeddings settings",
        "tags": [
          "ai"
        ]
      }
    },
    "/ai/settings": {
      "get": {
        "operationId": "ai-settings-get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AISettings"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "The workspace's AI configuration (the key is never returned)",
        "tags": [
          "ai"
        ]
      },
      "put": {
        "operationId": "ai-settings-put",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AiSettingsInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AISettings"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Change the workspace's AI configuration; an omitted key is kept",
        "tags": [
          "ai"
        ]
      }
    },
    "/ai/settings/test": {
      "post": {
        "description": "The call asks the model to answer OK in a few tokens and is recorded in the usage as feature test. It is not blocked by the budget and works while AI is still off, so a key can be checked before turning AI on.",
        "operationId": "ai-settings-test",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AiTestInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AITestResult"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Make one tiny call with the saved or the given provider settings",
        "tags": [
          "ai"
        ]
      }
    },
    "/ai/status": {
      "get": {
        "operationId": "ai-status",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiStatusOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Whether AI is on for the workspace, usable by the caller, and within its budget",
        "tags": [
          "ai"
        ]
      }
    },
    "/ai/usage": {
      "get": {
        "operationId": "ai-usage",
        "parameters": [
          {
            "description": "YYYY-MM (UTC); defaults to this month",
            "explode": false,
            "in": "query",
            "name": "month",
            "schema": {
              "description": "YYYY-MM (UTC); defaults to this month",
              "pattern": "^([0-9]{4}-[0-9]{2})?$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiUsageOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "AI usage of a month by feature, person, day and model, with the budget",
        "tags": [
          "ai"
        ]
      }
    },
    "/apps": {
      "get": {
        "operationId": "apps-list",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppsOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Installed apps",
        "tags": [
          "apps"
        ]
      },
      "post": {
        "operationId": "apps-install",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppInstallInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/App"
                }
              }
            },
            "description": "Created"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Install an app from its manifest; token and secret are returned once",
        "tags": [
          "apps"
        ]
      }
    },
    "/apps/panels": {
      "get": {
        "operationId": "apps-panels",
        "parameters": [
          {
            "explode": false,
            "in": "query",
            "name": "location",
            "schema": {
              "default": "conversation",
              "enum": [
                "conversation",
                "contact",
                "inbox"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppPanelsOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Panels installed apps render at a location",
        "tags": [
          "apps"
        ]
      }
    },
    "/apps/{id}": {
      "delete": {
        "operationId": "apps-delete",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Remove an app; its token stops working at once",
        "tags": [
          "apps"
        ]
      },
      "get": {
        "operationId": "apps-get",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/App"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "One installed app",
        "tags": [
          "apps"
        ]
      },
      "put": {
        "operationId": "apps-update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppUpdateInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/App"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Pause or resume an app, or change the approved scopes",
        "tags": [
          "apps"
        ]
      }
    },
    "/apps/{id}/log": {
      "get": {
        "operationId": "apps-log",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppLogOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Recent hook deliveries of an app",
        "tags": [
          "apps"
        ]
      }
    },
    "/apps/{id}/panels/{key}/context": {
      "post": {
        "operationId": "apps-panel-context",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "in": "path",
            "name": "key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppPanelContextInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppPanelContextOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "A signed context for opening a panel",
        "tags": [
          "apps"
        ]
      }
    },
    "/apps/{id}/refresh": {
      "post": {
        "operationId": "apps-refresh",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/App"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Fetch the hosted manifest again; new scopes stay unapproved until an administrator grants them",
        "tags": [
          "apps"
        ]
      }
    },
    "/apps/{id}/rotate-token": {
      "post": {
        "operationId": "apps-rotate-token",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/App"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Issue a new token; the old one stops working at once",
        "tags": [
          "apps"
        ]
      }
    },
    "/attachments/{id}": {
      "get": {
        "operationId": "attachments-download",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "320 or 1024 for a preview of an image; the original is served when that preview does not exist",
            "explode": false,
            "in": "query",
            "name": "size",
            "schema": {
              "description": "320 or 1024 for a preview of an image; the original is served when that preview does not exist",
              "format": "int64",
              "maximum": 4096,
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "The token POST /sensitive/reveal gave for a file masked for your role",
            "explode": false,
            "in": "query",
            "name": "reveal",
            "schema": {
              "description": "The token POST /sensitive/reveal gave for a file masked for your role",
              "maxLength": 600,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The file"
          },
          "302": {
            "description": "Redirect to a signed URL"
          }
        },
        "summary": "Download a file (streams, or redirects to a signed URL)",
        "tags": [
          "conversations"
        ]
      },
      "patch": {
        "operationId": "attachments-flag",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AttachmentFlagInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Attachment"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Mark a file as an ID document or other personal data, or remove the mark; audited",
        "tags": [
          "conversations"
        ]
      }
    },
    "/audit": {
      "get": {
        "operationId": "audit-list",
        "parameters": [
          {
            "description": "Opaque cursor from a previous page",
            "explode": false,
            "in": "query",
            "name": "cursor",
            "schema": {
              "description": "Opaque cursor from a previous page",
              "type": "string"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "format": "int64",
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "action",
            "schema": {
              "maxLength": 80,
              "type": "string"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "object_type",
            "schema": {
              "maxLength": 40,
              "type": "string"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "object_id",
            "schema": {
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "actor_id",
            "schema": {
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditListOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "List audit events, newest first",
        "tags": [
          "audit"
        ]
      }
    },
    "/auth/login": {
      "post": {
        "operationId": "auth-login",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoginInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoginOutputBody"
                }
              }
            },
            "description": "OK",
            "headers": {
              "Set-Cookie": {
                "schema": {
                  "$ref": "#/components/schemas/Cookie"
                }
              }
            }
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Sign in with email and password",
        "tags": [
          "auth"
        ]
      }
    },
    "/auth/logout": {
      "post": {
        "operationId": "auth-logout",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmptyOutputBody"
                }
              }
            },
            "description": "OK",
            "headers": {
              "Set-Cookie": {
                "schema": {
                  "$ref": "#/components/schemas/Cookie"
                }
              }
            }
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Sign out",
        "tags": [
          "auth"
        ]
      }
    },
    "/auth/me": {
      "get": {
        "operationId": "auth-me",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MeOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Who am I",
        "tags": [
          "auth"
        ]
      }
    },
    "/auth/me/locale": {
      "put": {
        "operationId": "auth-me-locale",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LocaleInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LocaleOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Choose the caller's app language, or null to follow the browser",
        "tags": [
          "auth"
        ]
      }
    },
    "/auth/mfa": {
      "get": {
        "operationId": "auth-mfa-status",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MfaStatusOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Whether two-factor authentication is on, and how many recovery codes are left",
        "tags": [
          "auth"
        ]
      }
    },
    "/auth/mfa/confirm": {
      "post": {
        "operationId": "auth-mfa-confirm",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConfirmInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConfirmOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Confirm MFA with a code from the authenticator",
        "tags": [
          "auth"
        ]
      }
    },
    "/auth/mfa/disable": {
      "post": {
        "operationId": "auth-mfa-disable",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MfaDisableInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "No Content"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Turn two-factor authentication off (needs the password and a code)",
        "tags": [
          "auth"
        ]
      }
    },
    "/auth/mfa/enroll": {
      "post": {
        "operationId": "auth-mfa-enroll",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EnrollInputBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnrollOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Start MFA enrollment (needs the current password)",
        "tags": [
          "auth"
        ]
      }
    },
    "/auth/mfa/recovery-codes": {
      "post": {
        "operationId": "auth-mfa-recovery-codes",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MfaCodeInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConfirmOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Replace every recovery code (needs a current code); the new ones are shown once",
        "tags": [
          "auth"
        ]
      }
    },
    "/auth/mfa/verify": {
      "post": {
        "operationId": "auth-mfa-verify",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MfaVerifyInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoginOutputBody"
                }
              }
            },
            "description": "OK",
            "headers": {
              "Set-Cookie": {
                "schema": {
                  "$ref": "#/components/schemas/Cookie"
                }
              }
            }
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Complete a login that requires a code",
        "tags": [
          "auth"
        ]
      }
    },
    "/auth/sessions": {
      "get": {
        "operationId": "auth-sessions-list",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionsOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "The caller's active sessions (browsers and devices)",
        "tags": [
          "auth"
        ]
      }
    },
    "/auth/sessions/revoke-others": {
      "post": {
        "operationId": "auth-sessions-revoke-others",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RevokedOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Sign out every other session of the caller",
        "tags": [
          "auth"
        ]
      }
    },
    "/auth/sessions/{id}": {
      "delete": {
        "operationId": "auth-sessions-revoke",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Sign out one of the caller's other sessions",
        "tags": [
          "auth"
        ]
      }
    },
    "/auth/switch-account": {
      "post": {
        "operationId": "auth-switch-account",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SwitchInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmptyOutputBody"
                }
              }
            },
            "description": "OK",
            "headers": {
              "Set-Cookie": {
                "schema": {
                  "$ref": "#/components/schemas/Cookie"
                }
              }
            }
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Choose the active account for this session",
        "tags": [
          "auth"
        ]
      }
    },
    "/automations": {
      "get": {
        "operationId": "automations-list",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RulesOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Rules, triggers and the action catalogue",
        "tags": [
          "automations"
        ]
      },
      "post": {
        "operationId": "automations-create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RuleBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Rule"
                }
              }
            },
            "description": "Created"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Create a rule; it runs with your permissions",
        "tags": [
          "automations"
        ]
      }
    },
    "/automations/order": {
      "put": {
        "operationId": "automations-order",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RuleOrderInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RulesOrderOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Reorder the rules; for the same trigger they run in this order",
        "tags": [
          "automations"
        ]
      }
    },
    "/automations/{id}": {
      "delete": {
        "operationId": "automations-delete",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Delete a rule and its log",
        "tags": [
          "automations"
        ]
      },
      "put": {
        "operationId": "automations-update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RuleBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Rule"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Update a rule; you become its author",
        "tags": [
          "automations"
        ]
      }
    },
    "/automations/{id}/deliveries": {
      "get": {
        "operationId": "automations-deliveries",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "before_id",
            "schema": {
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "format": "int64",
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "Only deliveries in this state; omitted lists all",
            "explode": false,
            "in": "query",
            "name": "status",
            "schema": {
              "description": "Only deliveries in this state; omitted lists all",
              "enum": [
                "pending",
                "retrying",
                "delivered",
                "failed",
                "cancelled",
                "over_budget"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeliveriesOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Webhooks this rule sent (the shared delivery ledger), newest first",
        "tags": [
          "automations"
        ]
      }
    },
    "/automations/{id}/deliveries/replay-failed": {
      "post": {
        "operationId": "automations-replay-failed",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReplayFailedOutputBody"
                }
              }
            },
            "description": "Accepted"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Send a rule's failed webhooks again (oldest 100, spaced; once a minute)",
        "tags": [
          "automations"
        ]
      }
    },
    "/automations/{id}/deliveries/{delivery_id}/replay": {
      "post": {
        "operationId": "automations-replay",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "path",
            "name": "delivery_id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Delivery"
                }
              }
            },
            "description": "Accepted"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Send a rule's webhook again now",
        "tags": [
          "automations"
        ]
      }
    },
    "/automations/{id}/runs": {
      "get": {
        "operationId": "automations-runs",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "format": "int64",
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunsOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Execution log of a rule, newest first",
        "tags": [
          "automations"
        ]
      }
    },
    "/automations/{id}/test": {
      "get": {
        "operationId": "automations-test",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "conversation_id",
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuleTestOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Dry run: would this rule match a conversation right now?",
        "tags": [
          "automations"
        ]
      }
    },
    "/automations/{id}/transfer": {
      "post": {
        "operationId": "automations-transfer",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RuleTransferInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Rule"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Hand a rule to another member, who becomes its author (it runs with their permissions); a rule paused for a departed author is switched back on",
        "tags": [
          "automations"
        ]
      }
    },
    "/bot/conversations": {
      "post": {
        "operationId": "bot-start-conversation",
        "parameters": [
          {
            "in": "header",
            "name": "Authorization",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BotStartInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BotConversationOutputBody"
                }
              }
            },
            "description": "Created"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Start a conversation with an existing contact on an inbox the bot is attached to",
        "tags": [
          "bot"
        ]
      }
    },
    "/bot/conversations/{id}": {
      "get": {
        "operationId": "bot-conversation",
        "parameters": [
          {
            "in": "header",
            "name": "Authorization",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BotConversationOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "A held conversation with its recent messages",
        "tags": [
          "bot"
        ]
      },
      "patch": {
        "operationId": "bot-update-conversation",
        "parameters": [
          {
            "in": "header",
            "name": "Authorization",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BotUpdateConvInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BotConversationOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Set priority or merge custom attributes",
        "tags": [
          "bot"
        ]
      }
    },
    "/bot/conversations/{id}/handoff": {
      "post": {
        "operationId": "bot-handoff",
        "parameters": [
          {
            "in": "header",
            "name": "Authorization",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BotHandoffInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "No Content"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Hand the conversation to humans",
        "tags": [
          "bot"
        ]
      }
    },
    "/bot/conversations/{id}/messages": {
      "post": {
        "operationId": "bot-reply",
        "parameters": [
          {
            "in": "header",
            "name": "Authorization",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BotReplyInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BotMessage"
                }
              }
            },
            "description": "Created"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Reply as the bot",
        "tags": [
          "bot"
        ]
      }
    },
    "/bot/conversations/{id}/resolve": {
      "post": {
        "operationId": "bot-resolve",
        "parameters": [
          {
            "in": "header",
            "name": "Authorization",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Resolve a held conversation; the bot keeps it if the customer writes again",
        "tags": [
          "bot"
        ]
      }
    },
    "/bot/conversations/{id}/typing": {
      "post": {
        "operationId": "bot-typing",
        "parameters": [
          {
            "in": "header",
            "name": "Authorization",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Show the bot as typing to the customer and agents (rate limited)",
        "tags": [
          "bot"
        ]
      }
    },
    "/bots": {
      "get": {
        "operationId": "bots-list",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BotsOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Agent bots with their health",
        "tags": [
          "bots"
        ]
      },
      "post": {
        "operationId": "bots-create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BotBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Bot"
                }
              }
            },
            "description": "Created"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Create a bot; token and signing secret are returned once",
        "tags": [
          "bots"
        ]
      }
    },
    "/bots/{id}": {
      "delete": {
        "operationId": "bots-delete",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Delete a bot; conversations it held are released",
        "tags": [
          "bots"
        ]
      },
      "get": {
        "operationId": "bots-get",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Bot"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "One agent bot with its health",
        "tags": [
          "bots"
        ]
      },
      "put": {
        "operationId": "bots-update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BotBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Bot"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Update a bot (name, url, allowed actions, pause or resume)",
        "tags": [
          "bots"
        ]
      }
    },
    "/bots/{id}/deliveries": {
      "get": {
        "operationId": "bots-deliveries",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "before_id",
            "schema": {
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "format": "int64",
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "Only deliveries in this state; omitted lists all",
            "explode": false,
            "in": "query",
            "name": "status",
            "schema": {
              "description": "Only deliveries in this state; omitted lists all",
              "enum": [
                "pending",
                "retrying",
                "delivered",
                "failed",
                "cancelled",
                "over_budget"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeliveriesOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "The bot's delivery ledger, newest first",
        "tags": [
          "bots"
        ]
      }
    },
    "/bots/{id}/deliveries/replay-failed": {
      "post": {
        "operationId": "bots-replay-failed",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReplayFailedOutputBody"
                }
              }
            },
            "description": "Accepted"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Deliver the bot's failed deliveries again (oldest 100, spaced; once a minute); those for conversations it no longer holds are cancelled",
        "tags": [
          "bots"
        ]
      }
    },
    "/bots/{id}/deliveries/{delivery_id}/replay": {
      "post": {
        "operationId": "bots-replay",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "path",
            "name": "delivery_id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Delivery"
                }
              }
            },
            "description": "Accepted"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Deliver again now (only while the bot still holds the conversation)",
        "tags": [
          "bots"
        ]
      }
    },
    "/bots/{id}/rotate-token": {
      "post": {
        "operationId": "bots-rotate-token",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Bot"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Issue a new token; the old one stops working at once",
        "tags": [
          "bots"
        ]
      }
    },
    "/branding": {
      "get": {
        "operationId": "branding-get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BrandingState"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "The published theme, the draft and the version history",
        "tags": [
          "branding"
        ]
      }
    },
    "/branding/draft": {
      "delete": {
        "operationId": "branding-draft-delete",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BrandingState"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Discard the draft",
        "tags": [
          "branding"
        ]
      },
      "put": {
        "operationId": "branding-draft-put",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BrandingDraftInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BrandingState"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Save the draft theme (validated; nothing goes live until it is published)",
        "tags": [
          "branding"
        ]
      }
    },
    "/branding/files": {
      "post": {
        "operationId": "branding-files-upload",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "properties": {
                  "filename": {
                    "contentMediaType": "application/octet-stream",
                    "description": "filename of the file being uploaded",
                    "format": "binary",
                    "type": "string"
                  },
                  "name": {
                    "description": "general purpose name for multipart form value",
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BrandFile"
                }
              }
            },
            "description": "Created"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Upload a logo (multipart: file; PNG, JPEG or WebP; SVG is refused because uploads are not sanitised). Needs branding:manage, or inboxes:manage for a chat's own logos",
        "tags": [
          "branding"
        ]
      }
    },
    "/branding/publish": {
      "post": {
        "operationId": "branding-publish",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BrandingState"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Publish the draft as the next version; audited",
        "tags": [
          "branding"
        ]
      }
    },
    "/branding/versions/{version}/restore": {
      "post": {
        "operationId": "branding-restore",
        "parameters": [
          {
            "in": "path",
            "name": "version",
            "required": true,
            "schema": {
              "format": "int32",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BrandingState"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Roll back: publish a copy of an earlier version as the next version (the draft is discarded); audited",
        "tags": [
          "branding"
        ]
      }
    },
    "/business-hours": {
      "get": {
        "operationId": "business-hours",
        "parameters": [
          {
            "description": "Apply the inbox override when set",
            "explode": false,
            "in": "query",
            "name": "inbox_id",
            "schema": {
              "description": "Apply the inbox override when set",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessHours"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Effective business hours and whether they are open now",
        "tags": [
          "settings"
        ]
      }
    },
    "/business-hours/exceptions": {
      "get": {
        "operationId": "business-hours-exceptions",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExceptionsOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Holidays and days with special hours; they replace the weekly hours of the days they cover",
        "tags": [
          "settings"
        ]
      },
      "put": {
        "operationId": "business-hours-exceptions-put",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExceptionsInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExceptionsOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Replace the holidays and exceptions (settings:manage); audited",
        "tags": [
          "settings"
        ]
      }
    },
    "/canned-responses": {
      "get": {
        "operationId": "canned-list",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CannedOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "List canned responses",
        "tags": [
          "tags"
        ]
      },
      "post": {
        "operationId": "canned-create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CannedInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CannedResponse"
                }
              }
            },
            "description": "Created"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Create a canned response",
        "tags": [
          "tags"
        ]
      }
    },
    "/canned-responses/{id}": {
      "delete": {
        "operationId": "canned-delete",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Delete a canned response",
        "tags": [
          "tags"
        ]
      },
      "put": {
        "operationId": "canned-update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CannedUpdateInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CannedResponse"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Update a canned response",
        "tags": [
          "tags"
        ]
      }
    },
    "/channels": {
      "get": {
        "operationId": "channels-list",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChannelsOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "List channel kinds with their setup schema",
        "tags": [
          "inboxes"
        ]
      }
    },
    "/channels/{kind}/test": {
      "post": {
        "operationId": "channels-test",
        "parameters": [
          {
            "in": "path",
            "name": "kind",
            "required": true,
            "schema": {
              "maxLength": 40,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChannelTestInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChannelTestOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Test a channel's credentials before saving (a Telegram bot token: who the bot is)",
        "tags": [
          "inboxes"
        ]
      }
    },
    "/connectors": {
      "get": {
        "operationId": "connectors-list",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectorListOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "List data connectors with their state and the last 24 hours",
        "tags": [
          "connectors"
        ]
      },
      "post": {
        "operationId": "connectors-create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConnectorBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectorView"
                }
              }
            },
            "description": "Created"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Create a data connector",
        "tags": [
          "connectors"
        ]
      }
    },
    "/connectors/import": {
      "post": {
        "operationId": "connectors-import",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConnectorImportInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectorView"
                }
              }
            },
            "description": "Created"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Create a connector from exported JSON or a recipe; it starts off until tested",
        "tags": [
          "connectors"
        ]
      }
    },
    "/connectors/placeholders": {
      "get": {
        "operationId": "connectors-placeholders",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectorPlaceholdersOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "The placeholders a connector's URL, headers and body may use",
        "tags": [
          "connectors"
        ]
      }
    },
    "/connectors/recipes": {
      "get": {
        "operationId": "connectors-recipes",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectorRecipesOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Ready-made connectors to start from, with the attributes this workspace lacks",
        "tags": [
          "connectors"
        ]
      }
    },
    "/connectors/test": {
      "post": {
        "operationId": "connectors-test",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConnectorTestInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectorTestResult"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Run a connector definition once, without saving or writing anything",
        "tags": [
          "connectors"
        ]
      }
    },
    "/connectors/{id}": {
      "delete": {
        "operationId": "connectors-delete",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Delete a data connector with its run log and cache; values it wrote stay",
        "tags": [
          "connectors"
        ]
      },
      "get": {
        "operationId": "connectors-get",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectorView"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Read a data connector (secrets are never returned)",
        "tags": [
          "connectors"
        ]
      },
      "put": {
        "operationId": "connectors-update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConnectorBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectorView"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Change a data connector; an empty secret keeps the stored one",
        "tags": [
          "connectors"
        ]
      }
    },
    "/connectors/{id}/enable": {
      "post": {
        "operationId": "connectors-enable",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectorView"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Turn a connector back on after the circuit breaker turned it off",
        "tags": [
          "connectors"
        ]
      }
    },
    "/connectors/{id}/export": {
      "get": {
        "operationId": "connectors-export",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectorRecipe"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Export a connector as JSON; secrets are never exported",
        "tags": [
          "connectors"
        ]
      }
    },
    "/connectors/{id}/run": {
      "post": {
        "operationId": "connectors-run",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConnectorRunInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectorResult"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Run a connector now for a contact or conversation (skips the cache)",
        "tags": [
          "connectors"
        ]
      }
    },
    "/connectors/{id}/runs": {
      "get": {
        "operationId": "connectors-runs",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectorRunsOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "The connector's last 100 runs, secrets redacted",
        "tags": [
          "connectors"
        ]
      }
    },
    "/contacts": {
      "get": {
        "description": "Newest first by default; sort by created, name or last_activity through indexes, or by attributes.<key> on a list of at most 5,000 contacts. audience=people hides anonymous website visitors.",
        "operationId": "contacts-list",
        "parameters": [
          {
            "explode": false,
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "format": "int64",
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "Matches name, email or phone",
            "explode": false,
            "in": "query",
            "name": "q",
            "schema": {
              "description": "Matches name, email or phone",
              "maxLength": 200,
              "type": "string"
            }
          },
          {
            "description": "A saved contact view (GET /views?object=contact)",
            "explode": false,
            "in": "query",
            "name": "view_id",
            "schema": {
              "description": "A saved contact view (GET /views?object=contact)",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "An ad-hoc contact condition as JSON (GET /views/schema?object=contact), combined with the view",
            "explode": false,
            "in": "query",
            "name": "filter",
            "schema": {
              "description": "An ad-hoc contact condition as JSON (GET /views/schema?object=contact), combined with the view",
              "maxLength": 8000,
              "type": "string"
            }
          },
          {
            "description": "Only contacts with this tag",
            "explode": false,
            "in": "query",
            "name": "tag_id",
            "schema": {
              "description": "Only contacts with this tag",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "people: contacts with an email, phone, external or channel identity, a conversation, or added by the team; visitors: the other, anonymous website visitors; all (the default)",
            "explode": false,
            "in": "query",
            "name": "audience",
            "schema": {
              "description": "people: contacts with an email, phone, external or channel identity, a conversation, or added by the team; visitors: the other, anonymous website visitors; all (the default)",
              "enum": [
                "people",
                "visitors",
                "all",
                ""
              ],
              "type": "string"
            }
          },
          {
            "description": "created (the default, newest first), name, last_activity, or attributes.<key>: sorting by an attribute needs a list of at most 5,000 contacts (filter it first)",
            "explode": false,
            "in": "query",
            "name": "sort",
            "schema": {
              "description": "created (the default, newest first), name, last_activity, or attributes.<key>: sorting by an attribute needs a list of at most 5,000 contacts (filter it first)",
              "maxLength": 140,
              "pattern": "^(|created|name|last_activity|attributes\\.[a-z][a-z0-9_]{0,59})$",
              "type": "string"
            }
          },
          {
            "description": "asc or desc; the default is desc for dates and asc for names and attributes",
            "explode": false,
            "in": "query",
            "name": "dir",
            "schema": {
              "description": "asc or desc; the default is desc for dates and asc for names and attributes",
              "enum": [
                "asc",
                "desc",
                ""
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactListOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "List contacts the caller may see, with their tags, conversation counts and most recent conversation",
        "tags": [
          "contacts"
        ]
      },
      "post": {
        "operationId": "contacts-create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactCreateInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactOutputBody"
                }
              }
            },
            "description": "Created"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Create a contact with its identities",
        "tags": [
          "contacts"
        ]
      }
    },
    "/contacts/bulk": {
      "post": {
        "description": "Tags need contacts:write, erasure contacts:delete and, for more than one contact, confirm from POST /contacts/bulk/impact (else 428). Up to 200 selected ids are done at once (the answer is finished); larger selections and all_matching run in the background: poll GET /contacts/bulk/{id}. Every changed contact gets the single endpoint's audit row.",
        "operationId": "contacts-bulk",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactBulkInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactBulkJob"
                }
              }
            },
            "description": "Accepted"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Tag, untag or erase a selection of contacts",
        "tags": [
          "contacts"
        ]
      }
    },
    "/contacts/bulk/impact": {
      "post": {
        "description": "Needs contacts:delete. The answer's confirm (the number of contacts) is what POST /contacts/bulk takes to erase more than one.",
        "operationId": "contacts-bulk-impact",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactBulkImpactInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactEraseImpact"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "What erasing a selection of contacts does (count, their conversations and notes)",
        "tags": [
          "contacts"
        ]
      }
    },
    "/contacts/bulk/{id}": {
      "get": {
        "operationId": "contacts-bulk-get",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactBulkJob"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "One of the caller's bulk actions, with its progress",
        "tags": [
          "contacts"
        ]
      }
    },
    "/contacts/columns": {
      "get": {
        "operationId": "contacts-columns-get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactListColumns"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "The contact list columns the caller chose (empty: the default columns)",
        "tags": [
          "contacts"
        ]
      },
      "put": {
        "operationId": "contacts-columns-set",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactListColumns"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactListColumns"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Remember the caller's contact list columns",
        "tags": [
          "contacts"
        ]
      }
    },
    "/contacts/count": {
      "get": {
        "description": "Takes the list's filters. The whole workspace (and its people or website visitors) is counted exactly from maintained counts; narrower lists count at most 10,000 contacts, and beyond that capped is true, so the answer costs the same on any workspace size.",
        "operationId": "contacts-count",
        "parameters": [
          {
            "description": "Matches name, email or phone",
            "explode": false,
            "in": "query",
            "name": "q",
            "schema": {
              "description": "Matches name, email or phone",
              "maxLength": 200,
              "type": "string"
            }
          },
          {
            "description": "A saved contact view (GET /views?object=contact)",
            "explode": false,
            "in": "query",
            "name": "view_id",
            "schema": {
              "description": "A saved contact view (GET /views?object=contact)",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "An ad-hoc contact condition as JSON (GET /views/schema?object=contact), combined with the view",
            "explode": false,
            "in": "query",
            "name": "filter",
            "schema": {
              "description": "An ad-hoc contact condition as JSON (GET /views/schema?object=contact), combined with the view",
              "maxLength": 8000,
              "type": "string"
            }
          },
          {
            "description": "Only contacts with this tag",
            "explode": false,
            "in": "query",
            "name": "tag_id",
            "schema": {
              "description": "Only contacts with this tag",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "people: contacts with an email, phone, external or channel identity, a conversation, or added by the team; visitors: the other, anonymous website visitors; all (the default)",
            "explode": false,
            "in": "query",
            "name": "audience",
            "schema": {
              "description": "people: contacts with an email, phone, external or channel identity, a conversation, or added by the team; visitors: the other, anonymous website visitors; all (the default)",
              "enum": [
                "people",
                "visitors",
                "all",
                ""
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactCount"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "How many contacts a list request matches (capped)",
        "tags": [
          "contacts"
        ]
      }
    },
    "/contacts/duplicates": {
      "get": {
        "description": "Emails are compared normalised (lower case, without a +tag, Gmail dots ignored), phones as E.164. Groups marked \"Not a duplicate\" are left out.",
        "operationId": "contacts-duplicates",
        "parameters": [
          {
            "explode": false,
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 20,
              "format": "int64",
              "maximum": 50,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DuplicatesOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Groups of contacts that share an email or phone, newest first",
        "tags": [
          "contacts"
        ]
      }
    },
    "/contacts/duplicates/count": {
      "get": {
        "operationId": "contacts-duplicates-count",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactCount"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "How many duplicate groups the caller would see (capped at 1,000)",
        "tags": [
          "contacts"
        ]
      }
    },
    "/contacts/duplicates/{id}/dismiss": {
      "post": {
        "description": "Every pair of the group's contacts you may see is remembered; the group shows again only when another contact joins it. Audited.",
        "operationId": "contacts-duplicates-dismiss",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Not a duplicate: remember that the group's contacts are different people",
        "tags": [
          "contacts"
        ]
      }
    },
    "/contacts/exports": {
      "post": {
        "description": "Takes selected ids or all_matching with the list's filters. Emails, phones and sensitive attributes are masked or left out with the requester's grants when the export runs, as in the app; the requester may download the file for seven days. Audited.",
        "operationId": "contacts-export-create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactExportInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Export"
                }
              }
            },
            "description": "Accepted"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Export a selection of contacts as CSV, in the background",
        "tags": [
          "contacts"
        ]
      }
    },
    "/contacts/exports/{id}": {
      "get": {
        "operationId": "contacts-export-get",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Export"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "One of the caller's contact exports",
        "tags": [
          "contacts"
        ]
      }
    },
    "/contacts/exports/{id}/download": {
      "get": {
        "operationId": "contacts-export-download",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The file"
          },
          "302": {
            "description": "Redirect to a signed URL"
          }
        },
        "summary": "Download a finished contact export (CSV)",
        "tags": [
          "contacts"
        ]
      }
    },
    "/contacts/imports": {
      "get": {
        "operationId": "contacts-imports",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactImportsOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Recent contact imports",
        "tags": [
          "contacts"
        ]
      },
      "post": {
        "description": "Stores the file and answers with its columns, a suggested mapping and the first rows. Comma, semicolon or tab separated, UTF-8, a header row; up to 100 MB and 1,000,000 rows.",
        "operationId": "contacts-import-upload",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "properties": {
                  "filename": {
                    "contentMediaType": "application/octet-stream",
                    "description": "filename of the file being uploaded",
                    "format": "binary",
                    "type": "string"
                  },
                  "name": {
                    "description": "general purpose name for multipart form value",
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactImportUploadOutputBody"
                }
              }
            },
            "description": "Created"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Upload a CSV file of contacts (multipart: file)",
        "tags": [
          "contacts"
        ]
      }
    },
    "/contacts/imports/{id}": {
      "get": {
        "operationId": "contacts-import-get",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactImport"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "One contact import and its progress",
        "tags": [
          "contacts"
        ]
      }
    },
    "/contacts/imports/{id}/errors": {
      "get": {
        "operationId": "contacts-import-errors",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "contentEncoding": "base64",
                  "type": "string"
                }
              }
            },
            "description": "OK",
            "headers": {
              "Content-Disposition": {
                "schema": {
                  "type": "string"
                }
              },
              "Content-Type": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "The rows that failed, as CSV (the file's columns, then line and error)",
        "tags": [
          "contacts"
        ]
      }
    },
    "/contacts/imports/{id}/preview": {
      "post": {
        "description": "Applies the rows in a transaction that is rolled back: nothing is written.",
        "operationId": "contacts-import-preview",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactImportRunInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactImportPreviewOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Dry run: what the first 1,000 rows would do with this mapping",
        "tags": [
          "contacts"
        ]
      }
    },
    "/contacts/imports/{id}/start": {
      "post": {
        "operationId": "contacts-import-start",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactImportRunInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactImport"
                }
              }
            },
            "description": "Accepted"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Start the import in the background",
        "tags": [
          "contacts"
        ]
      }
    },
    "/contacts/{id}": {
      "delete": {
        "operationId": "contacts-erase",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Erase a contact's personal data (irreversible)",
        "tags": [
          "contacts"
        ]
      },
      "get": {
        "operationId": "contacts-get",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Get a contact (follows merges)",
        "tags": [
          "contacts"
        ]
      },
      "put": {
        "operationId": "contacts-update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Update name, company, avatar and custom attributes",
        "tags": [
          "contacts"
        ]
      }
    },
    "/contacts/{id}/activity": {
      "get": {
        "operationId": "contacts-activity",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "format": "int64",
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactActivityOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "A contact's timeline: conversations, notes, tags and changes, newest first",
        "tags": [
          "contacts"
        ]
      }
    },
    "/contacts/{id}/attributes": {
      "patch": {
        "operationId": "contacts-attributes-patch",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AttrPatchInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Set or remove some custom attributes of a contact, keeping the others",
        "tags": [
          "contacts"
        ]
      }
    },
    "/contacts/{id}/attributes/provenance": {
      "get": {
        "operationId": "contacts-attributes-provenance",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProvenanceOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Who or what last set each custom attribute of a contact",
        "tags": [
          "contacts"
        ]
      }
    },
    "/contacts/{id}/avatar": {
      "get": {
        "operationId": "contacts-avatar",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The picture"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "A contact's picture as its channel provided it (Telegram)",
        "tags": [
          "contacts"
        ]
      }
    },
    "/contacts/{id}/changes": {
      "get": {
        "operationId": "contacts-changes",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "format": "int64",
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactChangesOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Changes the customer's site made to a contact at sign-in, newest first",
        "tags": [
          "contacts"
        ]
      }
    },
    "/contacts/{id}/csat": {
      "get": {
        "operationId": "contacts-csat",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CsatListOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Satisfaction responses of a contact's conversations the caller may see",
        "tags": [
          "contacts"
        ]
      }
    },
    "/contacts/{id}/identities": {
      "post": {
        "operationId": "contacts-add-identity",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IdentityInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactOutputBody"
                }
              }
            },
            "description": "Created"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Add an email, phone or id to a contact",
        "tags": [
          "contacts"
        ]
      }
    },
    "/contacts/{id}/identities/{identity_id}": {
      "delete": {
        "operationId": "contacts-remove-identity",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "path",
            "name": "identity_id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Remove an identity from a contact",
        "tags": [
          "contacts"
        ]
      }
    },
    "/contacts/{id}/merge": {
      "post": {
        "operationId": "contacts-merge",
        "parameters": [
          {
            "description": "The contact that survives",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "description": "The contact that survives",
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MergeInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Merge another contact into this one",
        "tags": [
          "contacts"
        ]
      }
    },
    "/contacts/{id}/notes": {
      "get": {
        "operationId": "contacts-notes",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactNotesOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Notes on a contact, newest first",
        "tags": [
          "contacts"
        ]
      },
      "post": {
        "operationId": "contacts-add-note",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactNoteInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactNoteOutputBody"
                }
              }
            },
            "description": "Created"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Add a note to a contact",
        "tags": [
          "contacts"
        ]
      }
    },
    "/contacts/{id}/notes/{note_id}": {
      "delete": {
        "operationId": "contacts-delete-note",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "path",
            "name": "note_id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Delete a note (its author, or someone who may erase contacts)",
        "tags": [
          "contacts"
        ]
      }
    },
    "/contacts/{id}/preview": {
      "get": {
        "description": "Emails, phones and sensitive attributes are redacted with the caller's grants, as everywhere; notes follow the internal-note grant.",
        "operationId": "contacts-preview",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactPreviewOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "A contact at a glance: recent conversations, tags, identities, attributes and notes",
        "tags": [
          "contacts"
        ]
      }
    },
    "/contacts/{id}/tags": {
      "put": {
        "operationId": "contacts-set-tags",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactTagsInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Replace the tags on a contact",
        "tags": [
          "contacts"
        ]
      }
    },
    "/conversations": {
      "get": {
        "operationId": "conversations-list",
        "parameters": [
          {
            "explode": false,
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "format": "int64",
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "Status key",
            "explode": false,
            "in": "query",
            "name": "status",
            "schema": {
              "description": "Status key",
              "maxLength": 40,
              "type": "string"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "category",
            "schema": {
              "enum": [
                "open",
                "pending",
                "snoozed",
                "resolved",
                "closed",
                ""
              ],
              "type": "string"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "inbox_id",
            "schema": {
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "assignee_id",
            "schema": {
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "unassigned",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "team_id",
            "schema": {
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "tag_id",
            "schema": {
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "contact_id",
            "schema": {
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "priority",
            "schema": {
              "enum": [
                "none",
                "low",
                "medium",
                "high",
                "urgent",
                ""
              ],
              "type": "string"
            }
          },
          {
            "description": "Matches subject or last message",
            "explode": false,
            "in": "query",
            "name": "q",
            "schema": {
              "description": "Matches subject or last message",
              "maxLength": 200,
              "type": "string"
            }
          },
          {
            "description": "Apply a saved view's condition",
            "explode": false,
            "in": "query",
            "name": "view_id",
            "schema": {
              "description": "Apply a saved view's condition",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Ad-hoc condition as JSON (see GET /views/schema)",
            "explode": false,
            "in": "query",
            "name": "filter",
            "schema": {
              "description": "Ad-hoc condition as JSON (see GET /views/schema)",
              "maxLength": 4000,
              "type": "string"
            }
          },
          {
            "description": "Defaults to last activity, newest first",
            "explode": false,
            "in": "query",
            "name": "sort",
            "schema": {
              "description": "Defaults to last activity, newest first",
              "enum": [
                "last_activity",
                "oldest_waiting",
                "priority",
                "created",
                ""
              ],
              "type": "string"
            }
          },
          {
            "description": "Only the conversations behind a report number: created, first responded to, resolved (currently, counted at their resolution), assigned, first assigned (first_assignment), taken from an agent while open (reassigned), with replies (messages: either direction; messages_in, messages_out: one), offered a survey (csat_sent), rated (csat_responses), handled, resolved or handed off by a bot, resolved in the window and reopened since (reopened), resolved with one reply (one_touch), resolved and followed by another conversation of the contact within 7 days (repeat_contact), website chats resolved without a reply (missed_chat), or whose SLA target was met or breached in the window. Two numbers are of now and take no window: backlog (open and pending, with report_age and report_waiting) and sla_breached_now (past an SLA target and still waiting, with report_sla). The response then carries total (conversations, so fewer than a messages or survey count).",
            "explode": false,
            "in": "query",
            "name": "report_metric",
            "schema": {
              "description": "Only the conversations behind a report number: created, first responded to, resolved (currently, counted at their resolution), assigned, first assigned (first_assignment), taken from an agent while open (reassigned), with replies (messages: either direction; messages_in, messages_out: one), offered a survey (csat_sent), rated (csat_responses), handled, resolved or handed off by a bot, resolved in the window and reopened since (reopened), resolved with one reply (one_touch), resolved and followed by another conversation of the contact within 7 days (repeat_contact), website chats resolved without a reply (missed_chat), or whose SLA target was met or breached in the window. Two numbers are of now and take no window: backlog (open and pending, with report_age and report_waiting) and sla_breached_now (past an SLA target and still waiting, with report_sla). The response then carries total (conversations, so fewer than a messages or survey count).",
              "enum": [
                "created",
                "first_response",
                "resolved",
                "assigned",
                "messages",
                "messages_in",
                "messages_out",
                "csat_sent",
                "csat_responses",
                "bot_handled",
                "bot_resolved",
                "bot_handoff",
                "first_assignment",
                "reassigned",
                "reopened",
                "one_touch",
                "repeat_contact",
                "missed_chat",
                "sla_first_response_met",
                "sla_first_response_breached",
                "sla_resolution_met",
                "sla_resolution_breached",
                "backlog",
                "sla_breached_now",
                ""
              ],
              "type": "string"
            }
          },
          {
            "description": "Report window start day YYYY-MM-DD (inclusive) in report_tz",
            "explode": false,
            "in": "query",
            "name": "report_from",
            "schema": {
              "description": "Report window start day YYYY-MM-DD (inclusive) in report_tz",
              "type": "string"
            }
          },
          {
            "description": "Report window end day YYYY-MM-DD (inclusive) in report_tz",
            "explode": false,
            "in": "query",
            "name": "report_to",
            "schema": {
              "description": "Report window end day YYYY-MM-DD (inclusive) in report_tz",
              "type": "string"
            }
          },
          {
            "description": "The report's time zone; empty uses the workspace's, else UTC",
            "explode": false,
            "in": "query",
            "name": "report_tz",
            "schema": {
              "description": "The report's time zone; empty uses the workspace's, else UTC",
              "type": "string"
            }
          },
          {
            "description": "Counted under this inbox",
            "explode": false,
            "in": "query",
            "name": "report_inbox_id",
            "schema": {
              "description": "Counted under this inbox",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Counted under this team",
            "explode": false,
            "in": "query",
            "name": "report_team_id",
            "schema": {
              "description": "Counted under this team",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Counted under this agent (the assignee; for first_response the agent who replied first; for assigned the agent given it)",
            "explode": false,
            "in": "query",
            "name": "report_agent_id",
            "schema": {
              "description": "Counted under this agent (the assignee; for first_response the agent who replied first; for assigned the agent given it)",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Counted under this tag",
            "explode": false,
            "in": "query",
            "name": "report_tag_id",
            "schema": {
              "description": "Counted under this tag",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "With a bot metric: this bot's conversations (0: every bot)",
            "explode": false,
            "in": "query",
            "name": "report_bot_id",
            "schema": {
              "description": "With a bot metric: this bot's conversations (0: every bot)",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Only this weekday in report_tz (1 = Monday .. 7 = Sunday; 0 = any), as the heatmap",
            "explode": false,
            "in": "query",
            "name": "report_weekday",
            "schema": {
              "description": "Only this weekday in report_tz (1 = Monday .. 7 = Sunday; 0 = any), as the heatmap",
              "format": "int64",
              "maximum": 7,
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Only this hour of the day in report_tz (-1 = any), as the heatmap",
            "explode": false,
            "in": "query",
            "name": "report_hour",
            "schema": {
              "default": -1,
              "description": "Only this hour of the day in report_tz (-1 = any), as the heatmap",
              "format": "int64",
              "maximum": 23,
              "minimum": -1,
              "type": "integer"
            }
          },
          {
            "description": "Counted under this value of the category attribute (GET /reports/categories value_id)",
            "explode": false,
            "in": "query",
            "name": "report_attr_id",
            "schema": {
              "description": "Counted under this value of the category attribute (GET /reports/categories value_id)",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "With an SLA metric: under this policy",
            "explode": false,
            "in": "query",
            "name": "report_policy_id",
            "schema": {
              "description": "With an SLA metric: under this policy",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Counted in an inbox of this channel kind (email, web_chat, ...)",
            "explode": false,
            "in": "query",
            "name": "report_channel",
            "schema": {
              "description": "Counted in an inbox of this channel kind (email, web_chat, ...)",
              "maxLength": 64,
              "type": "string"
            }
          },
          {
            "description": "With backlog: created this long ago",
            "explode": false,
            "in": "query",
            "name": "report_age",
            "schema": {
              "description": "With backlog: created this long ago",
              "enum": [
                "lt1h",
                "1to4h",
                "4to24h",
                "1to3d",
                "3to7d",
                "gt7d",
                ""
              ],
              "type": "string"
            }
          },
          {
            "description": "With backlog: waiting on the team (open, the customer wrote last) or on the customer",
            "explode": false,
            "in": "query",
            "name": "report_waiting",
            "schema": {
              "description": "With backlog: waiting on the team (open, the customer wrote last) or on the customer",
              "enum": [
                "us",
                "customer",
                ""
              ],
              "type": "string"
            }
          },
          {
            "description": "With sla_breached_now: which target",
            "explode": false,
            "in": "query",
            "name": "report_sla",
            "schema": {
              "description": "With sla_breached_now: which target",
              "enum": [
                "first_response",
                "resolution",
                ""
              ],
              "type": "string"
            }
          },
          {
            "description": "With csat_responses: only these ratings, such as 4,5 (the score's positive responses) or 1,2",
            "explode": false,
            "in": "query",
            "name": "report_rating",
            "schema": {
              "description": "With csat_responses: only these ratings, such as 4,5 (the score's positive responses) or 1,2",
              "maxLength": 20,
              "pattern": "^[1-5](,[1-5])*$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConvListOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "List conversations the caller may see, most recent activity first",
        "tags": [
          "conversations"
        ]
      },
      "post": {
        "operationId": "conversations-create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConvCreateInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConvOutputBody"
                }
              }
            },
            "description": "Created"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Start a conversation with a contact from an inbox",
        "tags": [
          "conversations"
        ]
      }
    },
    "/conversations/counts": {
      "get": {
        "operationId": "conversations-counts",
        "parameters": [
          {
            "explode": false,
            "in": "query",
            "name": "inbox_id",
            "schema": {
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Counts"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Sidebar counts over the caller's visibility",
        "tags": [
          "conversations"
        ]
      }
    },
    "/conversations/search": {
      "get": {
        "operationId": "conversations-search",
        "parameters": [
          {
            "description": "Words to find; quotes for phrases, - to exclude (websearch syntax)",
            "explode": false,
            "in": "query",
            "name": "q",
            "schema": {
              "description": "Words to find; quotes for phrases, - to exclude (websearch syntax)",
              "maxLength": 200,
              "minLength": 2,
              "type": "string"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "inbox_id",
            "schema": {
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 20,
              "format": "int64",
              "maximum": 50,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "offset",
            "schema": {
              "format": "int64",
              "maximum": 1000,
              "minimum": 0,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Search messages, subjects and contact names",
        "tags": [
          "conversations"
        ]
      }
    },
    "/conversations/{id}": {
      "get": {
        "operationId": "conversations-get",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConvOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Get a conversation",
        "tags": [
          "conversations"
        ]
      },
      "patch": {
        "operationId": "conversations-update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConvPatchInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConvOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Change status, priority, assignment, team, subject, snooze or attributes",
        "tags": [
          "conversations"
        ]
      }
    },
    "/conversations/{id}/attributes": {
      "patch": {
        "operationId": "conversations-attributes-patch",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AttrPatchInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConvOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Set or remove some custom attributes of a conversation, keeping the others",
        "tags": [
          "conversations"
        ]
      }
    },
    "/conversations/{id}/attributes/provenance": {
      "get": {
        "operationId": "conversations-attributes-provenance",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProvenanceOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Who or what last set each custom attribute of a conversation",
        "tags": [
          "conversations"
        ]
      }
    },
    "/conversations/{id}/connectors": {
      "get": {
        "operationId": "conversation-connectors",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationConnectorsOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "The connectors' panels and the attribute values they filled for a conversation",
        "tags": [
          "connectors"
        ]
      }
    },
    "/conversations/{id}/connectors/open": {
      "post": {
        "operationId": "conversation-connectors-open",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationConnectorsOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "The conversation was opened: queue the connectors whose answer is missing or older than their cache time, and return the panels",
        "tags": [
          "connectors"
        ]
      }
    },
    "/conversations/{id}/connectors/{connector_id}/refresh": {
      "post": {
        "operationId": "conversation-connector-refresh",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "path",
            "name": "connector_id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationRefreshOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Run one connector now for this conversation (Refresh in the panel)",
        "tags": [
          "connectors"
        ]
      }
    },
    "/conversations/{id}/csat": {
      "get": {
        "operationId": "conversations-csat",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CsatListOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Satisfaction responses of a conversation, newest first",
        "tags": [
          "conversations"
        ]
      }
    },
    "/conversations/{id}/export": {
      "get": {
        "description": "Private notes are included only for roles that see internal notes (masked for roles that see them masked); emails, phones and agent names follow the role's field grants, as in the app. Attachments are listed by name. Audited.",
        "operationId": "conversations-export",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "txt (the default), html or json",
            "explode": false,
            "in": "query",
            "name": "format",
            "schema": {
              "default": "txt",
              "description": "txt (the default), html or json",
              "enum": [
                "txt",
                "html",
                "json",
                ""
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "contentEncoding": "base64",
                  "type": "string"
                }
              }
            },
            "description": "OK",
            "headers": {
              "Content-Disposition": {
                "schema": {
                  "type": "string"
                }
              },
              "Content-Type": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Download one conversation as text, HTML or JSON",
        "tags": [
          "conversations"
        ]
      }
    },
    "/conversations/{id}/handoff": {
      "post": {
        "operationId": "conversations-handoff",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Take the conversation over from its bot",
        "tags": [
          "conversations"
        ]
      }
    },
    "/conversations/{id}/knowledge-draft": {
      "post": {
        "operationId": "kb-draft-from-conversation",
        "parameters": [
          {
            "description": "Conversation",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "description": "Conversation",
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/KbDraftInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KbArticleView"
                }
              }
            },
            "description": "Created"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Create a draft article from a conversation (subject as title, the agents' replies as body, emails and phone numbers removed)",
        "tags": [
          "knowledge"
        ]
      }
    },
    "/conversations/{id}/macros/{macro_id}": {
      "post": {
        "operationId": "macros-apply",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "in": "path",
            "name": "macro_id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MacroApplyOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Apply a macro to a conversation with your own permissions",
        "tags": [
          "automations"
        ]
      }
    },
    "/conversations/{id}/mentionable": {
      "get": {
        "description": "Active members who can see the conversation and its private notes (their own role scope, teams, inboxes and internal-note grant), ordered by name, at most 50. The caller needs messages:write_private.",
        "operationId": "conversations-mentionable",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "Matches the start of any word of the name, case-insensitive",
            "explode": false,
            "in": "query",
            "name": "q",
            "schema": {
              "description": "Matches the start of any word of the name, case-insensitive",
              "maxLength": 100,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MentionableOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Members a private note on this conversation may mention",
        "tags": [
          "conversations"
        ]
      }
    },
    "/conversations/{id}/messages": {
      "get": {
        "operationId": "messages-list",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "Return messages after this id (oldest first)",
            "explode": false,
            "in": "query",
            "name": "after_id",
            "schema": {
              "description": "Return messages after this id (oldest first)",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Return the newest messages before this id, still oldest first; has_more then says whether older messages exist",
            "explode": false,
            "in": "query",
            "name": "before_id",
            "schema": {
              "description": "Return the newest messages before this id, still oldest first; has_more then says whether older messages exist",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Return the newest page (oldest first within it); has_more says whether older messages exist. Page back with before_id set to the first message returned",
            "explode": false,
            "in": "query",
            "name": "latest",
            "schema": {
              "description": "Return the newest page (oldest first within it); has_more says whether older messages exist. Page back with before_id set to the first message returned",
              "type": "boolean"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 100,
              "format": "int64",
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessagesListOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Messages in a conversation, oldest first",
        "tags": [
          "conversations"
        ]
      },
      "post": {
        "operationId": "messages-create",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MessageCreateInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Message"
                }
              }
            },
            "description": "Created"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Send a reply or add a private note",
        "tags": [
          "conversations"
        ]
      }
    },
    "/conversations/{id}/messages/upload": {
      "post": {
        "operationId": "messages-upload",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "properties": {
                  "filename": {
                    "contentMediaType": "application/octet-stream",
                    "description": "filename of the file being uploaded",
                    "format": "binary",
                    "type": "string"
                  },
                  "name": {
                    "description": "general purpose name for multipart form value",
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageWithFilesOutputBody"
                }
              }
            },
            "description": "Created"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Send a reply or note with files (multipart: content, kind, files, and for notes mention_ids as comma-separated member ids)",
        "tags": [
          "conversations"
        ]
      }
    },
    "/conversations/{id}/messages/{message_id}/raw": {
      "get": {
        "operationId": "messages-raw-download",
        "parameters": [
          {
            "description": "The conversation",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "description": "The conversation",
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "An inbound email message of it",
            "in": "path",
            "name": "message_id",
            "required": true,
            "schema": {
              "description": "An inbound email message of it",
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The RFC 822 message"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Download an inbound email as it arrived (.eml); inboxes:manage, and the whole message visible in clear; audited",
        "tags": [
          "conversations"
        ]
      }
    },
    "/conversations/{id}/read": {
      "post": {
        "operationId": "conversations-read",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Mark the conversation as read by the caller",
        "tags": [
          "conversations"
        ]
      }
    },
    "/conversations/{id}/tags": {
      "put": {
        "operationId": "conversations-set-tags",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConvTagsInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConvOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Replace the tags on a conversation",
        "tags": [
          "conversations"
        ]
      }
    },
    "/conversations/{id}/visitor": {
      "get": {
        "description": "What the visitor's browser collected on the customer's site (sent with their first message, never before) and what the server derived from that request. The IP address is tagged ip_address and follows the role's field grants; the location comes from DB-IP's offline database and geo_attribution must be shown with it.",
        "operationId": "conversations-visitor",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VisitorContextOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Visitor context of a web chat: location, network, pages, device, campaign",
        "tags": [
          "conversations"
        ]
      }
    },
    "/custom-attributes": {
      "get": {
        "operationId": "attributes-list",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AttrListOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "List custom attribute definitions",
        "tags": [
          "contacts"
        ]
      },
      "post": {
        "operationId": "attributes-create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AttrCreateInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AttributeDefinition"
                }
              }
            },
            "description": "Created"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Define a custom attribute",
        "tags": [
          "contacts"
        ]
      }
    },
    "/custom-attributes/undeclared": {
      "get": {
        "operationId": "attributes-undeclared",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UndeclaredOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Keys the website sign-in sends that no contact attribute declares",
        "tags": [
          "contacts"
        ]
      }
    },
    "/custom-attributes/usage": {
      "get": {
        "operationId": "attributes-usage",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AttrUsageListOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Where every attribute is used: values held, and the rules, views, macros and canned responses that mention it",
        "tags": [
          "contacts"
        ]
      }
    },
    "/custom-attributes/{id}": {
      "delete": {
        "operationId": "attributes-delete",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "The attribute's key, required when it is in use (values or references)",
            "explode": false,
            "in": "query",
            "name": "confirm",
            "schema": {
              "description": "The attribute's key, required when it is in use (values or references)",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Delete a definition and the values records hold; when in use, confirm with ?confirm=<key>",
        "tags": [
          "contacts"
        ]
      },
      "put": {
        "operationId": "attributes-update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AttrUpdateInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AttributeDefinition"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Rename, describe, reorder options or change the source; key and type only while unused",
        "tags": [
          "contacts"
        ]
      }
    },
    "/custom-attributes/{id}/usage": {
      "get": {
        "operationId": "attributes-get-usage",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AttributeUsage"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Where one attribute is used (the delete impact)",
        "tags": [
          "contacts"
        ]
      }
    },
    "/exports": {
      "get": {
        "operationId": "exports-list",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExportsOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "The caller's recent exports",
        "tags": [
          "exports"
        ]
      },
      "post": {
        "description": "Takes the conversation list's filters. The file holds one conversation per line with its messages, redacted with the requester's grants when the export runs; it can be downloaded by the requester for seven days. Audited.",
        "operationId": "exports-create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExportFilter"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Export"
                }
              }
            },
            "description": "Accepted"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Export the conversations of a view as JSON Lines, in the background",
        "tags": [
          "exports"
        ]
      }
    },
    "/exports/{id}": {
      "get": {
        "operationId": "exports-get",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Export"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "One of the caller's exports",
        "tags": [
          "exports"
        ]
      }
    },
    "/exports/{id}/download": {
      "get": {
        "operationId": "exports-download",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The file"
          },
          "302": {
            "description": "Redirect to a signed URL"
          }
        },
        "summary": "Download a finished export (JSON Lines)",
        "tags": [
          "exports"
        ]
      }
    },
    "/flows": {
      "get": {
        "operationId": "flows-list",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowListOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Chatbot flows with their inboxes and the last 7 days",
        "tags": [
          "flows"
        ]
      },
      "post": {
        "operationId": "flows-create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FlowCreateInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowDetail"
                }
              }
            },
            "description": "Created"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Create a flow, blank or from a starter template",
        "tags": [
          "flows"
        ]
      }
    },
    "/flows/{id}": {
      "delete": {
        "operationId": "flows-delete",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Delete a flow; conversations it holds go to people and it leaves every inbox",
        "tags": [
          "flows"
        ]
      },
      "get": {
        "operationId": "flows-get",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowDetail"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "A flow with its draft and the draft's validation",
        "tags": [
          "flows"
        ]
      },
      "put": {
        "operationId": "flows-update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FlowUpdateInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowDetail"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Rename a flow",
        "tags": [
          "flows"
        ]
      }
    },
    "/flows/{id}/analytics": {
      "get": {
        "operationId": "flows-analytics",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "days",
            "schema": {
              "default": 7,
              "format": "int64",
              "maximum": 90,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "One published version; 0 for all",
            "explode": false,
            "in": "query",
            "name": "version_id",
            "schema": {
              "description": "One published version; 0 for all",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowAnalyticsOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Sessions and per-step counts (entered, answered, dropped) for the analytics overlay",
        "tags": [
          "flows"
        ]
      }
    },
    "/flows/{id}/draft": {
      "put": {
        "operationId": "flows-save-draft",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FlowDraftInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowDraftOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Save the draft (the editor autosaves); running conversations are not affected until a publish",
        "tags": [
          "flows"
        ]
      }
    },
    "/flows/{id}/files": {
      "get": {
        "operationId": "flows-files",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowFilesOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Images and files the flow's Message steps can send",
        "tags": [
          "flows"
        ]
      },
      "post": {
        "operationId": "flows-file-upload",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "properties": {
                  "filename": {
                    "contentMediaType": "application/octet-stream",
                    "description": "filename of the file being uploaded",
                    "format": "binary",
                    "type": "string"
                  },
                  "name": {
                    "description": "general purpose name for multipart form value",
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowFile"
                }
              }
            },
            "description": "Created"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Upload an image or file for a Message step (multipart: file)",
        "tags": [
          "flows"
        ]
      }
    },
    "/flows/{id}/files/{file_id}": {
      "get": {
        "operationId": "flows-file-download",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "path",
            "name": "file_id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The file"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "A flow file, for the editor's preview",
        "tags": [
          "flows"
        ]
      }
    },
    "/flows/{id}/inboxes": {
      "post": {
        "operationId": "flows-attach",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FlowAttachInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowAttachOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Add the flow to an inbox's bots and flows (at the end of its order)",
        "tags": [
          "flows"
        ]
      }
    },
    "/flows/{id}/inboxes/{inbox_id}": {
      "delete": {
        "operationId": "flows-detach",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "path",
            "name": "inbox_id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Take the flow out of an inbox's bots and flows; conversations it holds finish",
        "tags": [
          "flows"
        ]
      }
    },
    "/flows/{id}/publish": {
      "post": {
        "operationId": "flows-publish",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowPublishOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Publish the draft as a new version; conversations already in the flow finish on the version they started",
        "tags": [
          "flows"
        ]
      }
    },
    "/flows/{id}/simulate": {
      "post": {
        "operationId": "flows-simulate",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FlowSimInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowSimOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Run the draft in the editor's simulator: nothing is sent, saved or handed off",
        "tags": [
          "flows"
        ]
      }
    },
    "/flows/{id}/start": {
      "post": {
        "description": "The flow must be published and listed (switched on) in the inbox's bots and flows. On web chat the contact must be a signed-in visitor (D-096); the widget opens for them.",
        "operationId": "flows-start",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FlowStartInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowStartOutputBody"
                }
              }
            },
            "description": "Created"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Start the flow with a contact (proactive): a new conversation the flow bot holds",
        "tags": [
          "flows"
        ]
      }
    },
    "/flows/{id}/versions": {
      "get": {
        "operationId": "flows-versions",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowVersionsOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Published versions, newest first",
        "tags": [
          "flows"
        ]
      }
    },
    "/health/live": {
      "get": {
        "operationId": "health-live",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Liveness",
        "tags": [
          "health"
        ]
      }
    },
    "/health/ready": {
      "get": {
        "operationId": "health-ready",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Readiness: the database answers",
        "tags": [
          "health"
        ]
      }
    },
    "/imports": {
      "get": {
        "operationId": "imports-list",
        "parameters": [
          {
            "explode": false,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "format": "int64",
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportListOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "List imports from other help desks, newest first",
        "tags": [
          "imports"
        ]
      }
    },
    "/imports/chatwoot/connection": {
      "delete": {
        "operationId": "imports-chatwoot-disconnect",
        "responses": {
          "204": {
            "description": "No Content"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Forget the Chatwoot connection and its token",
        "tags": [
          "imports"
        ]
      },
      "get": {
        "operationId": "imports-chatwoot-connection",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatwootConnectionOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "The workspace's Chatwoot connection (never its token)",
        "tags": [
          "imports"
        ]
      },
      "put": {
        "operationId": "imports-chatwoot-connect",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatwootConnectInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatwootConnectionOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Connect a Chatwoot account (checked, then saved with the token sealed)",
        "tags": [
          "imports"
        ]
      }
    },
    "/imports/chatwoot/jobs": {
      "get": {
        "operationId": "imports-chatwoot-jobs",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatwootJobsOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "The wizard's runs, newest first (without reports)",
        "tags": [
          "imports"
        ]
      },
      "post": {
        "description": "One job waits or runs per workspace (409 otherwise). A catch-up (delta) needs a successful import first (422).",
        "operationId": "imports-chatwoot-start",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatwootJobInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportJob"
                }
              }
            },
            "description": "Accepted"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Start a dry run, the import or a catch-up in the background",
        "tags": [
          "imports"
        ]
      }
    },
    "/imports/chatwoot/jobs/{id}": {
      "get": {
        "operationId": "imports-chatwoot-job",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportJob"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "A run's progress (counts per entity) and, once it ended, its report",
        "tags": [
          "imports"
        ]
      }
    },
    "/imports/chatwoot/jobs/{id}/cancel": {
      "post": {
        "operationId": "imports-chatwoot-cancel",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportJob"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Stop a run; what it imported stays, and a later run continues from there",
        "tags": [
          "imports"
        ]
      }
    },
    "/imports/chatwoot/test": {
      "post": {
        "operationId": "imports-chatwoot-test",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatwootTestInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatwootTestOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Check a Chatwoot address and access token and list the token's accounts",
        "tags": [
          "imports"
        ]
      }
    },
    "/imports/{id}": {
      "get": {
        "operationId": "imports-get",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportRunDetail"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Get an import with its report",
        "tags": [
          "imports"
        ]
      }
    },
    "/inboxes": {
      "get": {
        "operationId": "inboxes-list",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InboxListOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "List inboxes",
        "tags": [
          "inboxes"
        ]
      },
      "post": {
        "operationId": "inboxes-create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InboxCreateInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Inbox"
                }
              }
            },
            "description": "Created"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Create an inbox on a channel",
        "tags": [
          "inboxes"
        ]
      }
    },
    "/inboxes/{id}": {
      "delete": {
        "operationId": "inboxes-delete",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Delete an inbox that has no conversations",
        "tags": [
          "inboxes"
        ]
      },
      "get": {
        "operationId": "inboxes-get",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Inbox"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Get an inbox with its configuration",
        "tags": [
          "inboxes"
        ]
      },
      "put": {
        "operationId": "inboxes-update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InboxUpdateInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Inbox"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Update an inbox; secret fields left out keep their value",
        "tags": [
          "inboxes"
        ]
      }
    },
    "/inboxes/{id}/demo-identity": {
      "post": {
        "description": "For trying signed-in visitors on /widget/demo/. The customer is fixed; the signatures use the inbox's identity secret.",
        "operationId": "inboxes-demo-identity",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DemoIdentity"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "A signed identity of the demo store's test customer for this inbox",
        "tags": [
          "inboxes"
        ]
      }
    },
    "/inboxes/{id}/identity-secret/reveal": {
      "post": {
        "operationId": "inboxes-identity-secret-reveal",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdentitySecretOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Show a web chat inbox's identity secret (audited)",
        "tags": [
          "inboxes"
        ]
      }
    },
    "/inboxes/{id}/identity-secret/rotate": {
      "post": {
        "description": "Signatures made with the previous secret stop working at once.",
        "operationId": "inboxes-identity-secret-rotate",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdentitySecretOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Create or replace a web chat inbox's identity secret (audited)",
        "tags": [
          "inboxes"
        ]
      }
    },
    "/inboxes/{id}/identity-secret/test": {
      "post": {
        "description": "Nothing is stored. Each signature is valid, invalid, missing or unusable (its input is missing or malformed).",
        "operationId": "inboxes-identity-signature-test",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SignatureTestInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignatureTestOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Check signatures your server made against the inbox's identity secret",
        "tags": [
          "inboxes"
        ]
      }
    },
    "/inboxes/{id}/members": {
      "put": {
        "operationId": "inboxes-set-members",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InboxMembersInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Inbox"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Replace the agents who work an inbox",
        "tags": [
          "inboxes"
        ]
      }
    },
    "/inboxes/{id}/messages": {
      "post": {
        "operationId": "inboxes-inbound-message",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiInboundInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiInboundOutputBody"
                }
              }
            },
            "description": "Created"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Record a customer message in an API inbox (as if the customer wrote it)",
        "tags": [
          "inboxes"
        ]
      }
    },
    "/inboxes/{id}/reconnect": {
      "post": {
        "operationId": "inboxes-reconnect",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InboxReconnectInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Inbox"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Connect an imported history inbox to its live channel (a Chatwoot Telegram inbox to a Telegram bot); the imported customers are recognised",
        "tags": [
          "inboxes"
        ]
      }
    },
    "/inboxes/{id}/responders": {
      "get": {
        "operationId": "responders-list",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RespondersOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "The inbox's bots and flows in the order they are offered new conversations",
        "tags": [
          "inboxes"
        ]
      },
      "put": {
        "description": "The first enabled automatic entry whose conditions match a new conversation holds it; none match, people have it. Adding or removing a bot needs bots:manage, a flow flows:manage.",
        "operationId": "responders-put",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RespondersPutInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RespondersOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Set the inbox's bots and flows: order, conditions, on or off",
        "tags": [
          "inboxes"
        ]
      }
    },
    "/inboxes/{id}/slack/channels": {
      "get": {
        "operationId": "slack-channels",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SlackChannelsOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "The Slack channels a Slack inbox's bot can see, for choosing the ones it listens to",
        "tags": [
          "inboxes"
        ]
      }
    },
    "/inboxes/{id}/visitors": {
      "get": {
        "operationId": "inbox-visitors",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VisitorsOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Widget visitors currently on the site, for a proactive chat",
        "tags": [
          "inboxes"
        ]
      }
    },
    "/integrations/catalog": {
      "get": {
        "operationId": "integrations-catalog",
        "parameters": [
          {
            "explode": false,
            "in": "query",
            "name": "q",
            "schema": {
              "maxLength": 100,
              "type": "string"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "kind",
            "schema": {
              "enum": [
                "channel",
                "native",
                "connector_recipe",
                "app",
                "template",
                "plugin",
                ""
              ],
              "type": "string"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "category",
            "schema": {
              "enum": [
                "channels",
                "commerce",
                "crm",
                "engineering",
                "team_chat",
                "ai",
                "automation",
                "analytics",
                "other",
                ""
              ],
              "type": "string"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "featured",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "Search names and summaries in this language too",
            "explode": false,
            "in": "query",
            "name": "locale",
            "schema": {
              "description": "Search names and summaries in this language too",
              "maxLength": 10,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogListOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Browse the integrations catalog: search, category, kind and featured; the workspace's own apps are listed as private",
        "tags": [
          "integrations"
        ]
      }
    },
    "/integrations/catalog/{slug}": {
      "get": {
        "operationId": "integrations-catalog-get",
        "parameters": [
          {
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "maxLength": 100,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogDetail"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "One catalog entry: what it does, the data it reads and writes, scopes, publisher, editions and its settings form",
        "tags": [
          "integrations"
        ]
      }
    },
    "/integrations/installations": {
      "get": {
        "operationId": "integrations-installations",
        "parameters": [
          {
            "description": "Default: every one that is not uninstalled",
            "explode": false,
            "in": "query",
            "name": "status",
            "schema": {
              "description": "Default: every one that is not uninstalled",
              "enum": [
                "all",
                "active",
                "paused",
                "needs_reconnect",
                "error",
                "uninstalled",
                ""
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstallationsOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "What is installed: status, health, last error, scopes and pending updates, and the core modules' settings sections",
        "tags": [
          "integrations"
        ]
      },
      "post": {
        "operationId": "integrations-install",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InstallInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstallationView"
                }
              }
            },
            "description": "Created"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Install a catalog entry: approve its scopes, connect, configure and choose inboxes and teams",
        "tags": [
          "integrations"
        ]
      }
    },
    "/integrations/installations/{id}": {
      "delete": {
        "operationId": "integrations-installation-uninstall",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "The installation's name, as GET …/impact names it, when it has active dependencies",
            "explode": false,
            "in": "query",
            "name": "confirm",
            "schema": {
              "description": "The installation's name, as GET …/impact names it, when it has active dependencies",
              "maxLength": 200,
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Uninstall: removes what is underneath (a connector, an app, a bot) and the credentials; needs confirm when something depends on it",
        "tags": [
          "integrations"
        ]
      },
      "get": {
        "operationId": "integrations-installation-get",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstallationView"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "One installation (secret settings are never returned)",
        "tags": [
          "integrations"
        ]
      }
    },
    "/integrations/installations/{id}/approve-update": {
      "post": {
        "operationId": "integrations-installation-approve-update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstallationView"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Approve the scopes a pending update adds and apply it (you must hold them)",
        "tags": [
          "integrations"
        ]
      }
    },
    "/integrations/installations/{id}/config": {
      "put": {
        "operationId": "integrations-installation-config",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InstallationConfigInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstallationView"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Change an installation's settings, inboxes and teams; a secret left empty keeps the stored one",
        "tags": [
          "integrations"
        ]
      }
    },
    "/integrations/installations/{id}/impact": {
      "get": {
        "operationId": "integrations-installation-impact",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstallationImpact"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "What uninstalling stops: rules, inboxes, held conversations, hooks, panels; and the name to type when something depends on it",
        "tags": [
          "integrations"
        ]
      }
    },
    "/integrations/installations/{id}/pause": {
      "post": {
        "operationId": "integrations-installation-pause",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstallationView"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Pause an installation: it stops working until resumed",
        "tags": [
          "integrations"
        ]
      }
    },
    "/integrations/installations/{id}/reconnect": {
      "post": {
        "operationId": "integrations-installation-reconnect",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InstallationReconnectInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstallationView"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Give an installation new credentials; it runs again",
        "tags": [
          "integrations"
        ]
      }
    },
    "/integrations/installations/{id}/resume": {
      "post": {
        "operationId": "integrations-installation-resume",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstallationView"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Resume a paused installation; its failure count starts over",
        "tags": [
          "integrations"
        ]
      }
    },
    "/integrations/installations/{id}/update": {
      "post": {
        "operationId": "integrations-installation-update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InstallationUpdateInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstallationView"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Move to the newest version; a version that asks for more scopes waits for an administrator who holds them to approve it",
        "tags": [
          "integrations"
        ]
      }
    },
    "/integrations/oauth/connections/{id}": {
      "get": {
        "operationId": "oauth-connection-get",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Connection"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "A sign-in's account, scopes and state (never its tokens)",
        "tags": [
          "integrations"
        ]
      }
    },
    "/integrations/oauth/providers": {
      "get": {
        "operationId": "oauth-providers",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OauthProvidersOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "OAuth providers for email inboxes (Microsoft 365, Google): configured or what the operator registers",
        "tags": [
          "integrations"
        ]
      }
    },
    "/integrations/oauth/{provider}/start": {
      "post": {
        "operationId": "oauth-start",
        "parameters": [
          {
            "in": "path",
            "name": "provider",
            "required": true,
            "schema": {
              "enum": [
                "microsoft",
                "google"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OauthStartInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OauthStartOutputBody"
                }
              }
            },
            "description": "OK",
            "headers": {
              "Set-Cookie": {
                "schema": {
                  "$ref": "#/components/schemas/Cookie"
                }
              }
            }
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Start signing in with a provider: returns the authorization URL (PKCE, a state bound to this session and workspace, 10 minutes)",
        "tags": [
          "integrations"
        ]
      }
    },
    "/integrations/policy": {
      "get": {
        "operationId": "integrations-policy-get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Policy"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Who may install integrations and which",
        "tags": [
          "integrations"
        ]
      },
      "put": {
        "operationId": "integrations-policy-put",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Policy"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Policy"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Set who may install (administrators only, or members may request), an optional allowlist and when failures pause an installation",
        "tags": [
          "integrations"
        ]
      }
    },
    "/integrations/requests": {
      "get": {
        "operationId": "integrations-requests",
        "parameters": [
          {
            "description": "Only the caller's requests",
            "explode": false,
            "in": "query",
            "name": "mine",
            "schema": {
              "description": "Only the caller's requests",
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RequestsOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Install requests: all of them with integrations:read, else the caller's own",
        "tags": [
          "integrations"
        ]
      },
      "post": {
        "operationId": "integrations-request-create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RequestCreateInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Request"
                }
              }
            },
            "description": "Created"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Ask an administrator to install an entry (when the workspace policy lets members request)",
        "tags": [
          "integrations"
        ]
      }
    },
    "/integrations/requests/{id}/decide": {
      "post": {
        "operationId": "integrations-request-decide",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RequestDecideInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Request"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Approve or decline a member's request; approving does not install it, the install does",
        "tags": [
          "integrations"
        ]
      }
    },
    "/integrations/slack/setup": {
      "get": {
        "operationId": "slack-setup",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SlackSetup"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "The operator's Slack app: set up or not, and what to register (addresses, scopes, events, a manifest)",
        "tags": [
          "integrations"
        ]
      }
    },
    "/integrations/slack/start": {
      "post": {
        "operationId": "slack-start",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SlackStartInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SlackStartOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Start adding the Kommio app to a Slack workspace: returns Slack's Add to Slack address (a state bound to this session and workspace, 10 minutes)",
        "tags": [
          "integrations"
        ]
      }
    },
    "/invitations": {
      "get": {
        "operationId": "invitations-list",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvitesOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Pending invitations",
        "tags": [
          "account"
        ]
      },
      "post": {
        "operationId": "invitations-create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InviteInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Invitation"
                }
              }
            },
            "description": "Created"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Invite a person by email",
        "tags": [
          "account"
        ]
      }
    },
    "/invitations/{id}": {
      "delete": {
        "operationId": "invitations-revoke",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Revoke a pending invitation",
        "tags": [
          "account"
        ]
      }
    },
    "/knowledge/articles": {
      "get": {
        "operationId": "kb-articles-list",
        "parameters": [
          {
            "explode": false,
            "in": "query",
            "name": "help_center_id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "-1: articles without a collection",
            "explode": false,
            "in": "query",
            "name": "collection_id",
            "schema": {
              "description": "-1: articles without a collection",
              "format": "int64",
              "minimum": -1,
              "type": "integer"
            }
          },
          {
            "description": "draft, published or archived",
            "explode": false,
            "in": "query",
            "name": "status",
            "schema": {
              "description": "draft, published or archived",
              "maxLength": 20,
              "type": "string"
            }
          },
          {
            "description": "public, internal or ai_only",
            "explode": false,
            "in": "query",
            "name": "visibility",
            "schema": {
              "description": "public, internal or ai_only",
              "maxLength": 20,
              "type": "string"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "q",
            "schema": {
              "maxLength": 200,
              "type": "string"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "format": "int64",
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "offset",
            "schema": {
              "format": "int64",
              "maximum": 10000,
              "minimum": 0,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KbArticlesOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "List a help center's articles (knowledge:read sees live public and internal ones)",
        "tags": [
          "knowledge"
        ]
      },
      "post": {
        "operationId": "kb-articles-create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ArticleInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KbArticleView"
                }
              }
            },
            "description": "Created"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Create a draft article with its first locale (HTML is sanitised; Markdown converted)",
        "tags": [
          "knowledge"
        ]
      }
    },
    "/knowledge/articles/{id}": {
      "delete": {
        "operationId": "kb-articles-delete",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Delete an article with its versions, feedback and counters",
        "tags": [
          "knowledge"
        ]
      },
      "get": {
        "operationId": "kb-articles-get",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KbArticleView"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Get an article: the working copy for editors, the live text for readers",
        "tags": [
          "knowledge"
        ]
      },
      "patch": {
        "operationId": "kb-articles-update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ArticlePatch"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KbArticleView"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Move, reorder, change visibility, archive or return an article to draft",
        "tags": [
          "knowledge"
        ]
      }
    },
    "/knowledge/articles/{id}/feedback": {
      "get": {
        "operationId": "kb-articles-feedback",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeedbackSummary"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "An article's helpfulness, 30-day views and latest comments",
        "tags": [
          "knowledge"
        ]
      }
    },
    "/knowledge/articles/{id}/publish": {
      "post": {
        "operationId": "kb-articles-publish",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KbArticleView"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Publish the working copy as a new version",
        "tags": [
          "knowledge"
        ]
      }
    },
    "/knowledge/articles/{id}/translations/{locale}": {
      "delete": {
        "operationId": "kb-articles-translation-delete",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "path",
            "name": "locale",
            "required": true,
            "schema": {
              "maxLength": 8,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KbArticleView"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Remove a locale from the working copy",
        "tags": [
          "knowledge"
        ]
      },
      "put": {
        "operationId": "kb-articles-translation-put",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "path",
            "name": "locale",
            "required": true,
            "schema": {
              "maxLength": 8,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TranslationInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KbArticleView"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Save one locale of the working copy (autosave; nothing goes live until publish)",
        "tags": [
          "knowledge"
        ]
      }
    },
    "/knowledge/articles/{id}/unpublish": {
      "post": {
        "operationId": "kb-articles-unpublish",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KbArticleView"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Take an article off the help center (back to draft)",
        "tags": [
          "knowledge"
        ]
      }
    },
    "/knowledge/articles/{id}/versions": {
      "get": {
        "operationId": "kb-articles-versions",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KbVersionsOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "List an article's published versions",
        "tags": [
          "knowledge"
        ]
      }
    },
    "/knowledge/articles/{id}/versions/{version}": {
      "get": {
        "operationId": "kb-articles-version",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "path",
            "name": "version",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KbVersionOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Get every locale of one published version",
        "tags": [
          "knowledge"
        ]
      }
    },
    "/knowledge/articles/{id}/versions/{version}/restore": {
      "post": {
        "operationId": "kb-articles-version-restore",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "path",
            "name": "version",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KbArticleView"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Copy a version back into the working copy (publish to make it live)",
        "tags": [
          "knowledge"
        ]
      }
    },
    "/knowledge/collections/{id}": {
      "delete": {
        "operationId": "kb-collections-delete",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Delete a collection and its sub-collections (articles stay, without a collection)",
        "tags": [
          "knowledge"
        ]
      },
      "put": {
        "operationId": "kb-collections-update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ArticleCollectionInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ArticleCollection"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Update a collection",
        "tags": [
          "knowledge"
        ]
      }
    },
    "/knowledge/files": {
      "post": {
        "operationId": "kb-files-upload",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "properties": {
                  "filename": {
                    "contentMediaType": "application/octet-stream",
                    "description": "filename of the file being uploaded",
                    "format": "binary",
                    "type": "string"
                  },
                  "name": {
                    "description": "general purpose name for multipart form value",
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ArticleImage"
                }
              }
            },
            "description": "Created"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Upload an image for articles (multipart: file; PNG, JPEG, GIF or WebP)",
        "tags": [
          "knowledge"
        ]
      }
    },
    "/knowledge/files/{id}": {
      "get": {
        "operationId": "kb-files-get",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The image"
          },
          "302": {
            "description": "Redirect to a signed URL"
          }
        },
        "summary": "An article image, for editors and readers",
        "tags": [
          "knowledge"
        ]
      }
    },
    "/knowledge/gaps": {
      "get": {
        "operationId": "kb-gaps-list",
        "parameters": [
          {
            "explode": false,
            "in": "query",
            "name": "status",
            "schema": {
              "maxLength": 20,
              "type": "string"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "format": "int64",
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "offset",
            "schema": {
              "format": "int64",
              "maximum": 100000,
              "minimum": 0,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KbGapsOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Questions without a good answer, most frequent first (examples with personal data removed)",
        "tags": [
          "knowledge"
        ]
      }
    },
    "/knowledge/gaps/{id}/article": {
      "post": {
        "operationId": "kb-gaps-article",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/KbGapArticleInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KbArticleView"
                }
              }
            },
            "description": "Created"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Start a draft article for a gap (the question as its title) and mark the gap resolved",
        "tags": [
          "knowledge"
        ]
      }
    },
    "/knowledge/gaps/{id}/dismiss": {
      "post": {
        "operationId": "kb-gaps-dismiss",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Gap"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Dismiss a gap",
        "tags": [
          "knowledge"
        ]
      }
    },
    "/knowledge/gaps/{id}/reopen": {
      "post": {
        "operationId": "kb-gaps-reopen",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Gap"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Reopen a dismissed or resolved gap",
        "tags": [
          "knowledge"
        ]
      }
    },
    "/knowledge/help-centers": {
      "get": {
        "operationId": "kb-help-centers-list",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KbCentersOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "List help centers",
        "tags": [
          "knowledge"
        ]
      },
      "post": {
        "operationId": "kb-help-centers-create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HelpCenterInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HelpCenterView"
                }
              }
            },
            "description": "Created"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Create a help center",
        "tags": [
          "knowledge"
        ]
      }
    },
    "/knowledge/help-centers/{id}": {
      "delete": {
        "operationId": "kb-help-centers-delete",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Delete a help center with its collections and articles",
        "tags": [
          "knowledge"
        ]
      },
      "get": {
        "operationId": "kb-help-centers-get",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HelpCenterView"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Get a help center",
        "tags": [
          "knowledge"
        ]
      },
      "put": {
        "operationId": "kb-help-centers-update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HelpCenterInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HelpCenterView"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Update a help center (name, address, locales, status, theme, logos, headline)",
        "tags": [
          "knowledge"
        ]
      }
    },
    "/knowledge/help-centers/{id}/collections": {
      "get": {
        "operationId": "kb-collections-list",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KbCollectionsOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "List a help center's collections in display order",
        "tags": [
          "knowledge"
        ]
      },
      "post": {
        "operationId": "kb-collections-create",
        "parameters": [
          {
            "description": "Help center",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "description": "Help center",
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ArticleCollectionInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ArticleCollection"
                }
              }
            },
            "description": "Created"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Create a collection",
        "tags": [
          "knowledge"
        ]
      }
    },
    "/knowledge/help-centers/{id}/collections/order": {
      "put": {
        "operationId": "kb-collections-order",
        "parameters": [
          {
            "description": "Help center",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "description": "Help center",
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/KbOrderInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KbCollectionsOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Reorder and re-nest collections (one level)",
        "tags": [
          "knowledge"
        ]
      }
    },
    "/knowledge/help-centers/{id}/domain": {
      "put": {
        "operationId": "kb-help-centers-domain",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/KbDomainInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HelpCenterView"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Set or remove the custom domain (a new domain starts unverified)",
        "tags": [
          "knowledge"
        ]
      }
    },
    "/knowledge/help-centers/{id}/domain/verify": {
      "post": {
        "operationId": "kb-help-centers-domain-verify",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KbVerifyOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Check the custom domain's TXT record (or HTTP challenge) now",
        "tags": [
          "knowledge"
        ]
      }
    },
    "/knowledge/help-centers/{id}/overview": {
      "get": {
        "operationId": "kb-help-centers-overview",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HelpStats"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Views, deflection, helpfulness and searches of the last 30 days",
        "tags": [
          "knowledge"
        ]
      }
    },
    "/knowledge/index": {
      "get": {
        "operationId": "kb-index-status",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IndexStatus"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "How the AI's knowledge index is doing: mode, model, passages and vectors, last error",
        "tags": [
          "knowledge"
        ]
      }
    },
    "/knowledge/index/reindex": {
      "post": {
        "operationId": "kb-index-reindex",
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IndexStatus"
                }
              }
            },
            "description": "Accepted"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Rebuild every passage and compute every vector again (metered against the AI budget)",
        "tags": [
          "knowledge"
        ]
      }
    },
    "/knowledge/learning": {
      "get": {
        "operationId": "kb-learning-get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LearningSettings"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Whether the knowledge base learns from resolved conversations, and from which inboxes",
        "tags": [
          "knowledge"
        ]
      },
      "put": {
        "description": "Only resolved conversations of the chosen inboxes, resolved after learning was turned on, are read. Personal data is removed before anything is sent to the workspace's AI provider, and every suggestion waits for approval.",
        "operationId": "kb-learning-put",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/KbLearningInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LearningSettings"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Turn learning from conversations on or off and choose the inboxes",
        "tags": [
          "knowledge"
        ]
      }
    },
    "/knowledge/learning/run": {
      "post": {
        "operationId": "kb-learning-run",
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LearningSettings"
                }
              }
            },
            "description": "Accepted"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Read newly resolved conversations now instead of at the next half-hourly run",
        "tags": [
          "knowledge"
        ]
      }
    },
    "/knowledge/retrieve": {
      "post": {
        "operationId": "kb-retrieve",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/KbRetrieveInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KbRetrieveOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Preview retrieval: the passages the AI, agents or visitors would get for a question",
        "tags": [
          "knowledge"
        ]
      }
    },
    "/knowledge/search": {
      "get": {
        "operationId": "kb-search",
        "parameters": [
          {
            "description": "Words to find; empty lists the newest articles",
            "explode": false,
            "in": "query",
            "name": "q",
            "schema": {
              "description": "Words to find; empty lists the newest articles",
              "maxLength": 200,
              "type": "string"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 20,
              "format": "int64",
              "maximum": 50,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KbSearchOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Search live articles (public and internal) and internal snippets",
        "tags": [
          "knowledge"
        ]
      }
    },
    "/knowledge/snippets": {
      "get": {
        "operationId": "kb-snippets-list",
        "parameters": [
          {
            "explode": false,
            "in": "query",
            "name": "q",
            "schema": {
              "maxLength": 200,
              "type": "string"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "format": "int64",
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "offset",
            "schema": {
              "format": "int64",
              "maximum": 10000,
              "minimum": 0,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KbSnippetsOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "List snippets (AI-only ones for knowledge:manage only)",
        "tags": [
          "knowledge"
        ]
      },
      "post": {
        "operationId": "kb-snippets-create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SnippetInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Snippet"
                }
              }
            },
            "description": "Created"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Create a snippet",
        "tags": [
          "knowledge"
        ]
      }
    },
    "/knowledge/snippets/{id}": {
      "delete": {
        "operationId": "kb-snippets-delete",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Delete a snippet",
        "tags": [
          "knowledge"
        ]
      },
      "get": {
        "operationId": "kb-snippets-get",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Snippet"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Get a snippet",
        "tags": [
          "knowledge"
        ]
      },
      "put": {
        "operationId": "kb-snippets-update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SnippetInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Snippet"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Update a snippet",
        "tags": [
          "knowledge"
        ]
      }
    },
    "/knowledge/sources": {
      "get": {
        "operationId": "kb-sources-list",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KbSourcesOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "List website and file sources with status, last sync, errors and page count",
        "tags": [
          "knowledge"
        ]
      },
      "post": {
        "operationId": "kb-sources-create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SourceInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Source"
                }
              }
            },
            "description": "Created"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Add a website source (a start page or a sitemap) and sync it",
        "tags": [
          "knowledge"
        ]
      }
    },
    "/knowledge/sources/files": {
      "post": {
        "operationId": "kb-sources-upload",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "properties": {
                  "filename": {
                    "contentMediaType": "application/octet-stream",
                    "description": "filename of the file being uploaded",
                    "format": "binary",
                    "type": "string"
                  },
                  "name": {
                    "description": "general purpose name for multipart form value",
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Source"
                }
              }
            },
            "description": "Created"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Upload a file source (multipart: file; PDF, DOCX, TXT or Markdown up to 20 MB; optional name, visibility, locale)",
        "tags": [
          "knowledge"
        ]
      }
    },
    "/knowledge/sources/{id}": {
      "delete": {
        "operationId": "kb-sources-delete",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Delete a source with its pages and passages",
        "tags": [
          "knowledge"
        ]
      },
      "get": {
        "operationId": "kb-sources-get",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Source"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Get a source",
        "tags": [
          "knowledge"
        ]
      },
      "put": {
        "operationId": "kb-sources-update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SourceInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Source"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Change a source (a visibility change applies at once, the rest at the next sync)",
        "tags": [
          "knowledge"
        ]
      }
    },
    "/knowledge/sources/{id}/pages": {
      "get": {
        "operationId": "kb-sources-pages",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 100,
              "format": "int64",
              "maximum": 500,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "offset",
            "schema": {
              "format": "int64",
              "maximum": 100000,
              "minimum": 0,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KbSourcePagesOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "A source's pages with status, errors and exclusions",
        "tags": [
          "knowledge"
        ]
      }
    },
    "/knowledge/sources/{id}/pages/{page}": {
      "put": {
        "operationId": "kb-sources-page-update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "path",
            "name": "page",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/KbSourcePageInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Source"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Exclude a page from (or include it back into) what the AI reads",
        "tags": [
          "knowledge"
        ]
      }
    },
    "/knowledge/sources/{id}/sync": {
      "post": {
        "operationId": "kb-sources-sync",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Source"
                }
              }
            },
            "description": "Accepted"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Sync a source now",
        "tags": [
          "knowledge"
        ]
      }
    },
    "/knowledge/suggestions": {
      "get": {
        "operationId": "kb-suggestions-list",
        "parameters": [
          {
            "explode": false,
            "in": "query",
            "name": "status",
            "schema": {
              "maxLength": 20,
              "type": "string"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "format": "int64",
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "offset",
            "schema": {
              "format": "int64",
              "maximum": 100000,
              "minimum": 0,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KbSuggestionsOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Questions and answers learned from conversations (personal data removed), most frequent first",
        "tags": [
          "knowledge"
        ]
      }
    },
    "/knowledge/suggestions/{id}": {
      "put": {
        "operationId": "kb-suggestions-update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SuggestionEdit"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Suggestion"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Edit a pending suggestion",
        "tags": [
          "knowledge"
        ]
      }
    },
    "/knowledge/suggestions/{id}/approve": {
      "post": {
        "operationId": "kb-suggestions-approve",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApproveInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Suggestion"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Approve a suggestion into a snippet or a draft article",
        "tags": [
          "knowledge"
        ]
      }
    },
    "/knowledge/suggestions/{id}/reject": {
      "post": {
        "operationId": "kb-suggestions-reject",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Suggestion"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Reject a suggestion (its near-duplicates are not proposed again)",
        "tags": [
          "knowledge"
        ]
      }
    },
    "/macros": {
      "get": {
        "operationId": "macros-list",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MacrosOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Macros",
        "tags": [
          "automations"
        ]
      },
      "post": {
        "operationId": "macros-create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MacroBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Macro"
                }
              }
            },
            "description": "Created"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Create a macro",
        "tags": [
          "automations"
        ]
      }
    },
    "/macros/{id}": {
      "delete": {
        "operationId": "macros-delete",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Delete a macro",
        "tags": [
          "automations"
        ]
      },
      "put": {
        "operationId": "macros-update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MacroBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Macro"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Update a macro",
        "tags": [
          "automations"
        ]
      }
    },
    "/macros/{id}/deliveries": {
      "get": {
        "operationId": "macros-deliveries",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "before_id",
            "schema": {
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "format": "int64",
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "Only deliveries in this state; omitted lists all",
            "explode": false,
            "in": "query",
            "name": "status",
            "schema": {
              "description": "Only deliveries in this state; omitted lists all",
              "enum": [
                "pending",
                "retrying",
                "delivered",
                "failed",
                "cancelled",
                "over_budget"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeliveriesOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Webhooks this macro sent (the shared delivery ledger), newest first",
        "tags": [
          "automations"
        ]
      }
    },
    "/macros/{id}/deliveries/replay-failed": {
      "post": {
        "operationId": "macros-replay-failed",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReplayFailedOutputBody"
                }
              }
            },
            "description": "Accepted"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Send a macro's failed webhooks again (oldest 100, spaced; once a minute)",
        "tags": [
          "automations"
        ]
      }
    },
    "/macros/{id}/deliveries/{delivery_id}/replay": {
      "post": {
        "operationId": "macros-replay",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "path",
            "name": "delivery_id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Delivery"
                }
              }
            },
            "description": "Accepted"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Send a macro's webhook again now",
        "tags": [
          "automations"
        ]
      }
    },
    "/me/conversations": {
      "get": {
        "description": "Each workspace is read with the caller's role there, so a Viewer in one brand and an Agent in another see what each role allows; a workspace the caller cannot read is listed in skipped. The caller's active workspace is already counted by the request limit; every other workspace read counts one request against its own limit, and one whose limit is spent is skipped for that page. At most 20 memberships (422 beyond).",
        "operationId": "me-conversations-list",
        "parameters": [
          {
            "description": "open and pending are status categories; all is every status",
            "explode": false,
            "in": "query",
            "name": "status",
            "schema": {
              "default": "open",
              "description": "open and pending are status categories; all is every status",
              "enum": [
                "open",
                "pending",
                "all"
              ],
              "type": "string"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "scope",
            "schema": {
              "default": "all",
              "enum": [
                "all",
                "mine",
                "unassigned"
              ],
              "type": "string"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 25,
              "format": "int64",
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BrandConversationsPage"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Conversations across every workspace the caller belongs to, most recent activity first",
        "tags": [
          "conversations"
        ]
      }
    },
    "/me/conversations/counts": {
      "get": {
        "description": "The maintained counts of each workspace over the caller's visibility there (as /conversations/counts), fanned out and summed; each workspace's own numbers come with the totals. Counted against the request limits like the list.",
        "operationId": "me-conversations-counts",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BrandCounts"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Open, pending, unassigned and mine across every workspace the caller belongs to",
        "tags": [
          "conversations"
        ]
      }
    },
    "/notifications": {
      "get": {
        "operationId": "notifications-list",
        "parameters": [
          {
            "explode": false,
            "in": "query",
            "name": "before_id",
            "schema": {
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 30,
              "format": "int64",
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "unread_only",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotifListOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "The caller's notifications, newest first",
        "tags": [
          "notifications"
        ]
      }
    },
    "/notifications/preferences": {
      "get": {
        "operationId": "notifications-preferences",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrefsBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Delivery preferences per kind",
        "tags": [
          "notifications"
        ]
      },
      "put": {
        "operationId": "notifications-preferences-update",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PrefsInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrefsBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Change delivery preferences",
        "tags": [
          "notifications"
        ]
      }
    },
    "/notifications/push": {
      "get": {
        "operationId": "notifications-push",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PushStateOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "The push key and the caller's subscribed browsers",
        "tags": [
          "notifications"
        ]
      }
    },
    "/notifications/push/subscriptions": {
      "post": {
        "operationId": "notifications-push-subscribe",
        "parameters": [
          {
            "in": "header",
            "name": "User-Agent",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PushSubscribeInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PushSubscription"
                }
              }
            },
            "description": "Created"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Turn push on in this browser (a PushSubscription)",
        "tags": [
          "notifications"
        ]
      }
    },
    "/notifications/push/subscriptions/{id}": {
      "delete": {
        "operationId": "notifications-push-delete",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Remove one of the caller's subscribed browsers",
        "tags": [
          "notifications"
        ]
      }
    },
    "/notifications/push/unsubscribe": {
      "post": {
        "operationId": "notifications-push-unsubscribe",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PushUnsubscribeInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "No Content"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Turn push off in this browser (by its endpoint)",
        "tags": [
          "notifications"
        ]
      }
    },
    "/notifications/read-all": {
      "post": {
        "operationId": "notifications-read-all",
        "responses": {
          "204": {
            "description": "No Content"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Mark every notification read",
        "tags": [
          "notifications"
        ]
      }
    },
    "/notifications/{id}/read": {
      "post": {
        "operationId": "notifications-read",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Mark one notification read",
        "tags": [
          "notifications"
        ]
      }
    },
    "/plugins": {
      "get": {
        "operationId": "plugins-list",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginsOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Loaded plugins, their hooks, channels, actions and settings sections",
        "tags": [
          "plugins"
        ]
      }
    },
    "/public/brand/{account}/{public_id}": {
      "get": {
        "operationId": "public-brand-file",
        "parameters": [
          {
            "in": "path",
            "name": "account",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "path",
            "name": "public_id",
            "required": true,
            "schema": {
              "maxLength": 32,
              "minLength": 32,
              "pattern": "^[0-9a-f]{32}$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The image"
          },
          "302": {
            "description": "Redirect to a signed URL"
          }
        },
        "summary": "An uploaded logo, public so the widget on any site, the help center and the survey page can show it",
        "tags": [
          "branding"
        ]
      }
    },
    "/public/csat/{token}": {
      "get": {
        "operationId": "public-csat",
        "parameters": [
          {
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "maxLength": 600,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicSurvey"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "A satisfaction survey from its signed link",
        "tags": [
          "public"
        ]
      },
      "post": {
        "description": "The link is signed for one survey and expires 7 days after the resolution. Same rules as the widget: one answer per resolution, changeable for 24 hours.",
        "operationId": "public-csat-answer",
        "parameters": [
          {
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "maxLength": 600,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SurveyAnswerBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicSurvey"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Answer a satisfaction survey from its signed link",
        "tags": [
          "public"
        ]
      }
    },
    "/public/demo-requests": {
      "post": {
        "operationId": "public-demo-request",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DemoRequestInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DemoRequestOutputBody"
                }
              }
            },
            "description": "Accepted"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Submit a request for a product demo from the website",
        "tags": [
          "public"
        ]
      }
    },
    "/public/help/{slug}/articles/{id}": {
      "get": {
        "operationId": "public-help-article",
        "parameters": [
          {
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "maxLength": 60,
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "locale",
            "schema": {
              "maxLength": 8,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HelpArticle"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "A live public article of a help center",
        "tags": [
          "public"
        ]
      }
    },
    "/public/help/{slug}/search": {
      "get": {
        "operationId": "public-help-search",
        "parameters": [
          {
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "maxLength": 60,
              "type": "string"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "q",
            "schema": {
              "maxLength": 200,
              "type": "string"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "locale",
            "schema": {
              "maxLength": 8,
              "type": "string"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 10,
              "format": "int64",
              "maximum": 50,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HelpSearchOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Search a public help center (live public articles only)",
        "tags": [
          "public"
        ]
      }
    },
    "/public/invitations/accept": {
      "post": {
        "operationId": "public-invitation-accept",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AcceptInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AcceptInvitationOutputBody"
                }
              }
            },
            "description": "OK",
            "headers": {
              "Set-Cookie": {
                "schema": {
                  "$ref": "#/components/schemas/Cookie"
                }
              }
            }
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Accept an invitation; creates the user and signs in when the email is new, otherwise asks the user to sign in",
        "tags": [
          "public"
        ]
      }
    },
    "/public/invitations/{token}": {
      "get": {
        "operationId": "public-invitation-lookup",
        "parameters": [
          {
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "maxLength": 200,
              "minLength": 20,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvitationLookupOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Describe an invitation before accepting it",
        "tags": [
          "public"
        ]
      }
    },
    "/public/meta": {
      "get": {
        "operationId": "public-meta",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Meta"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Edition and version, for the app before sign-in",
        "tags": [
          "public"
        ]
      }
    },
    "/public/password/forgot": {
      "post": {
        "operationId": "public-password-forgot",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ForgotInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AcceptedOutputBody"
                }
              }
            },
            "description": "Accepted"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Email a password reset link when the address is known",
        "tags": [
          "public"
        ]
      }
    },
    "/public/password/reset": {
      "post": {
        "operationId": "public-password-reset",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResetInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AcceptedOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Set a new password with a reset token",
        "tags": [
          "public"
        ]
      }
    },
    "/public/report-unsubscribe/{token}": {
      "get": {
        "operationId": "public-report-unsubscribe",
        "parameters": [
          {
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "maxLength": 100,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnsubOutBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "What a scheduled report's unsubscribe link stops",
        "tags": [
          "public"
        ]
      },
      "post": {
        "operationId": "public-report-unsubscribe-confirm",
        "parameters": [
          {
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "maxLength": 100,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnsubOutBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Stop a scheduled report email (also the one-click unsubscribe of RFC 8058)",
        "tags": [
          "public"
        ]
      }
    },
    "/public/sso-providers": {
      "get": {
        "operationId": "public-sso-providers",
        "parameters": [
          {
            "description": "A workspace address (slug); its providers are listed with the platform's",
            "explode": false,
            "in": "query",
            "name": "workspace",
            "schema": {
              "description": "A workspace address (slug); its providers are listed with the platform's",
              "maxLength": 100,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicSSOOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Single sign-on buttons for the sign-in page",
        "tags": [
          "public"
        ]
      }
    },
    "/reports/assignment": {
      "get": {
        "operationId": "reports-assignment",
        "parameters": [
          {
            "description": "Start day YYYY-MM-DD (inclusive) in tz",
            "explode": false,
            "in": "query",
            "name": "from",
            "required": true,
            "schema": {
              "description": "Start day YYYY-MM-DD (inclusive) in tz",
              "type": "string"
            }
          },
          {
            "description": "End day YYYY-MM-DD (inclusive) in tz",
            "explode": false,
            "in": "query",
            "name": "to",
            "required": true,
            "schema": {
              "description": "End day YYYY-MM-DD (inclusive) in tz",
              "type": "string"
            }
          },
          {
            "description": "IANA time zone for day and hour bucketing; empty uses the workspace time zone (general.timezone), else UTC",
            "explode": false,
            "in": "query",
            "name": "tz",
            "schema": {
              "description": "IANA time zone for day and hour bucketing; empty uses the workspace time zone (general.timezone), else UTC",
              "type": "string"
            }
          },
          {
            "description": "Only this inbox; combines with team_id and agent_id",
            "explode": false,
            "in": "query",
            "name": "inbox_id",
            "schema": {
              "description": "Only this inbox; combines with team_id and agent_id",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Only this team",
            "explode": false,
            "in": "query",
            "name": "team_id",
            "schema": {
              "description": "Only this team",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Only this agent",
            "explode": false,
            "in": "query",
            "name": "agent_id",
            "schema": {
              "description": "Only this agent",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Also compute the previous period of equal length",
            "explode": false,
            "in": "query",
            "name": "previous",
            "schema": {
              "default": true,
              "description": "Also compute the previous period of equal length",
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AssignmentReportOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Assignment: conversations given to and taken from each agent, time to first assignment and open load over time, optionally within an inbox, team and agent",
        "tags": [
          "reports"
        ]
      }
    },
    "/reports/backfill": {
      "get": {
        "operationId": "reports-backfill-status",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RebuildStatus"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Where the rebuild of the rollups stands",
        "tags": [
          "reports"
        ]
      },
      "post": {
        "description": "The rebuild runs as a job; the response and GET /reports/backfill say where it stands. A rebuild already queued or running is left alone.",
        "operationId": "reports-backfill",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RebuildStatus"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Queue a rebuild of the rollups from stored conversations (after an upgrade)",
        "tags": [
          "reports"
        ]
      }
    },
    "/reports/backlog": {
      "get": {
        "description": "Counted live over the open and pending conversations the caller may see (by their open-status indexes), within the inbox, team and agent filters.",
        "operationId": "reports-backlog",
        "parameters": [
          {
            "description": "Only this inbox; combines with team_id and agent_id",
            "explode": false,
            "in": "query",
            "name": "inbox_id",
            "schema": {
              "description": "Only this inbox; combines with team_id and agent_id",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "team_id",
            "schema": {
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Only this assignee",
            "explode": false,
            "in": "query",
            "name": "agent_id",
            "schema": {
              "description": "Only this assignee",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BacklogOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Backlog now: open conversations by age, who they wait on, and the customer waiting longest",
        "tags": [
          "reports"
        ]
      }
    },
    "/reports/bots": {
      "get": {
        "operationId": "reports-bots",
        "parameters": [
          {
            "description": "Start day YYYY-MM-DD (inclusive) in tz",
            "explode": false,
            "in": "query",
            "name": "from",
            "required": true,
            "schema": {
              "description": "Start day YYYY-MM-DD (inclusive) in tz",
              "type": "string"
            }
          },
          {
            "description": "End day YYYY-MM-DD (inclusive) in tz",
            "explode": false,
            "in": "query",
            "name": "to",
            "required": true,
            "schema": {
              "description": "End day YYYY-MM-DD (inclusive) in tz",
              "type": "string"
            }
          },
          {
            "description": "IANA time zone for day bucketing; empty uses the workspace time zone (general.timezone), else UTC",
            "explode": false,
            "in": "query",
            "name": "tz",
            "schema": {
              "description": "IANA time zone for day bucketing; empty uses the workspace time zone (general.timezone), else UTC",
              "type": "string"
            }
          },
          {
            "description": "One bot; 0 for all",
            "explode": false,
            "in": "query",
            "name": "bot_id",
            "schema": {
              "description": "One bot; 0 for all",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BotReportOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Agent bots: handled, resolved without a person, hand-offs and time to hand-off",
        "tags": [
          "reports"
        ]
      }
    },
    "/reports/categories": {
      "get": {
        "description": "The attribute is the setting reports.category_attribute, else the conversation attribute \"category\". A day is a spike when it has at least 5 conversations and more than the mean of the 14 days before it plus three standard deviations (at least 1).",
        "operationId": "reports-categories",
        "parameters": [
          {
            "description": "Start day YYYY-MM-DD (inclusive) in tz",
            "explode": false,
            "in": "query",
            "name": "from",
            "required": true,
            "schema": {
              "description": "Start day YYYY-MM-DD (inclusive) in tz",
              "type": "string"
            }
          },
          {
            "description": "End day YYYY-MM-DD (inclusive) in tz",
            "explode": false,
            "in": "query",
            "name": "to",
            "required": true,
            "schema": {
              "description": "End day YYYY-MM-DD (inclusive) in tz",
              "type": "string"
            }
          },
          {
            "description": "IANA time zone for day bucketing; empty uses the workspace time zone (general.timezone), else UTC",
            "explode": false,
            "in": "query",
            "name": "tz",
            "schema": {
              "description": "IANA time zone for day bucketing; empty uses the workspace time zone (general.timezone), else UTC",
              "type": "string"
            }
          },
          {
            "description": "How many values",
            "explode": false,
            "in": "query",
            "name": "top",
            "schema": {
              "default": 8,
              "description": "How many values",
              "format": "int64",
              "maximum": 25,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CategoriesOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Category trends: the top values of the workspace's category attribute, with volume, resolution time and spikes",
        "tags": [
          "reports"
        ]
      }
    },
    "/reports/channels": {
      "get": {
        "operationId": "reports-channels",
        "parameters": [
          {
            "description": "Start day YYYY-MM-DD (inclusive) in tz",
            "explode": false,
            "in": "query",
            "name": "from",
            "required": true,
            "schema": {
              "description": "Start day YYYY-MM-DD (inclusive) in tz",
              "type": "string"
            }
          },
          {
            "description": "End day YYYY-MM-DD (inclusive) in tz",
            "explode": false,
            "in": "query",
            "name": "to",
            "required": true,
            "schema": {
              "description": "End day YYYY-MM-DD (inclusive) in tz",
              "type": "string"
            }
          },
          {
            "description": "IANA time zone for day and hour bucketing; empty uses the workspace time zone (general.timezone), else UTC",
            "explode": false,
            "in": "query",
            "name": "tz",
            "schema": {
              "description": "IANA time zone for day and hour bucketing; empty uses the workspace time zone (general.timezone), else UTC",
              "type": "string"
            }
          },
          {
            "description": "Only this inbox; combines with team_id and agent_id",
            "explode": false,
            "in": "query",
            "name": "inbox_id",
            "schema": {
              "description": "Only this inbox; combines with team_id and agent_id",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Only this team",
            "explode": false,
            "in": "query",
            "name": "team_id",
            "schema": {
              "description": "Only this team",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Only this agent",
            "explode": false,
            "in": "query",
            "name": "agent_id",
            "schema": {
              "description": "Only this agent",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Also compute the previous period of equal length",
            "explode": false,
            "in": "query",
            "name": "previous",
            "schema": {
              "default": true,
              "description": "Also compute the previous period of equal length",
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChannelMixOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Channel mix: conversations, resolutions and first response time per channel kind",
        "tags": [
          "reports"
        ]
      }
    },
    "/reports/csat": {
      "get": {
        "operationId": "reports-csat",
        "parameters": [
          {
            "description": "Start day YYYY-MM-DD (inclusive) in tz",
            "explode": false,
            "in": "query",
            "name": "from",
            "required": true,
            "schema": {
              "description": "Start day YYYY-MM-DD (inclusive) in tz",
              "type": "string"
            }
          },
          {
            "description": "End day YYYY-MM-DD (inclusive) in tz",
            "explode": false,
            "in": "query",
            "name": "to",
            "required": true,
            "schema": {
              "description": "End day YYYY-MM-DD (inclusive) in tz",
              "type": "string"
            }
          },
          {
            "description": "IANA time zone for day bucketing; empty uses the workspace time zone (general.timezone), else UTC",
            "explode": false,
            "in": "query",
            "name": "tz",
            "schema": {
              "description": "IANA time zone for day bucketing; empty uses the workspace time zone (general.timezone), else UTC",
              "type": "string"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "inbox_id",
            "schema": {
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "team_id",
            "schema": {
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "agent_id",
            "schema": {
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Breakdown rows; tag counts each conversation under its current tags; channel is the survey's channel (rows carry it as key)",
            "explode": false,
            "in": "query",
            "name": "dimension",
            "schema": {
              "default": "agent",
              "description": "Breakdown rows; tag counts each conversation under its current tags; channel is the survey's channel (rows carry it as key)",
              "enum": [
                "agent",
                "team",
                "inbox",
                "tag",
                "channel"
              ],
              "type": "string"
            }
          },
          {
            "description": "Also compute the previous period of equal length",
            "explode": false,
            "in": "query",
            "name": "previous",
            "schema": {
              "default": true,
              "description": "Also compute the previous period of equal length",
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CsatReportOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Satisfaction: score, average, response rate, distribution, series and breakdown",
        "tags": [
          "reports"
        ]
      }
    },
    "/reports/csat/responses": {
      "get": {
        "description": "Newest first, within the caller's reporting scope and the conversations they may see now. Personal data in comments follows the caller's field grants (listed in _redacted).",
        "operationId": "reports-csat-responses",
        "parameters": [
          {
            "description": "Start day YYYY-MM-DD (inclusive) in tz",
            "explode": false,
            "in": "query",
            "name": "from",
            "required": true,
            "schema": {
              "description": "Start day YYYY-MM-DD (inclusive) in tz",
              "type": "string"
            }
          },
          {
            "description": "End day YYYY-MM-DD (inclusive) in tz",
            "explode": false,
            "in": "query",
            "name": "to",
            "required": true,
            "schema": {
              "description": "End day YYYY-MM-DD (inclusive) in tz",
              "type": "string"
            }
          },
          {
            "description": "IANA time zone of the days; empty uses the workspace time zone (general.timezone), else UTC",
            "explode": false,
            "in": "query",
            "name": "tz",
            "schema": {
              "description": "IANA time zone of the days; empty uses the workspace time zone (general.timezone), else UTC",
              "type": "string"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "inbox_id",
            "schema": {
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "team_id",
            "schema": {
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "The assignee at resolution",
            "explode": false,
            "in": "query",
            "name": "agent_id",
            "schema": {
              "description": "The assignee at resolution",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "The conversation has this tag now (as the tag breakdown)",
            "explode": false,
            "in": "query",
            "name": "tag_id",
            "schema": {
              "description": "The conversation has this tag now (as the tag breakdown)",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "The survey's channel (web_chat, email, api...)",
            "explode": false,
            "in": "query",
            "name": "channel",
            "schema": {
              "description": "The survey's channel (web_chat, email, api...)",
              "maxLength": 40,
              "type": "string"
            }
          },
          {
            "description": "Only these ratings, such as 1,2 or 4,5",
            "explode": false,
            "in": "query",
            "name": "rating",
            "schema": {
              "description": "Only these ratings, such as 1,2 or 4,5",
              "maxLength": 20,
              "pattern": "^[1-5](,[1-5])*$",
              "type": "string"
            }
          },
          {
            "description": "Only responses with a comment",
            "explode": false,
            "in": "query",
            "name": "with_comment",
            "schema": {
              "description": "Only responses with a comment",
              "type": "boolean"
            }
          },
          {
            "description": "Words in the comment (matched as the viewer sees it)",
            "explode": false,
            "in": "query",
            "name": "q",
            "schema": {
              "description": "Words in the comment (matched as the viewer sees it)",
              "maxLength": 200,
              "type": "string"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 25,
              "format": "int64",
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CsatResponsesOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "The satisfaction responses behind a number, with their comments",
        "tags": [
          "reports"
        ]
      }
    },
    "/reports/files/{id}/download": {
      "get": {
        "operationId": "report-files-download",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The file"
          },
          "302": {
            "description": "Redirect to a signed URL"
          }
        },
        "summary": "Download a scheduled report's file that was too large to attach",
        "tags": [
          "reports"
        ]
      }
    },
    "/reports/overview": {
      "get": {
        "operationId": "reports-overview",
        "parameters": [
          {
            "description": "Start day YYYY-MM-DD (inclusive) in tz",
            "explode": false,
            "in": "query",
            "name": "from",
            "required": true,
            "schema": {
              "description": "Start day YYYY-MM-DD (inclusive) in tz",
              "type": "string"
            }
          },
          {
            "description": "End day YYYY-MM-DD (inclusive) in tz",
            "explode": false,
            "in": "query",
            "name": "to",
            "required": true,
            "schema": {
              "description": "End day YYYY-MM-DD (inclusive) in tz",
              "type": "string"
            }
          },
          {
            "description": "IANA time zone for day and hour bucketing; empty uses the workspace time zone (general.timezone), else UTC",
            "explode": false,
            "in": "query",
            "name": "tz",
            "schema": {
              "description": "IANA time zone for day and hour bucketing; empty uses the workspace time zone (general.timezone), else UTC",
              "type": "string"
            }
          },
          {
            "description": "Only this inbox; combines with team_id and agent_id",
            "explode": false,
            "in": "query",
            "name": "inbox_id",
            "schema": {
              "description": "Only this inbox; combines with team_id and agent_id",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Only this team",
            "explode": false,
            "in": "query",
            "name": "team_id",
            "schema": {
              "description": "Only this team",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Only this agent",
            "explode": false,
            "in": "query",
            "name": "agent_id",
            "schema": {
              "description": "Only this agent",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Also compute the previous period of equal length",
            "explode": false,
            "in": "query",
            "name": "previous",
            "schema": {
              "default": true,
              "description": "Also compute the previous period of equal length",
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OverviewOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Tiles, daily series, heatmap and live strip from rollups",
        "tags": [
          "reports"
        ]
      }
    },
    "/reports/quality": {
      "get": {
        "operationId": "reports-quality",
        "parameters": [
          {
            "description": "Start day YYYY-MM-DD (inclusive) in tz",
            "explode": false,
            "in": "query",
            "name": "from",
            "required": true,
            "schema": {
              "description": "Start day YYYY-MM-DD (inclusive) in tz",
              "type": "string"
            }
          },
          {
            "description": "End day YYYY-MM-DD (inclusive) in tz",
            "explode": false,
            "in": "query",
            "name": "to",
            "required": true,
            "schema": {
              "description": "End day YYYY-MM-DD (inclusive) in tz",
              "type": "string"
            }
          },
          {
            "description": "IANA time zone for day and hour bucketing; empty uses the workspace time zone (general.timezone), else UTC",
            "explode": false,
            "in": "query",
            "name": "tz",
            "schema": {
              "description": "IANA time zone for day and hour bucketing; empty uses the workspace time zone (general.timezone), else UTC",
              "type": "string"
            }
          },
          {
            "description": "Only this inbox; combines with team_id and agent_id",
            "explode": false,
            "in": "query",
            "name": "inbox_id",
            "schema": {
              "description": "Only this inbox; combines with team_id and agent_id",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Only this team",
            "explode": false,
            "in": "query",
            "name": "team_id",
            "schema": {
              "description": "Only this team",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Only this agent",
            "explode": false,
            "in": "query",
            "name": "agent_id",
            "schema": {
              "description": "Only this agent",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Also compute the previous period of equal length",
            "explode": false,
            "in": "query",
            "name": "previous",
            "schema": {
              "default": true,
              "description": "Also compute the previous period of equal length",
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QualityOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Quality: reopen rate, one-touch resolution, replies per resolution, repeat contacts and missed website chats",
        "tags": [
          "reports"
        ]
      }
    },
    "/reports/schedules": {
      "get": {
        "operationId": "report-schedules-list",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report-schedules-listResponse"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "My scheduled report emails",
        "tags": [
          "reports"
        ]
      },
      "post": {
        "operationId": "report-schedules-create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScheduleBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportSchedule"
                }
              }
            },
            "description": "Created"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Schedule a daily or weekly report email to myself",
        "tags": [
          "reports"
        ]
      }
    },
    "/reports/schedules/{id}": {
      "delete": {
        "operationId": "report-schedules-delete",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Delete one of my scheduled report emails",
        "tags": [
          "reports"
        ]
      },
      "patch": {
        "operationId": "report-schedules-update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SchedulePatch"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportSchedule"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Change or pause one of my scheduled report emails",
        "tags": [
          "reports"
        ]
      }
    },
    "/reports/schedules/{id}/send": {
      "post": {
        "operationId": "report-schedules-send",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Send one of my scheduled report emails now (the last full period)",
        "tags": [
          "reports"
        ]
      }
    },
    "/reports/sla": {
      "get": {
        "operationId": "reports-sla",
        "parameters": [
          {
            "description": "Start day YYYY-MM-DD (inclusive) in tz",
            "explode": false,
            "in": "query",
            "name": "from",
            "required": true,
            "schema": {
              "description": "Start day YYYY-MM-DD (inclusive) in tz",
              "type": "string"
            }
          },
          {
            "description": "End day YYYY-MM-DD (inclusive) in tz",
            "explode": false,
            "in": "query",
            "name": "to",
            "required": true,
            "schema": {
              "description": "End day YYYY-MM-DD (inclusive) in tz",
              "type": "string"
            }
          },
          {
            "description": "IANA time zone for day and hour bucketing; empty uses the workspace time zone (general.timezone), else UTC",
            "explode": false,
            "in": "query",
            "name": "tz",
            "schema": {
              "description": "IANA time zone for day and hour bucketing; empty uses the workspace time zone (general.timezone), else UTC",
              "type": "string"
            }
          },
          {
            "description": "Only this inbox; combines with team_id and agent_id",
            "explode": false,
            "in": "query",
            "name": "inbox_id",
            "schema": {
              "description": "Only this inbox; combines with team_id and agent_id",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Only this team",
            "explode": false,
            "in": "query",
            "name": "team_id",
            "schema": {
              "description": "Only this team",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Only this agent",
            "explode": false,
            "in": "query",
            "name": "agent_id",
            "schema": {
              "description": "Only this agent",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Also compute the previous period of equal length",
            "explode": false,
            "in": "query",
            "name": "previous",
            "schema": {
              "default": true,
              "description": "Also compute the previous period of equal length",
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SlaReportOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "SLA attainment: first responses and resolutions within their policy's target, per day and policy, and what is past due now",
        "tags": [
          "reports"
        ]
      }
    },
    "/reports/staffing": {
      "get": {
        "operationId": "reports-staffing",
        "parameters": [
          {
            "description": "Start day YYYY-MM-DD (inclusive) in tz",
            "explode": false,
            "in": "query",
            "name": "from",
            "required": true,
            "schema": {
              "description": "Start day YYYY-MM-DD (inclusive) in tz",
              "type": "string"
            }
          },
          {
            "description": "End day YYYY-MM-DD (inclusive) in tz",
            "explode": false,
            "in": "query",
            "name": "to",
            "required": true,
            "schema": {
              "description": "End day YYYY-MM-DD (inclusive) in tz",
              "type": "string"
            }
          },
          {
            "description": "IANA time zone for day and hour bucketing; empty uses the workspace time zone (general.timezone), else UTC",
            "explode": false,
            "in": "query",
            "name": "tz",
            "schema": {
              "description": "IANA time zone for day and hour bucketing; empty uses the workspace time zone (general.timezone), else UTC",
              "type": "string"
            }
          },
          {
            "description": "Only this inbox; combines with team_id and agent_id",
            "explode": false,
            "in": "query",
            "name": "inbox_id",
            "schema": {
              "description": "Only this inbox; combines with team_id and agent_id",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Only this team",
            "explode": false,
            "in": "query",
            "name": "team_id",
            "schema": {
              "description": "Only this team",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Only this agent",
            "explode": false,
            "in": "query",
            "name": "agent_id",
            "schema": {
              "description": "Only this agent",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Also compute the previous period of equal length",
            "explode": false,
            "in": "query",
            "name": "previous",
            "schema": {
              "default": true,
              "description": "Also compute the previous period of equal length",
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StaffingOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Staffing: inbound volume against agents online by weekday and hour, occupancy and concurrency",
        "tags": [
          "reports"
        ]
      }
    },
    "/reports/table": {
      "get": {
        "operationId": "reports-table",
        "parameters": [
          {
            "description": "Start day YYYY-MM-DD (inclusive) in tz",
            "explode": false,
            "in": "query",
            "name": "from",
            "required": true,
            "schema": {
              "description": "Start day YYYY-MM-DD (inclusive) in tz",
              "type": "string"
            }
          },
          {
            "description": "End day YYYY-MM-DD (inclusive) in tz",
            "explode": false,
            "in": "query",
            "name": "to",
            "required": true,
            "schema": {
              "description": "End day YYYY-MM-DD (inclusive) in tz",
              "type": "string"
            }
          },
          {
            "description": "IANA time zone for day bucketing; empty uses the workspace time zone (general.timezone), else UTC",
            "explode": false,
            "in": "query",
            "name": "tz",
            "schema": {
              "description": "IANA time zone for day bucketing; empty uses the workspace time zone (general.timezone), else UTC",
              "type": "string"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "dimension",
            "schema": {
              "default": "agent",
              "enum": [
                "agent",
                "team",
                "inbox",
                "tag"
              ],
              "type": "string"
            }
          },
          {
            "description": "Only this inbox (not with dimension=tag)",
            "explode": false,
            "in": "query",
            "name": "inbox_id",
            "schema": {
              "description": "Only this inbox (not with dimension=tag)",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Only this team (not with dimension=tag)",
            "explode": false,
            "in": "query",
            "name": "team_id",
            "schema": {
              "description": "Only this team (not with dimension=tag)",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Only this agent (not with dimension=tag)",
            "explode": false,
            "in": "query",
            "name": "agent_id",
            "schema": {
              "description": "Only this agent (not with dimension=tag)",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Rows per page, ordered by dimension_id; 0 (the default) returns every row",
            "explode": false,
            "in": "query",
            "name": "limit",
            "schema": {
              "description": "Rows per page, ordered by dimension_id; 0 (the default) returns every row",
              "format": "int64",
              "maximum": 1000,
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "next_cursor of the previous page",
            "explode": false,
            "in": "query",
            "name": "cursor",
            "schema": {
              "description": "next_cursor of the previous page",
              "maxLength": 40,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TableOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Breakdown by agent, team, inbox or tag, optionally within an inbox, team and agent",
        "tags": [
          "reports"
        ]
      }
    },
    "/reports/table.csv": {
      "get": {
        "description": "The same rows and numbers as GET /reports/table, sorted as the Reports page sorts them (most assigned first). Durations are in seconds. Text cells that a spreadsheet could take for a formula start with an apostrophe.",
        "operationId": "reports-table-csv",
        "parameters": [
          {
            "description": "Start day YYYY-MM-DD (inclusive) in tz",
            "explode": false,
            "in": "query",
            "name": "from",
            "required": true,
            "schema": {
              "description": "Start day YYYY-MM-DD (inclusive) in tz",
              "type": "string"
            }
          },
          {
            "description": "End day YYYY-MM-DD (inclusive) in tz",
            "explode": false,
            "in": "query",
            "name": "to",
            "required": true,
            "schema": {
              "description": "End day YYYY-MM-DD (inclusive) in tz",
              "type": "string"
            }
          },
          {
            "description": "IANA time zone for day bucketing; empty uses the workspace time zone (general.timezone), else UTC",
            "explode": false,
            "in": "query",
            "name": "tz",
            "schema": {
              "description": "IANA time zone for day bucketing; empty uses the workspace time zone (general.timezone), else UTC",
              "type": "string"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "dimension",
            "schema": {
              "default": "agent",
              "enum": [
                "agent",
                "team",
                "inbox",
                "tag"
              ],
              "type": "string"
            }
          },
          {
            "description": "Only this inbox (not with dimension=tag)",
            "explode": false,
            "in": "query",
            "name": "inbox_id",
            "schema": {
              "description": "Only this inbox (not with dimension=tag)",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Only this team (not with dimension=tag)",
            "explode": false,
            "in": "query",
            "name": "team_id",
            "schema": {
              "description": "Only this team (not with dimension=tag)",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Only this agent (not with dimension=tag)",
            "explode": false,
            "in": "query",
            "name": "agent_id",
            "schema": {
              "description": "Only this agent (not with dimension=tag)",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/csv; charset=utf-8": {
                "schema": {
                  "contentMediaType": "application/octet-stream",
                  "format": "binary",
                  "type": "string"
                }
              }
            },
            "description": "The file (csv)"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "The breakdown as CSV",
        "tags": [
          "reports"
        ]
      }
    },
    "/reports/table.xlsx": {
      "get": {
        "description": "The same rows and numbers as GET /reports/table, sorted as the Reports page sorts them (most assigned first). Durations are in seconds. Text cells that a spreadsheet could take for a formula start with an apostrophe.",
        "operationId": "reports-table-xlsx",
        "parameters": [
          {
            "description": "Start day YYYY-MM-DD (inclusive) in tz",
            "explode": false,
            "in": "query",
            "name": "from",
            "required": true,
            "schema": {
              "description": "Start day YYYY-MM-DD (inclusive) in tz",
              "type": "string"
            }
          },
          {
            "description": "End day YYYY-MM-DD (inclusive) in tz",
            "explode": false,
            "in": "query",
            "name": "to",
            "required": true,
            "schema": {
              "description": "End day YYYY-MM-DD (inclusive) in tz",
              "type": "string"
            }
          },
          {
            "description": "IANA time zone for day bucketing; empty uses the workspace time zone (general.timezone), else UTC",
            "explode": false,
            "in": "query",
            "name": "tz",
            "schema": {
              "description": "IANA time zone for day bucketing; empty uses the workspace time zone (general.timezone), else UTC",
              "type": "string"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "dimension",
            "schema": {
              "default": "agent",
              "enum": [
                "agent",
                "team",
                "inbox",
                "tag"
              ],
              "type": "string"
            }
          },
          {
            "description": "Only this inbox (not with dimension=tag)",
            "explode": false,
            "in": "query",
            "name": "inbox_id",
            "schema": {
              "description": "Only this inbox (not with dimension=tag)",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Only this team (not with dimension=tag)",
            "explode": false,
            "in": "query",
            "name": "team_id",
            "schema": {
              "description": "Only this team (not with dimension=tag)",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Only this agent (not with dimension=tag)",
            "explode": false,
            "in": "query",
            "name": "agent_id",
            "schema": {
              "description": "Only this agent (not with dimension=tag)",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
                "schema": {
                  "contentMediaType": "application/octet-stream",
                  "format": "binary",
                  "type": "string"
                }
              }
            },
            "description": "The file (xlsx)"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "The breakdown as Excel (.xlsx)",
        "tags": [
          "reports"
        ]
      }
    },
    "/reports/timeseries": {
      "get": {
        "description": "Created, resolved, reopened, assigned, messages, and first response and resolution (count, median, p90, in wall clock and business hours) per period, with the Reports page's filters.",
        "operationId": "reports-timeseries",
        "parameters": [
          {
            "description": "Start day YYYY-MM-DD (inclusive) in tz",
            "explode": false,
            "in": "query",
            "name": "from",
            "required": true,
            "schema": {
              "description": "Start day YYYY-MM-DD (inclusive) in tz",
              "type": "string"
            }
          },
          {
            "description": "End day YYYY-MM-DD (inclusive) in tz",
            "explode": false,
            "in": "query",
            "name": "to",
            "required": true,
            "schema": {
              "description": "End day YYYY-MM-DD (inclusive) in tz",
              "type": "string"
            }
          },
          {
            "description": "IANA time zone for day bucketing; empty uses the workspace time zone (general.timezone), else UTC",
            "explode": false,
            "in": "query",
            "name": "tz",
            "schema": {
              "description": "IANA time zone for day bucketing; empty uses the workspace time zone (general.timezone), else UTC",
              "type": "string"
            }
          },
          {
            "description": "Only this inbox; combines with team_id and agent_id",
            "explode": false,
            "in": "query",
            "name": "inbox_id",
            "schema": {
              "description": "Only this inbox; combines with team_id and agent_id",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Only this team",
            "explode": false,
            "in": "query",
            "name": "team_id",
            "schema": {
              "description": "Only this team",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Only this agent",
            "explode": false,
            "in": "query",
            "name": "agent_id",
            "schema": {
              "description": "Only this agent",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Period of each point: a local day, an ISO week (Monday first) or a calendar month",
            "explode": false,
            "in": "query",
            "name": "interval",
            "schema": {
              "default": "day",
              "description": "Period of each point: a local day, an ISO week (Monday first) or a calendar month",
              "enum": [
                "day",
                "week",
                "month"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimeseriesOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Every tile number per day, week or month",
        "tags": [
          "reports"
        ]
      }
    },
    "/reports/timeseries.csv": {
      "get": {
        "description": "The points of GET /reports/timeseries, durations in seconds.",
        "operationId": "reports-timeseries-csv",
        "parameters": [
          {
            "description": "Start day YYYY-MM-DD (inclusive) in tz",
            "explode": false,
            "in": "query",
            "name": "from",
            "required": true,
            "schema": {
              "description": "Start day YYYY-MM-DD (inclusive) in tz",
              "type": "string"
            }
          },
          {
            "description": "End day YYYY-MM-DD (inclusive) in tz",
            "explode": false,
            "in": "query",
            "name": "to",
            "required": true,
            "schema": {
              "description": "End day YYYY-MM-DD (inclusive) in tz",
              "type": "string"
            }
          },
          {
            "description": "IANA time zone for day bucketing; empty uses the workspace time zone (general.timezone), else UTC",
            "explode": false,
            "in": "query",
            "name": "tz",
            "schema": {
              "description": "IANA time zone for day bucketing; empty uses the workspace time zone (general.timezone), else UTC",
              "type": "string"
            }
          },
          {
            "description": "Only this inbox; combines with team_id and agent_id",
            "explode": false,
            "in": "query",
            "name": "inbox_id",
            "schema": {
              "description": "Only this inbox; combines with team_id and agent_id",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Only this team",
            "explode": false,
            "in": "query",
            "name": "team_id",
            "schema": {
              "description": "Only this team",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Only this agent",
            "explode": false,
            "in": "query",
            "name": "agent_id",
            "schema": {
              "description": "Only this agent",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Period of each point: a local day, an ISO week (Monday first) or a calendar month",
            "explode": false,
            "in": "query",
            "name": "interval",
            "schema": {
              "default": "day",
              "description": "Period of each point: a local day, an ISO week (Monday first) or a calendar month",
              "enum": [
                "day",
                "week",
                "month"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/csv; charset=utf-8": {
                "schema": {
                  "contentMediaType": "application/octet-stream",
                  "format": "binary",
                  "type": "string"
                }
              }
            },
            "description": "The file (csv)"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "The time series as CSV",
        "tags": [
          "reports"
        ]
      }
    },
    "/reports/timeseries.xlsx": {
      "get": {
        "description": "The points of GET /reports/timeseries, durations in seconds.",
        "operationId": "reports-timeseries-xlsx",
        "parameters": [
          {
            "description": "Start day YYYY-MM-DD (inclusive) in tz",
            "explode": false,
            "in": "query",
            "name": "from",
            "required": true,
            "schema": {
              "description": "Start day YYYY-MM-DD (inclusive) in tz",
              "type": "string"
            }
          },
          {
            "description": "End day YYYY-MM-DD (inclusive) in tz",
            "explode": false,
            "in": "query",
            "name": "to",
            "required": true,
            "schema": {
              "description": "End day YYYY-MM-DD (inclusive) in tz",
              "type": "string"
            }
          },
          {
            "description": "IANA time zone for day bucketing; empty uses the workspace time zone (general.timezone), else UTC",
            "explode": false,
            "in": "query",
            "name": "tz",
            "schema": {
              "description": "IANA time zone for day bucketing; empty uses the workspace time zone (general.timezone), else UTC",
              "type": "string"
            }
          },
          {
            "description": "Only this inbox; combines with team_id and agent_id",
            "explode": false,
            "in": "query",
            "name": "inbox_id",
            "schema": {
              "description": "Only this inbox; combines with team_id and agent_id",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Only this team",
            "explode": false,
            "in": "query",
            "name": "team_id",
            "schema": {
              "description": "Only this team",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Only this agent",
            "explode": false,
            "in": "query",
            "name": "agent_id",
            "schema": {
              "description": "Only this agent",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Period of each point: a local day, an ISO week (Monday first) or a calendar month",
            "explode": false,
            "in": "query",
            "name": "interval",
            "schema": {
              "default": "day",
              "description": "Period of each point: a local day, an ISO week (Monday first) or a calendar month",
              "enum": [
                "day",
                "week",
                "month"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
                "schema": {
                  "contentMediaType": "application/octet-stream",
                  "format": "binary",
                  "type": "string"
                }
              }
            },
            "description": "The file (xlsx)"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "The time series as Excel (.xlsx)",
        "tags": [
          "reports"
        ]
      }
    },
    "/reports/views": {
      "get": {
        "description": "Pinned views first in the viewer's order, then by name. API keys see the shared views.",
        "operationId": "report-views-list",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report-views-listResponse"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Saved Reports views: mine and the shared ones",
        "tags": [
          "reports"
        ]
      },
      "post": {
        "operationId": "report-views-create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReportViewBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportView"
                }
              }
            },
            "description": "Created"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Save the current Reports view",
        "tags": [
          "reports"
        ]
      }
    },
    "/reports/views/{id}": {
      "delete": {
        "operationId": "report-views-delete",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Delete a saved view",
        "tags": [
          "reports"
        ]
      },
      "get": {
        "operationId": "report-views-get",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportView"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "One saved Reports view",
        "tags": [
          "reports"
        ]
      },
      "patch": {
        "description": "A private view by its owner; sharing, and any change to a shared view, needs reports:share.",
        "operationId": "report-views-update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReportViewPatch"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportView"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Rename, change, share or unshare a saved view",
        "tags": [
          "reports"
        ]
      }
    },
    "/reports/views/{id}/duplicate": {
      "post": {
        "operationId": "report-views-duplicate",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Report-views-duplicateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportView"
                }
              }
            },
            "description": "Created"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Copy a view I can see into a private view of mine",
        "tags": [
          "reports"
        ]
      }
    },
    "/reports/views/{id}/pin": {
      "put": {
        "operationId": "report-views-pin",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Report-views-pinRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportView"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Pin or unpin a view on my Reports sidebar",
        "tags": [
          "reports"
        ]
      }
    },
    "/reports/views/{id}/table.csv": {
      "get": {
        "description": "The view's filters, grouping and window (a preset ends today in tz), within the caller's own reporting scope.",
        "operationId": "report-views-table-csv",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "IANA time zone for the view's days; empty uses the workspace time zone (general.timezone), else UTC",
            "explode": false,
            "in": "query",
            "name": "tz",
            "schema": {
              "description": "IANA time zone for the view's days; empty uses the workspace time zone (general.timezone), else UTC",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/csv; charset=utf-8": {
                "schema": {
                  "contentMediaType": "application/octet-stream",
                  "format": "binary",
                  "type": "string"
                }
              }
            },
            "description": "The file (csv)"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "A saved view's breakdown as CSV",
        "tags": [
          "reports"
        ]
      }
    },
    "/reports/views/{id}/table.xlsx": {
      "get": {
        "description": "The view's filters, grouping and window (a preset ends today in tz), within the caller's own reporting scope.",
        "operationId": "report-views-table-xlsx",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "IANA time zone for the view's days; empty uses the workspace time zone (general.timezone), else UTC",
            "explode": false,
            "in": "query",
            "name": "tz",
            "schema": {
              "description": "IANA time zone for the view's days; empty uses the workspace time zone (general.timezone), else UTC",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
                "schema": {
                  "contentMediaType": "application/octet-stream",
                  "format": "binary",
                  "type": "string"
                }
              }
            },
            "description": "The file (xlsx)"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "A saved view's breakdown as Excel (.xlsx)",
        "tags": [
          "reports"
        ]
      }
    },
    "/responders/fields": {
      "get": {
        "operationId": "responders-fields",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContextFieldsOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Fields that conditions of an inbox's bots and flows (and a flow's Condition step) can use",
        "tags": [
          "inboxes"
        ]
      }
    },
    "/roles": {
      "get": {
        "operationId": "roles-list",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoleListOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "List roles",
        "tags": [
          "roles"
        ]
      },
      "post": {
        "operationId": "roles-create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RoleInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Role"
                }
              }
            },
            "description": "Created"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Create a custom role",
        "tags": [
          "roles"
        ]
      }
    },
    "/roles/{id}": {
      "put": {
        "operationId": "roles-update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RoleUpdateInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Role"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Replace a role's name, permissions, visibility and field grants",
        "tags": [
          "roles"
        ]
      }
    },
    "/sensitive/reveal": {
      "post": {
        "operationId": "sensitive-reveal",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RevealInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RevealOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Reveal one masked field of one record; audited",
        "tags": [
          "sensitive"
        ]
      }
    },
    "/sensitive/reveals": {
      "get": {
        "operationId": "sensitive-reveals",
        "parameters": [
          {
            "description": "How far back to look",
            "explode": false,
            "in": "query",
            "name": "days",
            "schema": {
              "default": 30,
              "description": "How far back to look",
              "format": "int64",
              "maximum": 366,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RevealsOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Who revealed masked personal data lately, from the audit log",
        "tags": [
          "sensitive"
        ]
      }
    },
    "/settings": {
      "get": {
        "operationId": "settings-list",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsListOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "List account settings with effective values",
        "tags": [
          "settings"
        ]
      }
    },
    "/settings/{key}": {
      "put": {
        "operationId": "settings-put",
        "parameters": [
          {
            "in": "path",
            "name": "key",
            "required": true,
            "schema": {
              "maxLength": 120,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingPutInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Setting"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Change one account setting",
        "tags": [
          "settings"
        ]
      }
    },
    "/sla/policies": {
      "get": {
        "operationId": "sla-policies-list",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SlaPolicyListOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "List SLA policies in the order they are tried",
        "tags": [
          "sla"
        ]
      },
      "post": {
        "description": "It applies to conversations as they next change (a new one, a reply, a status or priority change), and a report rebuild counts it over the stored history.",
        "operationId": "sla-policies-create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SlaPolicyBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SLAPolicy"
                }
              }
            },
            "description": "Created"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Create an SLA policy (tried after the existing ones)",
        "tags": [
          "sla"
        ]
      }
    },
    "/sla/policies/order": {
      "put": {
        "operationId": "sla-policies-order",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SlaOrderInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SlaPolicyListOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Set the order SLA policies are tried in",
        "tags": [
          "sla"
        ]
      }
    },
    "/sla/policies/{id}": {
      "delete": {
        "operationId": "sla-policies-delete",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Delete an SLA policy; what it counted in reports stays",
        "tags": [
          "sla"
        ]
      },
      "put": {
        "operationId": "sla-policies-update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SlaPolicyBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SLAPolicy"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Change an SLA policy",
        "tags": [
          "sla"
        ]
      }
    },
    "/tags": {
      "get": {
        "operationId": "tags-list",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TagsOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "List tags",
        "tags": [
          "tags"
        ]
      },
      "post": {
        "operationId": "tags-create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TagInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Tag"
                }
              }
            },
            "description": "Created"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Create a tag",
        "tags": [
          "tags"
        ]
      }
    },
    "/tags/{id}": {
      "delete": {
        "operationId": "tags-delete",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Delete a tag everywhere",
        "tags": [
          "tags"
        ]
      },
      "put": {
        "operationId": "tags-update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TagUpdateInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Tag"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Rename or recolour a tag",
        "tags": [
          "tags"
        ]
      }
    },
    "/teams": {
      "get": {
        "operationId": "teams-list",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TeamListOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "List teams with their members",
        "tags": [
          "teams"
        ]
      },
      "post": {
        "operationId": "teams-create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TeamBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Team"
                }
              }
            },
            "description": "Created"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Create a team",
        "tags": [
          "teams"
        ]
      }
    },
    "/teams/{id}": {
      "delete": {
        "operationId": "teams-delete",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Delete a team; conversations keep their history and lose the team",
        "tags": [
          "teams"
        ]
      },
      "put": {
        "operationId": "teams-update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TeamBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Team"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Rename a team",
        "tags": [
          "teams"
        ]
      }
    },
    "/teams/{id}/members": {
      "put": {
        "operationId": "teams-set-members",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TeamMembersInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Team"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Replace the members of a team",
        "tags": [
          "teams"
        ]
      }
    },
    "/views": {
      "get": {
        "operationId": "views-list",
        "parameters": [
          {
            "description": "conversation (the default) or contact",
            "explode": false,
            "in": "query",
            "name": "object",
            "schema": {
              "description": "conversation (the default) or contact",
              "enum": [
                "conversation",
                "contact",
                ""
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ViewsOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Shared views and the caller's own, of one object",
        "tags": [
          "views"
        ]
      },
      "post": {
        "operationId": "views-create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ViewInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/View"
                }
              }
            },
            "description": "Created"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Save a view",
        "tags": [
          "views"
        ]
      }
    },
    "/views/schema": {
      "get": {
        "operationId": "views-schema",
        "parameters": [
          {
            "description": "conversation (the default) or contact",
            "explode": false,
            "in": "query",
            "name": "object",
            "schema": {
              "description": "conversation (the default) or contact",
              "enum": [
                "conversation",
                "contact",
                ""
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ViewSchema"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Fields and operators a conversation or contact condition may use",
        "tags": [
          "views"
        ]
      }
    },
    "/views/{id}": {
      "delete": {
        "operationId": "views-delete",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Delete a view",
        "tags": [
          "views"
        ]
      },
      "put": {
        "operationId": "views-update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ViewUpdateInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/View"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Change a view",
        "tags": [
          "views"
        ]
      }
    },
    "/webhooks": {
      "get": {
        "operationId": "webhooks-list",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhooksOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "List webhooks",
        "tags": [
          "webhooks"
        ]
      },
      "post": {
        "operationId": "webhooks-create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhook"
                }
              }
            },
            "description": "Created"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Create a webhook; the secret is returned once",
        "tags": [
          "webhooks"
        ]
      }
    },
    "/webhooks/{id}": {
      "delete": {
        "operationId": "webhooks-delete",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Delete a webhook and its ledger",
        "tags": [
          "webhooks"
        ]
      },
      "put": {
        "operationId": "webhooks-update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookUpdateInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhook"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Update a webhook (name, url, events, pause or resume)",
        "tags": [
          "webhooks"
        ]
      }
    },
    "/webhooks/{id}/deliveries": {
      "get": {
        "operationId": "webhooks-deliveries",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "before_id",
            "schema": {
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "format": "int64",
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "Only deliveries in this state; omitted lists all",
            "explode": false,
            "in": "query",
            "name": "status",
            "schema": {
              "description": "Only deliveries in this state; omitted lists all",
              "enum": [
                "pending",
                "retrying",
                "delivered",
                "failed",
                "cancelled",
                "over_budget"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeliveriesOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Delivery ledger, newest first",
        "tags": [
          "webhooks"
        ]
      }
    },
    "/webhooks/{id}/deliveries/replay-failed": {
      "post": {
        "operationId": "webhooks-replay-failed",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReplayFailedOutputBody"
                }
              }
            },
            "description": "Accepted"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Deliver the endpoint's failed deliveries again (oldest 100, spaced; once a minute)",
        "tags": [
          "webhooks"
        ]
      }
    },
    "/webhooks/{id}/deliveries/{delivery_id}/replay": {
      "post": {
        "operationId": "webhooks-replay",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "path",
            "name": "delivery_id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Delivery"
                }
              }
            },
            "description": "Accepted"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Deliver again now",
        "tags": [
          "webhooks"
        ]
      }
    },
    "/webhooks/{id}/rotate-secret": {
      "post": {
        "operationId": "webhooks-rotate-secret",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhook"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Issue a new signing secret",
        "tags": [
          "webhooks"
        ]
      }
    },
    "/widget/context": {
      "post": {
        "description": "Sent by the widget when the visitor changes page, when the host page calls Kommio.setContext, and when a session resumes an open conversation. Stored only for a conversation of this visitor in which they have written; otherwise nothing happens.",
        "operationId": "widget-context",
        "parameters": [
          {
            "in": "header",
            "name": "Authorization",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WidgetContextInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "No Content"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Update the visitor context of the visitor's conversation",
        "tags": [
          "widget"
        ]
      }
    },
    "/widget/conversations": {
      "get": {
        "operationId": "widget-conversations",
        "parameters": [
          {
            "in": "header",
            "name": "Authorization",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetConversationsOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "The visitor's conversations in this inbox",
        "tags": [
          "widget"
        ]
      }
    },
    "/widget/conversations/{id}/csat": {
      "get": {
        "operationId": "widget-csat",
        "parameters": [
          {
            "in": "header",
            "name": "Authorization",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSurveyOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "The conversation's status and satisfaction survey",
        "tags": [
          "widget"
        ]
      },
      "post": {
        "description": "Allowed while the conversation is resolved, within 7 days of the resolution; one answer per resolution, which may be changed for 24 hours. 409 when the survey is closed or already answered, 422 for a value off the scale or a missing required comment.",
        "operationId": "widget-csat-answer",
        "parameters": [
          {
            "in": "header",
            "name": "Authorization",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SurveyAnswerBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSurveyOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Answer the satisfaction survey of a resolved conversation",
        "tags": [
          "widget"
        ]
      }
    },
    "/widget/conversations/{id}/messages": {
      "get": {
        "operationId": "widget-messages",
        "parameters": [
          {
            "in": "header",
            "name": "Authorization",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "after_id",
            "schema": {
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetMessagesOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Messages of the visitor's conversation",
        "tags": [
          "widget"
        ]
      }
    },
    "/widget/conversations/{id}/seen": {
      "post": {
        "description": "Marks the team's replies up to up_to as read by the visitor; agents see \"Seen\" under them.",
        "operationId": "widget-seen",
        "parameters": [
          {
            "in": "header",
            "name": "Authorization",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WidgetSeenInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "No Content"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "The visitor has seen the team's messages",
        "tags": [
          "widget"
        ]
      }
    },
    "/widget/conversations/{id}/transcript": {
      "post": {
        "description": "Replies only (never private notes or activity), in the visitor's language. Needs a reply from the team; at most 3 a day per conversation, 2 minutes apart.",
        "operationId": "widget-transcript",
        "parameters": [
          {
            "in": "header",
            "name": "Authorization",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WidgetTranscriptInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetTranscriptOutputBody"
                }
              }
            },
            "description": "Accepted"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Email the conversation's transcript to the visitor",
        "tags": [
          "widget"
        ]
      }
    },
    "/widget/conversations/{id}/typing": {
      "post": {
        "operationId": "widget-typing",
        "parameters": [
          {
            "in": "header",
            "name": "Authorization",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "The visitor is typing",
        "tags": [
          "widget"
        ]
      }
    },
    "/widget/email": {
      "post": {
        "description": "Asked when nobody can answer now: replies the visitor misses are emailed there. Stored as the contact's display email when it has none; it never identifies or matches a contact (D-099).",
        "operationId": "widget-email",
        "parameters": [
          {
            "in": "header",
            "name": "Authorization",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WidgetEmailInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetEmailOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Leave an email for replies",
        "tags": [
          "widget"
        ]
      }
    },
    "/widget/files/{token}": {
      "get": {
        "operationId": "widget-file",
        "parameters": [
          {
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "maxLength": 600,
              "type": "string"
            }
          },
          {
            "description": "320 for the preview of an image; the original is served when there is none",
            "explode": false,
            "in": "query",
            "name": "size",
            "schema": {
              "description": "320 for the preview of an image; the original is served when there is none",
              "format": "int64",
              "maximum": 4096,
              "minimum": 0,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The file"
          },
          "302": {
            "description": "Redirect to a signed URL"
          }
        },
        "summary": "Download a file of the visitor's conversation (signed link)",
        "tags": [
          "widget"
        ]
      }
    },
    "/widget/messages": {
      "post": {
        "operationId": "widget-send",
        "parameters": [
          {
            "in": "header",
            "name": "Authorization",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Origin",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WidgetMessageInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetMessageOutputBody"
                }
              }
            },
            "description": "Created"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Send a message as the visitor",
        "tags": [
          "widget"
        ]
      }
    },
    "/widget/uploads": {
      "post": {
        "description": "Multipart with one part named file, within the inbox's limits (the widget config's files: by default images (PNG, JPEG, GIF, WebP), PDF, text, CSV and Word or Excel documents up to 10 MB, 5 per message); 20 files an hour per visitor. The returned handle goes in the message's uploads.",
        "operationId": "widget-upload",
        "parameters": [
          {
            "in": "header",
            "name": "Authorization",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "properties": {
                  "filename": {
                    "contentMediaType": "application/octet-stream",
                    "description": "filename of the file being uploaded",
                    "format": "binary",
                    "type": "string"
                  },
                  "name": {
                    "description": "general purpose name for multipart form value",
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetUpload"
                }
              }
            },
            "description": "Created"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Upload a file for the visitor's next message",
        "tags": [
          "widget"
        ]
      }
    },
    "/widget/{key}/config": {
      "get": {
        "operationId": "widget-config",
        "parameters": [
          {
            "in": "path",
            "name": "key",
            "required": true,
            "schema": {
              "maxLength": 64,
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Origin",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Origin of the page embedding the widget (installation check only)",
            "explode": false,
            "in": "query",
            "name": "host",
            "schema": {
              "description": "Origin of the page embedding the widget (installation check only)",
              "maxLength": 300,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetConfig"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Widget configuration for an inbox",
        "tags": [
          "widget"
        ]
      }
    },
    "/widget/{key}/help": {
      "get": {
        "operationId": "widget-help",
        "parameters": [
          {
            "in": "path",
            "name": "key",
            "required": true,
            "schema": {
              "maxLength": 64,
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Origin",
            "schema": {
              "type": "string"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "locale",
            "schema": {
              "maxLength": 16,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HelpHome"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "The Help tab: the linked help center's collections and popular articles",
        "tags": [
          "widget"
        ]
      }
    },
    "/widget/{key}/help/articles/{id}": {
      "get": {
        "operationId": "widget-help-article",
        "parameters": [
          {
            "in": "path",
            "name": "key",
            "required": true,
            "schema": {
              "maxLength": 64,
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "Origin",
            "schema": {
              "type": "string"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "locale",
            "schema": {
              "maxLength": 16,
              "type": "string"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "session",
            "schema": {
              "maxLength": 36,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HelpArticle"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Read a live public article in the widget",
        "tags": [
          "widget"
        ]
      }
    },
    "/widget/{key}/help/articles/{id}/feedback": {
      "post": {
        "operationId": "widget-help-feedback",
        "parameters": [
          {
            "in": "path",
            "name": "key",
            "required": true,
            "schema": {
              "maxLength": 64,
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "Origin",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WidgetHelpFeedbackInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HelpOKOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Was this article helpful? (anonymous)",
        "tags": [
          "widget"
        ]
      }
    },
    "/widget/{key}/help/events": {
      "post": {
        "operationId": "widget-help-event",
        "parameters": [
          {
            "in": "path",
            "name": "key",
            "required": true,
            "schema": {
              "maxLength": 64,
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Origin",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WidgetHelpEventInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HelpOKOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Record an anonymous Help tab event for deflection (a chat started after reading)",
        "tags": [
          "widget"
        ]
      }
    },
    "/widget/{key}/help/search": {
      "get": {
        "operationId": "widget-help-search",
        "parameters": [
          {
            "in": "path",
            "name": "key",
            "required": true,
            "schema": {
              "maxLength": 64,
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Origin",
            "schema": {
              "type": "string"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "locale",
            "schema": {
              "maxLength": 16,
              "type": "string"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "q",
            "schema": {
              "maxLength": 200,
              "type": "string"
            }
          },
          {
            "description": "The widget's random help session id (deflection counts)",
            "explode": false,
            "in": "query",
            "name": "session",
            "schema": {
              "description": "The widget's random help session id (deflection counts)",
              "maxLength": 36,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HelpSearchOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Search the linked help center",
        "tags": [
          "widget"
        ]
      }
    },
    "/widget/{key}/session": {
      "post": {
        "operationId": "widget-session",
        "parameters": [
          {
            "in": "path",
            "name": "key",
            "required": true,
            "schema": {
              "maxLength": 64,
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Origin",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WidgetSessionInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSession"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Start or continue a visitor session",
        "tags": [
          "widget"
        ]
      }
    },
    "/widget/{key}/status": {
      "get": {
        "description": "Polled by widgets that have no socket yet (a visitor who has not written). Cached for a few seconds per inbox; a connected widget hears inbox.status frames instead.",
        "operationId": "widget-status",
        "parameters": [
          {
            "in": "path",
            "name": "key",
            "required": true,
            "schema": {
              "maxLength": 64,
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Origin",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Origin of the page embedding the widget (installation check only)",
            "explode": false,
            "in": "query",
            "name": "host",
            "schema": {
              "description": "Origin of the page embedding the widget (installation check only)",
              "maxLength": 300,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetStatusOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Whether someone is there to answer",
        "tags": [
          "widget"
        ]
      }
    }
  },
  "servers": [
    {
      "url": "/api"
    }
  ]
}
