{
  "openapi": "3.0.3",
  "info": {
    "title": "Polymorfa WhatsApp API",
    "version": "1.0.0",
    "description": "Public Polymorfa REST API for sessions, messaging, media, webhooks, campaigns, templates, client tokens, QuickLinks, and bridge routing.",
    "contact": {
      "name": "Polymorfa API",
      "url": "https://docs.polymorfa.com"
    }
  },
  "servers": [
    {
      "url": "https://api.polymorfa.com"
    }
  ],
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "components": {
    "schemas": {
      "IdentityRef": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[1-9][0-9]{0,18}$",
            "description": "Opaque Polymorfa resource ID. Keep this value as a string.",
            "example": "739182640518203"
          },
          "phoneNumber": {
            "type": "string"
          },
          "bsuid": {
            "type": "string"
          },
          "username": {
            "type": "string"
          }
        },
        "required": [
          "id"
        ]
      },
      "ConversationRef": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[1-9][0-9]{0,18}$",
            "description": "Opaque Polymorfa resource ID. Keep this value as a string.",
            "example": "739182640518203"
          },
          "phoneNumber": {
            "type": "string"
          },
          "bsuid": {
            "type": "string"
          },
          "username": {
            "type": "string"
          },
          "sender": {
            "$ref": "#/components/schemas/IdentityRef"
          }
        },
        "required": [
          "id"
        ]
      },
      "PollOption": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "hash": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "hash"
        ]
      },
      "MessagePayload": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[1-9][0-9]{0,18}$",
            "description": "Opaque Polymorfa resource ID. Keep this value as a string.",
            "example": "739182640518203"
          },
          "whatsapp_id": {
            "type": "string",
            "minLength": 1
          },
          "conversation": {
            "$ref": "#/components/schemas/ConversationRef"
          },
          "fromMe": {
            "type": "boolean"
          },
          "timestamp": {
            "type": "number"
          },
          "pushName": {
            "type": "string"
          },
          "isGroup": {
            "type": "boolean"
          },
          "type": {
            "type": "string",
            "enum": [
              "text",
              "image",
              "video",
              "audio",
              "document",
              "location",
              "contact",
              "phone_number_shared",
              "poll",
              "sticker",
              "reaction",
              "revoke",
              "edited",
              "unknown"
            ]
          },
          "text": {
            "type": "string"
          },
          "caption": {
            "type": "string"
          },
          "mimeType": {
            "type": "string"
          },
          "ptt": {
            "type": "boolean"
          },
          "filename": {
            "type": "string"
          },
          "latitude": {
            "type": "number"
          },
          "longitude": {
            "type": "number"
          },
          "displayName": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "reaction": {
            "type": "string"
          },
          "reactionTo": {
            "type": "string",
            "pattern": "^[1-9][0-9]{0,18}$",
            "description": "Opaque Polymorfa resource ID. Keep this value as a string.",
            "example": "739182640518203"
          },
          "revokedId": {
            "type": "string",
            "pattern": "^[1-9][0-9]{0,18}$",
            "description": "Opaque Polymorfa resource ID. Keep this value as a string.",
            "example": "739182640518203"
          },
          "nativeFlowResponse": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              "paramsJson": {
                "type": "string",
                "minLength": 1,
                "maxLength": 262144
              },
              "version": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": [
              "name",
              "paramsJson"
            ]
          },
          "media": {
            "type": "string"
          },
          "mediaUrl": {
            "type": "string"
          },
          "edited": {
            "type": "boolean"
          },
          "pollOptions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PollOption"
            }
          },
          "unavailable": {
            "type": "boolean"
          },
          "unavailableReason": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "whatsapp_id",
          "conversation",
          "fromMe",
          "timestamp",
          "pushName",
          "isGroup",
          "type"
        ]
      },
      "CloudMessagePayload": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[1-9][0-9]{0,18}$",
            "description": "Opaque Polymorfa resource ID. Keep this value as a string.",
            "example": "739182640518203"
          },
          "whatsapp_id": {
            "type": "string",
            "minLength": 1
          },
          "conversation": {
            "$ref": "#/components/schemas/ConversationRef"
          },
          "timestamp": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "senderName": {
            "type": "string"
          },
          "nativeFlowResponse": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              "paramsJson": {
                "type": "string",
                "minLength": 1,
                "maxLength": 262144
              },
              "version": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": [
              "name",
              "paramsJson"
            ]
          },
          "interactive": {
            "type": "object",
            "additionalProperties": {}
          }
        },
        "required": [
          "id",
          "whatsapp_id",
          "conversation",
          "timestamp",
          "type"
        ]
      },
      "MessageReceivedPayload": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/MessagePayload"
          },
          {
            "$ref": "#/components/schemas/CloudMessagePayload"
          }
        ]
      },
      "MessageReceivedEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "message.received"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/MessageReceivedPayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ]
      },
      "MessageSentPayload": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[1-9][0-9]{0,18}$",
            "description": "Opaque Polymorfa resource ID. Keep this value as a string.",
            "example": "739182640518203"
          },
          "whatsapp_id": {
            "type": "string",
            "minLength": 1
          },
          "conversation": {
            "$ref": "#/components/schemas/ConversationRef"
          },
          "type": {
            "type": "string"
          },
          "timestamp": {
            "type": "number"
          }
        },
        "required": [
          "id",
          "whatsapp_id",
          "conversation",
          "type",
          "timestamp"
        ]
      },
      "MessageSentEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "message.sent"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/MessageSentPayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ]
      },
      "MessageAckPayload": {
        "type": "object",
        "properties": {
          "messages": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^[1-9][0-9]{0,18}$",
                  "description": "Opaque Polymorfa resource ID. Keep this value as a string.",
                  "example": "739182640518203"
                },
                "whatsapp_id": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "required": [
                "id",
                "whatsapp_id"
              ]
            }
          },
          "conversation": {
            "$ref": "#/components/schemas/ConversationRef"
          },
          "from": {
            "$ref": "#/components/schemas/IdentityRef"
          },
          "sender": {
            "$ref": "#/components/schemas/IdentityRef"
          },
          "type": {
            "type": "string",
            "description": "Ack type: error, delivered, read, played"
          },
          "timestamp": {
            "type": "number"
          }
        },
        "required": [
          "messages",
          "conversation",
          "type",
          "timestamp"
        ]
      },
      "MessageAckEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "message.ack"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/MessageAckPayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ]
      },
      "MessageRevokedEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "message.revoked"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/MessagePayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ]
      },
      "MessageReactionEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "message.reaction"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/MessageReceivedPayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ]
      },
      "MessageEditedEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "message.edited"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/MessagePayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ]
      },
      "MessageUpdateEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "message.update"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/MessagePayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ]
      },
      "MessageDeletePayload": {
        "type": "object",
        "properties": {
          "from": {
            "$ref": "#/components/schemas/IdentityRef"
          },
          "sender": {
            "$ref": "#/components/schemas/IdentityRef"
          },
          "id": {
            "type": "string",
            "pattern": "^[1-9][0-9]{0,18}$",
            "description": "Opaque Polymorfa resource ID. Keep this value as a string.",
            "example": "739182640518203"
          },
          "whatsapp_id": {
            "type": "string",
            "minLength": 1
          },
          "conversation": {
            "$ref": "#/components/schemas/ConversationRef"
          },
          "fromMe": {
            "type": "boolean"
          }
        },
        "required": [
          "from",
          "sender",
          "id",
          "whatsapp_id",
          "conversation",
          "fromMe"
        ]
      },
      "MessageDeleteEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "message.delete"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/MessageDeletePayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ]
      },
      "PollVotePayload": {
        "type": "object",
        "properties": {
          "pollMessageId": {
            "type": "string",
            "pattern": "^[1-9][0-9]{0,18}$",
            "description": "Opaque Polymorfa resource ID. Keep this value as a string.",
            "example": "739182640518203"
          },
          "conversation": {
            "$ref": "#/components/schemas/ConversationRef"
          },
          "voter": {
            "$ref": "#/components/schemas/IdentityRef"
          },
          "selectedHashes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "timestamp": {
            "type": "number"
          }
        },
        "required": [
          "pollMessageId",
          "conversation",
          "voter",
          "selectedHashes",
          "timestamp"
        ]
      },
      "MessageVoteEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "message.vote"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/PollVotePayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ]
      },
      "SessionStatusPayload": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "Session status: CONNECTING, CONNECTED, DISCONNECTED",
            "example": "DISCONNECTED"
          },
          "statusReason": {
            "type": "string",
            "description": "Reason for the status: SCAN_QR, AUTO_RECONNECT, FAILED, MANUAL_STOP, QR_TIMEOUT, LOGGED_OUT, TEMPORARY_BAN, STREAM_ERROR",
            "example": "TEMPORARY_BAN"
          },
          "banCode": {
            "type": "integer",
            "minimum": 0,
            "description": "WhatsApp temporary-ban code (present only when statusReason is TEMPORARY_BAN).",
            "example": 101
          },
          "banReason": {
            "type": "string",
            "description": "Human-readable label for the ban code (present only when statusReason is TEMPORARY_BAN).",
            "example": "Suspected spam activity"
          },
          "banExpiresAt": {
            "type": "integer",
            "description": "Unix timestamp in seconds when the temporary ban lifts, when WhatsApp provides a duration.",
            "format": "int64",
            "example": 1789000000
          },
          "detail": {
            "type": "string",
            "description": "Extra context for FAILED and STREAM_ERROR statuses (for example the connect-failure reason)."
          }
        },
        "required": [
          "status"
        ]
      },
      "SessionStatusEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "session.status"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/SessionStatusPayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ]
      },
      "SessionConnectedPayload": {
        "type": "object",
        "properties": {
          "phoneNumber": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "pushName": {
            "type": "string"
          },
          "platform": {
            "type": "string"
          },
          "businessName": {
            "type": "string"
          }
        },
        "required": [
          "phoneNumber",
          "pushName",
          "platform"
        ]
      },
      "SessionConnectedEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "session.connected"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/SessionConnectedPayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ]
      },
      "SessionLoggedOutPayload": {
        "type": "object",
        "properties": {
          "reason": {
            "type": "string"
          }
        },
        "required": [
          "reason"
        ]
      },
      "SessionLoggedOutEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "session.logged_out"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/SessionLoggedOutPayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ]
      },
      "SessionPhoneOfflinePayload": {
        "type": "object",
        "properties": {
          "daysSinceLastSeen": {
            "type": "number",
            "description": "Whole days since the phone was last seen online.",
            "example": 11
          },
          "daysRemaining": {
            "type": "number",
            "description": "Days remaining before WhatsApp disconnects the session (clamped to 0). WhatsApp typically severs the companion link after ~14 days of phone inactivity.",
            "example": 3
          },
          "lastSeen": {
            "type": "string",
            "description": "ISO 8601 timestamp of the last time the phone was seen online.",
            "example": "2026-04-05T14:30:00Z"
          },
          "action": {
            "type": "string",
            "description": "Human-readable action string to surface to the end user (e.g. ask them to open WhatsApp on their phone).",
            "example": "Open WhatsApp on your phone to keep the session alive"
          }
        },
        "required": [
          "daysSinceLastSeen",
          "daysRemaining",
          "lastSeen",
          "action"
        ]
      },
      "SessionPhoneOfflineEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "session.phone_offline"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/SessionPhoneOfflinePayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ]
      },
      "GroupUpdatePayload": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "newSubject": {
            "type": "string"
          },
          "newDescription": {
            "type": "string"
          },
          "action": {
            "type": "string"
          }
        },
        "required": [
          "id"
        ]
      },
      "GroupUpdateEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "group.update"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/GroupUpdatePayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ]
      },
      "GroupParticipantPayload": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "joined": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IdentityRef"
            }
          },
          "left": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IdentityRef"
            }
          },
          "promoted": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IdentityRef"
            }
          },
          "demoted": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IdentityRef"
            }
          }
        },
        "required": [
          "id"
        ]
      },
      "GroupParticipantEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "group.participant"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/GroupParticipantPayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ]
      },
      "PresenceUpdatePayload": {
        "type": "object",
        "properties": {
          "observedAt": {
            "type": "integer"
          },
          "from": {
            "$ref": "#/components/schemas/IdentityRef"
          },
          "sender": {
            "$ref": "#/components/schemas/IdentityRef"
          },
          "state": {
            "type": "string"
          },
          "media": {
            "type": "string"
          },
          "unavailable": {
            "type": "boolean"
          },
          "lastSeen": {
            "type": "number"
          }
        },
        "required": [
          "observedAt"
        ]
      },
      "PresenceUpdateEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "presence.update"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/PresenceUpdatePayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ]
      },
      "ContactUpdatePayload": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[1-9][0-9]{0,18}$",
            "description": "Opaque Polymorfa resource ID. Keep this value as a string.",
            "example": "739182640518203"
          },
          "bsuid": {
            "type": "string"
          },
          "phoneNumber": {
            "type": "string"
          },
          "username": {
            "type": "string"
          },
          "fullName": {
            "type": "string"
          },
          "firstName": {
            "type": "string"
          },
          "pushName": {
            "type": "string"
          },
          "oldPushName": {
            "type": "string"
          },
          "businessName": {
            "type": "string"
          },
          "oldBusinessName": {
            "type": "string"
          },
          "pictureId": {
            "type": "string"
          },
          "pictureRemoved": {
            "type": "boolean"
          }
        },
        "required": [
          "id"
        ]
      },
      "ContactUpdateEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "contact.update"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/ContactUpdatePayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ]
      },
      "ChatArchivePayload": {
        "type": "object",
        "properties": {
          "from": {
            "$ref": "#/components/schemas/IdentityRef"
          },
          "archive": {
            "type": "boolean"
          },
          "pinned": {
            "type": "boolean"
          }
        },
        "required": [
          "from"
        ]
      },
      "ChatArchiveEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "chat.archive"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/ChatArchivePayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ]
      },
      "ChatMutePayload": {
        "type": "object",
        "properties": {
          "from": {
            "$ref": "#/components/schemas/IdentityRef"
          },
          "muted": {
            "type": "boolean"
          },
          "muteEndTimestamp": {
            "type": "number"
          }
        },
        "required": [
          "from",
          "muted"
        ]
      },
      "ChatMuteEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "chat.mute"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/ChatMutePayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ]
      },
      "ChatReadPayload": {
        "type": "object",
        "properties": {
          "from": {
            "$ref": "#/components/schemas/IdentityRef"
          },
          "read": {
            "type": "boolean"
          }
        },
        "required": [
          "from",
          "read"
        ]
      },
      "ChatReadEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "chat.read"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/ChatReadPayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ]
      },
      "ChatClearPayload": {
        "type": "object",
        "properties": {
          "from": {
            "$ref": "#/components/schemas/IdentityRef"
          }
        },
        "required": [
          "from"
        ]
      },
      "ChatClearEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "chat.clear"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/ChatClearPayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ]
      },
      "ChatDeletePayload": {
        "type": "object",
        "properties": {
          "from": {
            "$ref": "#/components/schemas/IdentityRef"
          }
        },
        "required": [
          "from"
        ]
      },
      "ChatDeleteEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "chat.delete"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/ChatDeletePayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ]
      },
      "CallReceivedPayload": {
        "type": "object",
        "properties": {
          "from": {
            "$ref": "#/components/schemas/IdentityRef"
          },
          "callId": {
            "type": "string"
          },
          "hasVideo": {
            "type": "boolean",
            "description": "Whether the offered call advertised video.",
            "example": false
          }
        },
        "required": [
          "from",
          "callId",
          "hasVideo"
        ]
      },
      "CallReceivedEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "call.received"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/CallReceivedPayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ]
      },
      "CallMissedPayload": {
        "type": "object",
        "properties": {
          "from": {
            "$ref": "#/components/schemas/IdentityRef"
          },
          "callId": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          }
        },
        "required": [
          "from",
          "callId",
          "reason"
        ]
      },
      "CallMissedEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "call.missed"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/CallMissedPayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ]
      },
      "CallAcceptedPayload": {
        "type": "object",
        "properties": {
          "from": {
            "$ref": "#/components/schemas/IdentityRef"
          },
          "callId": {
            "type": "string"
          }
        },
        "required": [
          "from",
          "callId"
        ]
      },
      "CallAcceptedEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "call.accepted"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/CallAcceptedPayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ]
      },
      "CallRejectedPayload": {
        "type": "object",
        "properties": {
          "from": {
            "$ref": "#/components/schemas/IdentityRef"
          },
          "callId": {
            "type": "string"
          }
        },
        "required": [
          "from",
          "callId"
        ]
      },
      "CallRejectedEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "call.rejected"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/CallRejectedPayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ]
      },
      "CallEndedPayload": {
        "type": "object",
        "properties": {
          "from": {
            "type": "object",
            "nullable": true,
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^[1-9][0-9]{0,18}$",
                "description": "Opaque Polymorfa resource ID. Keep this value as a string.",
                "example": "739182640518203"
              },
              "phoneNumber": {
                "type": "string"
              },
              "bsuid": {
                "type": "string"
              },
              "username": {
                "type": "string"
              }
            },
            "required": [
              "id"
            ]
          },
          "callId": {
            "type": "string"
          },
          "durationSeconds": {
            "type": "integer",
            "description": "Total connected duration in seconds (0 if never answered).",
            "example": 42
          },
          "reason": {
            "type": "string",
            "description": "Termination reason: user_hangup | timeout | lost_connection | rejected | capacity | pod_lost.",
            "example": "user_hangup"
          },
          "direction": {
            "type": "string",
            "enum": [
              "inbound",
              "outbound"
            ],
            "description": "Call direction.",
            "example": "inbound"
          },
          "hadVideo": {
            "type": "boolean",
            "description": "Whether the call carried video.",
            "example": false
          }
        },
        "required": [
          "from",
          "callId",
          "durationSeconds",
          "reason",
          "direction",
          "hadVideo"
        ]
      },
      "CallEndedEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "call.ended"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/CallEndedPayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ]
      },
      "CallTelemetryPayload": {
        "type": "object",
        "properties": {
          "callId": {
            "type": "string"
          },
          "setupMs": {
            "type": "integer",
            "description": "Time from offer to media_ready, in milliseconds.",
            "example": 850
          },
          "ringMs": {
            "type": "integer",
            "description": "Time spent ringing before accept, in milliseconds.",
            "example": 3200
          },
          "durationSeconds": {
            "type": "integer",
            "description": "Total connected duration in seconds.",
            "example": 42
          },
          "terminateReason": {
            "type": "string",
            "description": "Termination reason: user_hangup | timeout | lost_connection | rejected | capacity.",
            "example": "user_hangup"
          },
          "codec": {
            "type": "string",
            "description": "Negotiated audio codec's bare subtype; empty when no codec stats.",
            "example": "opus"
          },
          "jitterMs": {
            "type": "number",
            "description": "Inbound RTP jitter for the audio stream, in milliseconds.",
            "example": 12.5
          },
          "packetsLost": {
            "type": "integer",
            "description": "Cumulative inbound RTP packets lost for the audio stream.",
            "example": 3
          },
          "rttMs": {
            "type": "number",
            "description": "Estimated round-trip time from the remote-inbound report, in milliseconds.",
            "example": 48.2
          },
          "recvKbps": {
            "type": "number",
            "description": "Total inbound volume across all RTP streams, in kilobits (cumulative).",
            "example": 2048
          },
          "sendKbps": {
            "type": "number",
            "description": "Total outbound volume across all RTP streams, in kilobits (cumulative).",
            "example": 2011
          }
        },
        "required": [
          "callId",
          "setupMs",
          "ringMs",
          "durationSeconds",
          "terminateReason",
          "codec",
          "jitterMs",
          "packetsLost",
          "rttMs",
          "recvKbps",
          "sendKbps"
        ]
      },
      "CallTelemetryEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "call.telemetry"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/CallTelemetryPayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ]
      },
      "CallParticipant": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[1-9][0-9]{0,18}$",
            "description": "Opaque Polymorfa resource ID. Keep this value as a string.",
            "example": "739182640518203"
          },
          "phoneNumber": {
            "type": "string"
          },
          "bsuid": {
            "type": "string"
          },
          "username": {
            "type": "string"
          },
          "audioMuted": {
            "type": "boolean",
            "enum": [
              false
            ],
            "description": "Reserved; false until WhatsApp exposes authoritative participant mute state."
          },
          "video": {
            "type": "boolean",
            "enum": [
              false
            ],
            "description": "Reserved; false until WhatsApp exposes authoritative participant video state."
          },
          "state": {
            "type": "string",
            "enum": [
              "invited",
              "ringing",
              "connected",
              "left"
            ]
          }
        },
        "required": [
          "id",
          "audioMuted",
          "video",
          "state"
        ]
      },
      "CallParticipantPayload": {
        "type": "object",
        "properties": {
          "callId": {
            "type": "string"
          },
          "participant": {
            "$ref": "#/components/schemas/CallParticipant"
          }
        },
        "required": [
          "callId",
          "participant"
        ]
      },
      "CallParticipantJoinedEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "call.participant_joined"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/CallParticipantPayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ]
      },
      "CallParticipantStateEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "call.participant_state"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/CallParticipantPayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ]
      },
      "CallParticipantLeftPayload": {
        "type": "object",
        "properties": {
          "callId": {
            "type": "string"
          },
          "participantId": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          }
        },
        "required": [
          "callId",
          "participantId"
        ]
      },
      "CallParticipantLeftEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "call.participant_left"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/CallParticipantLeftPayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ]
      },
      "NewsletterUpdatePayload": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "action": {
            "type": "string"
          },
          "muted": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "action"
        ]
      },
      "NewsletterUpdateEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "newsletter.update"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/NewsletterUpdatePayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ]
      },
      "BlocklistChange": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[1-9][0-9]{0,18}$",
            "description": "Opaque Polymorfa resource ID. Keep this value as a string.",
            "example": "739182640518203"
          },
          "bsuid": {
            "type": "string"
          },
          "phoneNumber": {
            "type": "string"
          },
          "username": {
            "type": "string"
          },
          "action": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "action"
        ]
      },
      "BlocklistUpdatePayload": {
        "type": "object",
        "properties": {
          "action": {
            "type": "string"
          },
          "changes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BlocklistChange"
            }
          }
        },
        "required": [
          "action",
          "changes"
        ]
      },
      "BlocklistUpdateEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "blocklist.update"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/BlocklistUpdatePayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ]
      },
      "LabelsUpdatePayload": {
        "type": "object",
        "properties": {
          "action": {
            "type": "string",
            "description": "Action: label_edit, label_association_chat, label_association_message, star",
            "example": "label_edit"
          },
          "labelId": {
            "type": "string",
            "description": "Label ID affected by the action"
          },
          "from": {
            "allOf": [
              {
                "$ref": "#/components/schemas/IdentityRef"
              },
              {
                "description": "Chat the label action applies to"
              }
            ]
          },
          "label": {
            "type": "string",
            "description": "Legacy field: the label's display name for label_edit, and the label ID for association actions. Prefer labelId and name."
          },
          "name": {
            "type": "string",
            "description": "Label display name (present for label_edit)"
          },
          "color": {
            "type": "integer",
            "description": "Label color index (present for label_edit)",
            "format": "int32"
          },
          "orderIndex": {
            "type": "integer",
            "description": "Label ordering index when supplied by app state",
            "format": "int32"
          },
          "deleted": {
            "type": "boolean",
            "description": "Whether the label definition was deleted"
          },
          "labeled": {
            "type": "boolean",
            "description": "Whether the chat or message association is active"
          },
          "observedAt": {
            "type": "integer",
            "description": "Unix timestamp in seconds when the app-state mutation was observed",
            "format": "int64"
          },
          "messageId": {
            "type": "string",
            "pattern": "^[1-9][0-9]{0,18}$",
            "description": "Polymorfa message ID (present for star and message-association actions)",
            "example": "739182640518203"
          },
          "starred": {
            "type": "boolean",
            "description": "Whether the message is starred (present for star actions)"
          }
        },
        "required": [
          "action"
        ]
      },
      "LabelsUpdateEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "labels.update"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/LabelsUpdatePayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ]
      },
      "BusinessQuickReplyUpdatePayload": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "shortcut": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "keywords": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "count": {
            "type": "integer",
            "minimum": 0
          },
          "deleted": {
            "type": "boolean"
          },
          "associatedLabelIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "observedAt": {
            "type": "integer"
          },
          "fromFullSync": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "shortcut",
          "message",
          "keywords",
          "count",
          "deleted",
          "associatedLabelIds",
          "observedAt",
          "fromFullSync"
        ]
      },
      "BusinessQuickReplyUpdateEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "business.quick_reply.update"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/BusinessQuickReplyUpdatePayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ]
      },
      "ContactsSyncPayload": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "contacts"
            ]
          },
          "value": {
            "type": "object",
            "additionalProperties": {}
          }
        },
        "required": [
          "kind",
          "value"
        ]
      },
      "ContactsSyncEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "contact.sync"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/ContactsSyncPayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ]
      },
      "MessageEchoPayload": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string",
            "enum": [
              "whatsapp_business_app"
            ]
          },
          "value": {
            "type": "object",
            "additionalProperties": {}
          }
        },
        "required": [
          "source",
          "value"
        ]
      },
      "MessageEchoEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "message.echo"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/MessageEchoPayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ]
      },
      "LinkedHistorySyncPayload": {
        "type": "object",
        "properties": {
          "whatsapp_id": {
            "type": "string",
            "minLength": 1
          },
          "original_whatsapp_id": {
            "type": "string",
            "minLength": 1
          },
          "messages": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^[1-9][0-9]{0,18}$",
                  "description": "Opaque Polymorfa resource ID. Keep this value as a string.",
                  "example": "739182640518203"
                },
                "whatsapp_id": {
                  "type": "string",
                  "minLength": 1
                },
                "conversation": {
                  "$ref": "#/components/schemas/IdentityRef"
                },
                "fromMe": {
                  "type": "boolean"
                }
              },
              "required": [
                "id",
                "whatsapp_id",
                "conversation"
              ]
            }
          },
          "mode": {
            "type": "string",
            "enum": [
              "deliver"
            ]
          },
          "syncType": {
            "type": "string"
          },
          "chunkOrder": {
            "type": "integer",
            "minimum": 0
          },
          "progress": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "fileLength": {
            "type": "integer",
            "minimum": 0
          },
          "conversationCount": {
            "type": "integer",
            "minimum": 0
          },
          "messageCount": {
            "type": "integer",
            "minimum": 0
          },
          "pushNameCount": {
            "type": "integer",
            "minimum": 0
          },
          "statusMessageCount": {
            "type": "integer",
            "minimum": 0
          },
          "whatsapp": {
            "type": "object",
            "properties": {
              "encoding": {
                "type": "string",
                "enum": [
                  "gzip-base64-protobuf"
                ]
              },
              "data": {
                "type": "string"
              }
            },
            "required": [
              "encoding",
              "data"
            ],
            "description": "Unmodified provider archive. Its protobuf retains provider addresses; use messages for Polymorfa identities."
          }
        },
        "required": [
          "whatsapp_id",
          "messages",
          "mode",
          "syncType",
          "fileLength",
          "conversationCount",
          "messageCount",
          "pushNameCount",
          "statusMessageCount",
          "whatsapp"
        ]
      },
      "CloudHistorySyncPayload": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "history"
            ]
          },
          "value": {
            "type": "object",
            "additionalProperties": {}
          }
        },
        "required": [
          "kind",
          "value"
        ]
      },
      "HistorySyncPayload": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/LinkedHistorySyncPayload"
          },
          {
            "$ref": "#/components/schemas/CloudHistorySyncPayload"
          }
        ]
      },
      "HistorySyncEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "history.sync"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/HistorySyncPayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ]
      },
      "CommandResultPayload": {
        "type": "object",
        "properties": {
          "requestId": {
            "type": "string"
          },
          "command": {
            "type": "string"
          },
          "success": {
            "type": "boolean"
          },
          "data": {
            "type": "object",
            "additionalProperties": {}
          },
          "error": {
            "type": "string"
          }
        },
        "required": [
          "requestId",
          "command",
          "success"
        ]
      },
      "CommandResultEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "command.result"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/CommandResultPayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ]
      },
      "CustomerEnabledPayload": {
        "type": "object",
        "properties": {
          "eventId": {
            "type": "string",
            "format": "uuid"
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time"
          },
          "organizationId": {
            "type": "string",
            "format": "uuid"
          },
          "projectId": {
            "type": "string",
            "format": "uuid"
          },
          "customerId": {
            "type": "string",
            "format": "uuid"
          },
          "actorKind": {
            "type": "string",
            "enum": [
              "better_auth",
              "org_key",
              "project_token",
              "cli_grant",
              "system"
            ]
          },
          "migratedNumberCount": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "eventId",
          "occurredAt",
          "organizationId",
          "projectId",
          "customerId",
          "actorKind",
          "migratedNumberCount"
        ],
        "additionalProperties": false
      },
      "CustomerEnabledEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "customer.enabled"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/CustomerEnabledPayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ],
        "additionalProperties": false
      },
      "CustomerCreatedPayload": {
        "type": "object",
        "properties": {
          "eventId": {
            "type": "string",
            "format": "uuid"
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time"
          },
          "organizationId": {
            "type": "string",
            "format": "uuid"
          },
          "projectId": {
            "type": "string",
            "format": "uuid"
          },
          "customerId": {
            "type": "string",
            "format": "uuid"
          },
          "actorKind": {
            "type": "string",
            "enum": [
              "better_auth",
              "org_key",
              "project_token",
              "cli_grant",
              "system"
            ]
          }
        },
        "required": [
          "eventId",
          "occurredAt",
          "organizationId",
          "projectId",
          "customerId",
          "actorKind"
        ],
        "additionalProperties": false
      },
      "CustomerCreatedEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "customer.created"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/CustomerCreatedPayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ],
        "additionalProperties": false
      },
      "CustomerUpdatedPayload": {
        "type": "object",
        "properties": {
          "eventId": {
            "type": "string",
            "format": "uuid"
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time"
          },
          "organizationId": {
            "type": "string",
            "format": "uuid"
          },
          "projectId": {
            "type": "string",
            "format": "uuid"
          },
          "customerId": {
            "type": "string",
            "format": "uuid"
          },
          "actorKind": {
            "type": "string",
            "enum": [
              "better_auth",
              "org_key",
              "project_token",
              "cli_grant",
              "system"
            ]
          },
          "fields": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "name",
                "phone",
                "externalCustomerId"
              ]
            },
            "minItems": 1,
            "maxItems": 3
          }
        },
        "required": [
          "eventId",
          "occurredAt",
          "organizationId",
          "projectId",
          "customerId",
          "actorKind",
          "fields"
        ],
        "additionalProperties": false
      },
      "CustomerUpdatedEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "customer.updated"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/CustomerUpdatedPayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ],
        "additionalProperties": false
      },
      "CustomerArchivingPayload": {
        "type": "object",
        "properties": {
          "eventId": {
            "type": "string",
            "format": "uuid"
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time"
          },
          "organizationId": {
            "type": "string",
            "format": "uuid"
          },
          "projectId": {
            "type": "string",
            "format": "uuid"
          },
          "customerId": {
            "type": "string",
            "format": "uuid"
          },
          "actorKind": {
            "type": "string",
            "enum": [
              "better_auth",
              "org_key",
              "project_token",
              "cli_grant",
              "system"
            ]
          },
          "blockingNumberCount": {
            "type": "integer",
            "minimum": 0
          },
          "revokedPairingLinkCount": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "eventId",
          "occurredAt",
          "organizationId",
          "projectId",
          "customerId",
          "actorKind",
          "blockingNumberCount",
          "revokedPairingLinkCount"
        ],
        "additionalProperties": false
      },
      "CustomerArchivingEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "customer.archiving"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/CustomerArchivingPayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ],
        "additionalProperties": false
      },
      "CustomerArchivedPayload": {
        "type": "object",
        "properties": {
          "eventId": {
            "type": "string",
            "format": "uuid"
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time"
          },
          "organizationId": {
            "type": "string",
            "format": "uuid"
          },
          "projectId": {
            "type": "string",
            "format": "uuid"
          },
          "customerId": {
            "type": "string",
            "format": "uuid"
          },
          "actorKind": {
            "type": "string",
            "enum": [
              "better_auth",
              "org_key",
              "project_token",
              "cli_grant",
              "system"
            ]
          }
        },
        "required": [
          "eventId",
          "occurredAt",
          "organizationId",
          "projectId",
          "customerId",
          "actorKind"
        ],
        "additionalProperties": false
      },
      "CustomerArchivedEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "customer.archived"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/CustomerArchivedPayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ],
        "additionalProperties": false
      },
      "CustomerRestoredPayload": {
        "type": "object",
        "properties": {
          "eventId": {
            "type": "string",
            "format": "uuid"
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time"
          },
          "organizationId": {
            "type": "string",
            "format": "uuid"
          },
          "projectId": {
            "type": "string",
            "format": "uuid"
          },
          "customerId": {
            "type": "string",
            "format": "uuid"
          },
          "actorKind": {
            "type": "string",
            "enum": [
              "better_auth",
              "org_key",
              "project_token",
              "cli_grant",
              "system"
            ]
          }
        },
        "required": [
          "eventId",
          "occurredAt",
          "organizationId",
          "projectId",
          "customerId",
          "actorKind"
        ],
        "additionalProperties": false
      },
      "CustomerRestoredEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "customer.restored"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/CustomerRestoredPayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ],
        "additionalProperties": false
      },
      "CustomerPairingLinkCreatedPayload": {
        "type": "object",
        "properties": {
          "eventId": {
            "type": "string",
            "format": "uuid"
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time"
          },
          "organizationId": {
            "type": "string",
            "format": "uuid"
          },
          "projectId": {
            "type": "string",
            "format": "uuid"
          },
          "customerId": {
            "type": "string",
            "format": "uuid"
          },
          "actorKind": {
            "type": "string",
            "enum": [
              "better_auth",
              "org_key",
              "project_token",
              "cli_grant",
              "system"
            ]
          },
          "pairingLinkId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "eventId",
          "occurredAt",
          "organizationId",
          "projectId",
          "customerId",
          "actorKind",
          "pairingLinkId"
        ],
        "additionalProperties": false
      },
      "CustomerPairingLinkCreatedEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "customer.pairing_link.created"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/CustomerPairingLinkCreatedPayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ],
        "additionalProperties": false
      },
      "CustomerPairingLinkOpenedPayload": {
        "type": "object",
        "properties": {
          "eventId": {
            "type": "string",
            "format": "uuid"
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time"
          },
          "organizationId": {
            "type": "string",
            "format": "uuid"
          },
          "projectId": {
            "type": "string",
            "format": "uuid"
          },
          "customerId": {
            "type": "string",
            "format": "uuid"
          },
          "actorKind": {
            "type": "string",
            "enum": [
              "better_auth",
              "org_key",
              "project_token",
              "cli_grant",
              "system"
            ]
          },
          "pairingLinkId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "eventId",
          "occurredAt",
          "organizationId",
          "projectId",
          "customerId",
          "actorKind",
          "pairingLinkId"
        ],
        "additionalProperties": false
      },
      "CustomerPairingLinkOpenedEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "customer.pairing_link.opened"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/CustomerPairingLinkOpenedPayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ],
        "additionalProperties": false
      },
      "CustomerPairingLinkConnectedPayload": {
        "type": "object",
        "properties": {
          "eventId": {
            "type": "string",
            "format": "uuid"
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time"
          },
          "organizationId": {
            "type": "string",
            "format": "uuid"
          },
          "projectId": {
            "type": "string",
            "format": "uuid"
          },
          "customerId": {
            "type": "string",
            "format": "uuid"
          },
          "actorKind": {
            "type": "string",
            "enum": [
              "better_auth",
              "org_key",
              "project_token",
              "cli_grant",
              "system"
            ]
          },
          "pairingLinkId": {
            "type": "string",
            "format": "uuid"
          },
          "sessionId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "eventId",
          "occurredAt",
          "organizationId",
          "projectId",
          "customerId",
          "actorKind",
          "pairingLinkId",
          "sessionId"
        ],
        "additionalProperties": false
      },
      "CustomerPairingLinkConnectedEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "customer.pairing_link.connected"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/CustomerPairingLinkConnectedPayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ],
        "additionalProperties": false
      },
      "CustomerPairingLinkFailedPayload": {
        "type": "object",
        "properties": {
          "eventId": {
            "type": "string",
            "format": "uuid"
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time"
          },
          "organizationId": {
            "type": "string",
            "format": "uuid"
          },
          "projectId": {
            "type": "string",
            "format": "uuid"
          },
          "customerId": {
            "type": "string",
            "format": "uuid"
          },
          "actorKind": {
            "type": "string",
            "enum": [
              "better_auth",
              "org_key",
              "project_token",
              "cli_grant",
              "system"
            ]
          },
          "pairingLinkId": {
            "type": "string",
            "format": "uuid"
          },
          "errorCode": {
            "type": "string",
            "pattern": "^[a-z0-9_]{1,64}$"
          }
        },
        "required": [
          "eventId",
          "occurredAt",
          "organizationId",
          "projectId",
          "customerId",
          "actorKind",
          "pairingLinkId",
          "errorCode"
        ],
        "additionalProperties": false
      },
      "CustomerPairingLinkFailedEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "customer.pairing_link.failed"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/CustomerPairingLinkFailedPayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ],
        "additionalProperties": false
      },
      "CustomerPairingLinkExpiredPayload": {
        "type": "object",
        "properties": {
          "eventId": {
            "type": "string",
            "format": "uuid"
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time"
          },
          "organizationId": {
            "type": "string",
            "format": "uuid"
          },
          "projectId": {
            "type": "string",
            "format": "uuid"
          },
          "customerId": {
            "type": "string",
            "format": "uuid"
          },
          "actorKind": {
            "type": "string",
            "enum": [
              "better_auth",
              "org_key",
              "project_token",
              "cli_grant",
              "system"
            ]
          },
          "pairingLinkId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "eventId",
          "occurredAt",
          "organizationId",
          "projectId",
          "customerId",
          "actorKind",
          "pairingLinkId"
        ],
        "additionalProperties": false
      },
      "CustomerPairingLinkExpiredEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "customer.pairing_link.expired"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/CustomerPairingLinkExpiredPayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ],
        "additionalProperties": false
      },
      "CustomerPairingLinkRevokedPayload": {
        "type": "object",
        "properties": {
          "eventId": {
            "type": "string",
            "format": "uuid"
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time"
          },
          "organizationId": {
            "type": "string",
            "format": "uuid"
          },
          "projectId": {
            "type": "string",
            "format": "uuid"
          },
          "customerId": {
            "type": "string",
            "format": "uuid"
          },
          "actorKind": {
            "type": "string",
            "enum": [
              "better_auth",
              "org_key",
              "project_token",
              "cli_grant",
              "system"
            ]
          },
          "pairingLinkId": {
            "type": "string",
            "format": "uuid"
          },
          "reason": {
            "type": "string",
            "enum": [
              "customer_archived",
              "phone_mismatch_limit",
              "exchange_failure_limit",
              "terminal_failure"
            ]
          }
        },
        "required": [
          "eventId",
          "occurredAt",
          "organizationId",
          "projectId",
          "customerId",
          "actorKind",
          "pairingLinkId"
        ],
        "additionalProperties": false
      },
      "CustomerPairingLinkRevokedEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "customer.pairing_link.revoked"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/CustomerPairingLinkRevokedPayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ],
        "additionalProperties": false
      },
      "CustomerNumberAttachedPayload": {
        "type": "object",
        "properties": {
          "eventId": {
            "type": "string",
            "format": "uuid"
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time"
          },
          "organizationId": {
            "type": "string",
            "format": "uuid"
          },
          "projectId": {
            "type": "string",
            "format": "uuid"
          },
          "customerId": {
            "type": "string",
            "format": "uuid"
          },
          "actorKind": {
            "type": "string",
            "enum": [
              "better_auth",
              "org_key",
              "project_token",
              "cli_grant",
              "system"
            ]
          },
          "sessionId": {
            "type": "string",
            "format": "uuid"
          },
          "pairingLinkId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "eventId",
          "occurredAt",
          "organizationId",
          "projectId",
          "customerId",
          "actorKind",
          "sessionId"
        ],
        "additionalProperties": false
      },
      "CustomerNumberAttachedEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "customer.number.attached"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/CustomerNumberAttachedPayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ],
        "additionalProperties": false
      },
      "CustomerNumberTransferredPayload": {
        "type": "object",
        "properties": {
          "eventId": {
            "type": "string",
            "format": "uuid"
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time"
          },
          "organizationId": {
            "type": "string",
            "format": "uuid"
          },
          "projectId": {
            "type": "string",
            "format": "uuid"
          },
          "customerId": {
            "type": "string",
            "format": "uuid"
          },
          "actorKind": {
            "type": "string",
            "enum": [
              "better_auth",
              "org_key",
              "project_token",
              "cli_grant",
              "system"
            ]
          },
          "sessionId": {
            "type": "string",
            "format": "uuid"
          },
          "sourceCustomerId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "eventId",
          "occurredAt",
          "organizationId",
          "projectId",
          "customerId",
          "actorKind",
          "sessionId",
          "sourceCustomerId"
        ],
        "additionalProperties": false
      },
      "CustomerNumberTransferredEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "customer.number.transferred"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/CustomerNumberTransferredPayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ],
        "additionalProperties": false
      },
      "CustomerNumberDisconnectedPayload": {
        "type": "object",
        "properties": {
          "eventId": {
            "type": "string",
            "format": "uuid"
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time"
          },
          "organizationId": {
            "type": "string",
            "format": "uuid"
          },
          "projectId": {
            "type": "string",
            "format": "uuid"
          },
          "customerId": {
            "type": "string",
            "format": "uuid"
          },
          "actorKind": {
            "type": "string",
            "enum": [
              "better_auth",
              "org_key",
              "project_token",
              "cli_grant",
              "system"
            ]
          },
          "sessionId": {
            "type": "string",
            "format": "uuid"
          },
          "reason": {
            "type": "string",
            "pattern": "^[a-z0-9_]{1,64}$"
          }
        },
        "required": [
          "eventId",
          "occurredAt",
          "organizationId",
          "projectId",
          "customerId",
          "actorKind",
          "sessionId",
          "reason"
        ],
        "additionalProperties": false
      },
      "CustomerNumberDisconnectedEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "customer.number.disconnected"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/CustomerNumberDisconnectedPayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ],
        "additionalProperties": false
      },
      "BanSafeEnforcementPayload": {
        "type": "object",
        "properties": {
          "phoneNumber": {
            "type": "string",
            "pattern": "^\\+[1-9]\\d{1,14}$",
            "description": "The customer's own number in E.164 format.",
            "example": "+15551234567"
          },
          "kind": {
            "type": "string",
            "enum": [
              "cap_warning",
              "cap_reached",
              "timelock",
              "temporary_ban",
              "permanent_ban",
              "connect_blocked",
              "customer_report"
            ],
            "description": "Enforcement outcome, or customer_report for a customer-reported ban."
          },
          "source": {
            "type": "string",
            "enum": [
              "runtime",
              "customer"
            ],
            "description": "Whether Polymorfa observed the enforcement or the customer reported it."
          },
          "code": {
            "type": "integer",
            "minimum": 0,
            "description": "WhatsApp status code (for example 402, 403, 406, 475) when observed.",
            "example": 402
          },
          "subCode": {
            "type": "integer",
            "minimum": 0,
            "description": "WhatsApp sub-code (101-106 for temporary bans) when provided.",
            "example": 101
          },
          "reason": {
            "type": "string",
            "maxLength": 200,
            "description": "Sanitised reason from the WhatsApp code table.",
            "example": "Suspected spam activity"
          },
          "enforcementType": {
            "type": "string",
            "maxLength": 64,
            "description": "WhatsApp enforcement type (for example BIZ_QUALITY) when provided."
          },
          "startedAt": {
            "type": "string",
            "format": "date-time",
            "description": "ISO 8601 timestamp when the enforcement started.",
            "example": "2026-09-06T14:03:12.000Z"
          },
          "endsAt": {
            "type": "string",
            "format": "date-time",
            "description": "ISO 8601 timestamp when the enforcement lifts, when WhatsApp provides a duration.",
            "example": "2026-09-07T14:03:12.000Z"
          }
        },
        "required": [
          "phoneNumber",
          "kind",
          "source",
          "startedAt"
        ],
        "additionalProperties": false
      },
      "BanSafeEnforcementEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "bansafe.enforcement"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/BanSafeEnforcementPayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ],
        "additionalProperties": false
      },
      "BanSafeRequiredFinding": {
        "type": "object",
        "properties": {
          "findingKey": {
            "type": "string",
            "pattern": "^[a-z0-9_]{1,64}$",
            "description": "Stable finding identifier.",
            "example": "typing_absent"
          },
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160,
            "description": "Customer-facing finding title.",
            "example": "Messages sent without showing that you are typing"
          },
          "severity": {
            "type": "string",
            "enum": [
              "info",
              "warning",
              "critical"
            ]
          }
        },
        "required": [
          "findingKey",
          "title",
          "severity"
        ],
        "additionalProperties": false
      },
      "BanSafeActionPayload": {
        "type": "object",
        "properties": {
          "phoneNumber": {
            "type": "string",
            "pattern": "^\\+[1-9]\\d{1,14}$",
            "description": "The customer's own number in E.164 format.",
            "example": "+15551234567"
          },
          "action": {
            "type": "string",
            "enum": [
              "applied",
              "changed",
              "lifted",
              "daily_allowance_reached"
            ],
            "description": "Whether the restriction was newly applied, moved, or removed. `daily_allowance_reached` reports that the number spent its warm-up allowance for the day; nothing on the ladder moved and sending resumes at the next reset."
          },
          "scope": {
            "type": "string",
            "enum": [
              "number",
              "organization"
            ],
            "description": "Whether this covers one number or every number in the workspace."
          },
          "rung": {
            "type": "string",
            "enum": [
              "none",
              "notify",
              "throttle",
              "block_cold",
              "suspend"
            ],
            "description": "Restriction now in force."
          },
          "previousRung": {
            "type": "string",
            "nullable": true,
            "enum": [
              "none",
              "notify",
              "throttle",
              "block_cold",
              "suspend",
              null
            ],
            "description": "Restriction previously in force, or null when none was."
          },
          "reason": {
            "type": "string",
            "enum": [
              "health",
              "finding",
              "org_pattern",
              "repeat",
              "restriction",
              "operator",
              "health_model_cutover",
              "warmup"
            ],
            "description": "Why the restriction changed."
          },
          "health": {
            "type": "integer",
            "nullable": true,
            "minimum": 0,
            "maximum": 100,
            "description": "Measured health from 0 (worst) to 100 (best), or null when not measured.",
            "example": 62
          },
          "healthBand": {
            "type": "string",
            "enum": [
              "good",
              "fair",
              "poor",
              "failing",
              "unknown"
            ],
            "description": "Health band matching health."
          },
          "requires": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BanSafeRequiredFinding"
            },
            "maxItems": 25,
            "description": "Findings that must resolve before this restriction lifts."
          },
          "throughputPerMinute": {
            "type": "integer",
            "nullable": true,
            "minimum": 0,
            "maximum": 10000,
            "description": "Messages per minute allowed while paced, or null when not paced.",
            "example": 6
          },
          "eligibleLiftAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time",
            "description": "Earliest instant the restriction can step down, ISO 8601.",
            "example": "2026-09-08T14:00:00.000Z"
          },
          "liftRequires": {
            "type": "string",
            "minLength": 1,
            "maxLength": 240,
            "description": "One sentence describing what lifts the restriction.",
            "example": "Resolve the two open checks and keep them clean for six evaluations."
          },
          "appealUrl": {
            "type": "string",
            "maxLength": 500,
            "format": "uri",
            "description": "Where to appeal this action.",
            "example": "https://app.polymorfa.com/safety/appeal"
          },
          "startedAt": {
            "type": "string",
            "format": "date-time",
            "description": "ISO 8601 timestamp when this restriction took effect.",
            "example": "2026-09-06T14:00:00.000Z"
          },
          "docs": {
            "type": "string",
            "maxLength": 500,
            "format": "uri",
            "description": "Documentation for this restriction.",
            "example": "https://docs.polymorfa.com/safety/restrictions"
          }
        },
        "required": [
          "phoneNumber",
          "action",
          "scope",
          "rung",
          "previousRung",
          "reason",
          "health",
          "healthBand",
          "requires",
          "throughputPerMinute",
          "eligibleLiftAt",
          "liftRequires",
          "appealUrl",
          "startedAt",
          "docs"
        ],
        "additionalProperties": false
      },
      "BanSafeActionEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "bansafe.action"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/BanSafeActionPayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ],
        "additionalProperties": false
      },
      "BanSafeHealthThresholdPayload": {
        "type": "object",
        "properties": {
          "sessionId": {
            "type": "string",
            "format": "uuid",
            "description": "Session whose present Health crossed the project threshold."
          },
          "projectId": {
            "type": "string",
            "format": "uuid",
            "description": "Project whose Health rule produced this action."
          },
          "health": {
            "type": "number",
            "minimum": 0,
            "maximum": 100,
            "description": "Present Health; higher is healthier."
          },
          "threshold": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100,
            "description": "Configured project threshold crossed by this evaluation."
          },
          "healthSource": {
            "type": "string",
            "enum": [
              "rules_v1",
              "ml_model"
            ],
            "description": "Estimator family used by the evaluation."
          },
          "estimatorVersion": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "Estimator version used by the evaluation."
          },
          "modelVersion": {
            "type": "string",
            "nullable": true,
            "minLength": 1,
            "maxLength": 128,
            "description": "Learned-model version, or null for a rules-based estimate."
          },
          "evaluatedAt": {
            "type": "string",
            "format": "date-time",
            "description": "Evaluation time in ISO 8601 format."
          },
          "policyVersion": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991,
            "description": "Project Health rule version evaluated."
          },
          "episodeId": {
            "type": "string",
            "format": "uuid",
            "description": "Stable below-threshold episode identifier."
          },
          "actionId": {
            "type": "string",
            "format": "uuid",
            "description": "Stable event identity used for retries."
          }
        },
        "required": [
          "sessionId",
          "projectId",
          "health",
          "threshold",
          "healthSource",
          "estimatorVersion",
          "modelVersion",
          "evaluatedAt",
          "policyVersion",
          "episodeId",
          "actionId"
        ],
        "additionalProperties": false
      },
      "BanSafeHealthThresholdEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "bansafe.health_threshold"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/BanSafeHealthThresholdPayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ],
        "additionalProperties": false
      },
      "BanSafeIncidentPayload": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Incident id. Stable, quotable, and the subject of a Ban Insurance claim.",
            "example": "01936b2e-5f2a-7c1d-9a3e-8b4c2d1e0f11"
          },
          "phoneNumber": {
            "type": "string",
            "pattern": "^\\+[1-9]\\d{1,14}$",
            "description": "The customer's own number in E.164 format.",
            "example": "+15551234567"
          },
          "kind": {
            "type": "string",
            "enum": [
              "cap_warning",
              "cap_reached",
              "timelock",
              "temporary_ban",
              "permanent_ban",
              "connect_blocked",
              "customer_report"
            ],
            "description": "What WhatsApp did, or customer_report when you reported it."
          },
          "source": {
            "type": "string",
            "enum": [
              "runtime",
              "customer"
            ],
            "description": "Whether Polymorfa observed it or you reported it."
          },
          "startedAt": {
            "type": "string",
            "format": "date-time",
            "description": "ISO 8601 timestamp when the restriction started.",
            "example": "2026-09-06T14:03:12.000Z"
          },
          "endsAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time",
            "description": "ISO 8601 timestamp when the restriction ends, or null when it has no end. A ban you report ends 24 hours after the time you give unless you report it again or Polymorfa observes the restriction itself.",
            "example": "2026-09-07T14:03:12.000Z"
          },
          "belief": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "description": "How confident Polymorfa is that this restriction was real, from 0 to 1. A restriction WhatsApp announced is 1. A ban you report starts at 0.9 and moves once the number's own sending shows whether it was restricted.",
            "example": 1
          },
          "resolution": {
            "type": "string",
            "enum": [
              "open",
              "corroborated",
              "contradicted",
              "phone_switch",
              "final"
            ],
            "description": "How the incident settled. open: still being decided. corroborated: a report and an observed restriction agree. contradicted: the number kept sending, so there was no restriction. phone_switch: the number moved to another phone. final: settled with the confidence shown."
          },
          "claimId": {
            "type": "string",
            "nullable": true,
            "description": "The Ban Insurance claim this incident belongs to, or null when there is none.",
            "example": null
          },
          "closedAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time",
            "description": "ISO 8601 timestamp when you closed or retracted the report, or null.",
            "example": null
          }
        },
        "required": [
          "id",
          "phoneNumber",
          "kind",
          "source",
          "startedAt",
          "endsAt",
          "belief",
          "resolution",
          "claimId",
          "closedAt"
        ],
        "additionalProperties": false
      },
      "BanSafeIncidentEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "bansafe.incident"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/BanSafeIncidentPayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ],
        "additionalProperties": false
      },
      "BanSafeClaimPayload": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Claim id. Stable and quotable.",
            "example": "01936b2e-5f2a-7c1d-9a3e-8b4c2d1e0f22"
          },
          "incidentId": {
            "type": "string",
            "description": "The incident this claim was filed against.",
            "example": "01936b2e-5f2a-7c1d-9a3e-8b4c2d1e0f11"
          },
          "phoneNumber": {
            "type": "string",
            "pattern": "^\\+[1-9]\\d{1,14}$",
            "description": "The customer's own number in E.164 format.",
            "example": "+15551234567"
          },
          "status": {
            "type": "string",
            "enum": [
              "filed",
              "under_review",
              "approved",
              "denied",
              "paid",
              "reversed"
            ],
            "description": "Where the claim sits. filed and under_review are open. approved means it was accepted, and with a zero amount that there was nothing to return. paid means the credits are on your balance. reversed means what Polymorfa knew about the ban changed afterwards and the credits were taken back."
          },
          "verdict": {
            "type": "string",
            "enum": [
              "other_device",
              "customer_conduct",
              "shared_network",
              "ours",
              "inconclusive"
            ],
            "description": "What the ban was attributed to. other_device: another device on the account was sending. customer_conduct: Polymorfa was already restricting this number, or named the same serious problem for a week. shared_network: the number shared its connection with numbers that were being restricted. ours: nothing points at how the number was used. inconclusive: Polymorfa could not see enough of the window to say."
          },
          "windowStart": {
            "type": "string",
            "format": "date-time",
            "description": "ISO 8601 start of the 30 days the refund covers.",
            "example": "2026-08-07T14:03:12.000Z"
          },
          "windowEnd": {
            "type": "string",
            "format": "date-time",
            "description": "ISO 8601 end of the window: the moment the ban started.",
            "example": "2026-09-06T14:03:12.000Z"
          },
          "measuredCents": {
            "type": "integer",
            "minimum": 0,
            "description": "Credits this number consumed inside the window, in cents.",
            "example": 1080
          },
          "capCents": {
            "type": "integer",
            "minimum": 0,
            "description": "The most a claim on this number's plan can return, in cents.",
            "example": 1080
          },
          "amountCents": {
            "type": "integer",
            "minimum": 0,
            "description": "What this claim returns, in cents.",
            "example": 1080
          },
          "summary": {
            "type": "string",
            "description": "One sentence describing the claim's state."
          },
          "reason": {
            "type": "string",
            "description": "One sentence describing what the ban was attributed to."
          },
          "decidedAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time",
            "description": "ISO 8601 timestamp of the decision, or null while none was taken.",
            "example": null
          },
          "paidAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time",
            "description": "ISO 8601 timestamp the credits landed, or null.",
            "example": null
          }
        },
        "required": [
          "id",
          "incidentId",
          "phoneNumber",
          "status",
          "verdict",
          "windowStart",
          "windowEnd",
          "measuredCents",
          "capCents",
          "amountCents",
          "summary",
          "reason",
          "decidedAt",
          "paidAt"
        ],
        "additionalProperties": false
      },
      "BanSafeClaimEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "bansafe.claim"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/BanSafeClaimPayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ],
        "additionalProperties": false
      },
      "MessageFailedPayload": {
        "type": "object",
        "properties": {
          "to": {
            "allOf": [
              {
                "$ref": "#/components/schemas/IdentityRef"
              },
              {
                "description": "Recipient chat the send was attempted to"
              }
            ]
          },
          "type": {
            "type": "string",
            "description": "Type of the attempted message (text, image, ...)",
            "example": "text"
          },
          "error": {
            "type": "string",
            "enum": [
              "invalid_recipient",
              "session_not_connected",
              "ack_timeout",
              "send_failed",
              "blocked_by_safety"
            ],
            "description": "Sanitized failure class",
            "example": "send_failed"
          },
          "code": {
            "type": "string",
            "description": "Stable machine-readable code from the API error envelope, present for classified safety refusals and an unknown send outcome",
            "example": "bansafe_cold_blocked"
          },
          "retryAfter": {
            "type": "integer",
            "minimum": 0,
            "exclusiveMinimum": true,
            "description": "Whole seconds to wait before retrying a paced send, exhausted allowance, or temporary allowance-accounting pause",
            "example": 5
          },
          "timestamp": {
            "type": "integer",
            "minimum": 0,
            "description": "Unix timestamp in seconds when the failure occurred",
            "example": 1757161200
          }
        },
        "required": [
          "to",
          "type",
          "error",
          "timestamp"
        ]
      },
      "MessageFailedEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "message.failed"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/MessageFailedPayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ]
      },
      "TemplateStatusPayload": {
        "type": "object",
        "properties": {
          "templateName": {
            "type": "string",
            "description": "Template name as registered with Meta",
            "example": "order_update"
          },
          "templateId": {
            "type": "string",
            "description": "Meta template id",
            "example": "1234567890"
          },
          "status": {
            "type": "string",
            "description": "New approval status: APPROVED, REJECTED, PAUSED, DISABLED, DELETED",
            "example": "APPROVED"
          },
          "category": {
            "type": "string",
            "description": "Template category (MARKETING, UTILITY, AUTHENTICATION)",
            "example": "UTILITY"
          },
          "reason": {
            "type": "string",
            "description": "Reason for the status change; empty unless REJECTED, PAUSED or DISABLED",
            "example": ""
          },
          "qualityRating": {
            "type": "string",
            "description": "Quality rating bucket reported by Meta (GREEN, YELLOW, RED)",
            "example": "GREEN"
          }
        },
        "required": [
          "templateName",
          "templateId",
          "status",
          "category",
          "reason",
          "qualityRating"
        ]
      },
      "TemplateStatusEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "template.status"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/TemplateStatusPayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ]
      },
      "CampaignPausedPayload": {
        "type": "object",
        "properties": {
          "campaignId": {
            "type": "string",
            "description": "Campaign id",
            "example": "01936b2e-5f2a-7c1d-9a3e-8b4c2d1e0f11"
          },
          "sentCount": {
            "type": "integer",
            "minimum": 0,
            "description": "Recipients sent so far"
          },
          "remainingCount": {
            "type": "integer",
            "minimum": 0,
            "description": "Recipients still queued"
          },
          "pausedAt": {
            "type": "integer",
            "minimum": 0,
            "description": "Unix timestamp in seconds when the campaign paused",
            "example": 1757161200
          }
        },
        "required": [
          "campaignId",
          "sentCount",
          "remainingCount",
          "pausedAt"
        ]
      },
      "CampaignPausedEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "campaign.paused"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/CampaignPausedPayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ]
      },
      "CampaignCompletedPayload": {
        "type": "object",
        "properties": {
          "campaignId": {
            "type": "string",
            "description": "Campaign id",
            "example": "01936b2e-5f2a-7c1d-9a3e-8b4c2d1e0f11"
          },
          "sentCount": {
            "type": "integer",
            "minimum": 0
          },
          "deliveredCount": {
            "type": "integer",
            "minimum": 0
          },
          "readCount": {
            "type": "integer",
            "minimum": 0
          },
          "failedCount": {
            "type": "integer",
            "minimum": 0
          },
          "skippedCount": {
            "type": "integer",
            "minimum": 0
          },
          "responseCount": {
            "type": "integer",
            "minimum": 0
          },
          "completedAt": {
            "type": "integer",
            "minimum": 0,
            "description": "Unix timestamp in seconds when the last recipient settled",
            "example": 1757161200
          },
          "durationMs": {
            "type": "integer",
            "minimum": 0,
            "description": "Wall-clock duration from launch to completion, in milliseconds"
          }
        },
        "required": [
          "campaignId",
          "sentCount",
          "deliveredCount",
          "readCount",
          "failedCount",
          "skippedCount",
          "responseCount",
          "completedAt",
          "durationMs"
        ]
      },
      "CampaignCompletedEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "campaign.completed"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/CampaignCompletedPayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ]
      },
      "CampaignFailedPayload": {
        "type": "object",
        "properties": {
          "campaignId": {
            "type": "string",
            "description": "Campaign id",
            "example": "01936b2e-5f2a-7c1d-9a3e-8b4c2d1e0f11"
          },
          "reason": {
            "type": "string",
            "description": "Stable reason the campaign failed",
            "example": "no_eligible_numbers"
          },
          "failedAt": {
            "type": "integer",
            "minimum": 0,
            "description": "Unix timestamp in seconds when the campaign failed",
            "example": 1757161200
          }
        },
        "required": [
          "campaignId",
          "reason",
          "failedAt"
        ]
      },
      "CampaignFailedEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "campaign.failed"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/CampaignFailedPayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ]
      },
      "CampaignRecipientSentPayload": {
        "type": "object",
        "properties": {
          "campaignId": {
            "type": "string",
            "description": "Campaign id",
            "example": "01936b2e-5f2a-7c1d-9a3e-8b4c2d1e0f11"
          },
          "recipientId": {
            "type": "string",
            "description": "Campaign recipient id",
            "example": "01936b2e-6a11-7d2e-8f4a-1c2b3d4e5f66"
          },
          "phone": {
            "type": "string",
            "description": "Recipient phone number in E.164",
            "example": "+14155550123"
          },
          "sessionKey": {
            "type": "string",
            "description": "Sending number's session key",
            "example": "sales-1"
          },
          "externalMessageId": {
            "type": "string",
            "description": "WhatsApp message id of the delivered send",
            "example": "3EB0A1B2C3D4E5F60718"
          },
          "variantKey": {
            "type": "string",
            "description": "Content variant used for this recipient",
            "example": "v1"
          },
          "attempt": {
            "type": "integer",
            "minimum": 0,
            "exclusiveMinimum": true,
            "description": "Attempt number that succeeded",
            "example": 1
          }
        },
        "required": [
          "campaignId",
          "recipientId",
          "phone",
          "sessionKey",
          "externalMessageId",
          "variantKey",
          "attempt"
        ]
      },
      "CampaignRecipientSentEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "campaign.recipient_sent"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/CampaignRecipientSentPayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ]
      },
      "CampaignRecipientFailedPayload": {
        "type": "object",
        "properties": {
          "campaignId": {
            "type": "string",
            "description": "Campaign id",
            "example": "01936b2e-5f2a-7c1d-9a3e-8b4c2d1e0f11"
          },
          "recipientId": {
            "type": "string",
            "description": "Campaign recipient id",
            "example": "01936b2e-6a11-7d2e-8f4a-1c2b3d4e5f66"
          },
          "phone": {
            "type": "string",
            "description": "Recipient phone number in E.164",
            "example": "+14155550123"
          },
          "attempts": {
            "type": "integer",
            "minimum": 0,
            "description": "Attempts made before giving up"
          },
          "error": {
            "type": "string",
            "description": "Sanitized failure class or stable code",
            "example": "ack_timeout"
          },
          "failedAt": {
            "type": "integer",
            "minimum": 0,
            "description": "Unix timestamp in seconds when the recipient was marked failed",
            "example": 1757161200
          }
        },
        "required": [
          "campaignId",
          "recipientId",
          "phone",
          "attempts",
          "error",
          "failedAt"
        ]
      },
      "CampaignRecipientFailedEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "campaign.recipient_failed"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/CampaignRecipientFailedPayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ]
      },
      "CampaignRecipientSkippedPayload": {
        "type": "object",
        "properties": {
          "campaignId": {
            "type": "string",
            "description": "Campaign id",
            "example": "01936b2e-5f2a-7c1d-9a3e-8b4c2d1e0f11"
          },
          "recipientId": {
            "type": "string",
            "description": "Campaign recipient id",
            "example": "01936b2e-6a11-7d2e-8f4a-1c2b3d4e5f66"
          },
          "phone": {
            "type": "string",
            "description": "Recipient phone number in E.164",
            "example": "+14155550123"
          },
          "reason": {
            "type": "string",
            "description": "Stable skip reason (skipped-optout, skipped-error, skipped-cold)",
            "example": "skipped-cold"
          },
          "skippedAt": {
            "type": "integer",
            "minimum": 0,
            "description": "Unix timestamp in seconds when the recipient was skipped",
            "example": 1757161200
          }
        },
        "required": [
          "campaignId",
          "recipientId",
          "phone",
          "reason",
          "skippedAt"
        ]
      },
      "CampaignRecipientSkippedEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "campaign.recipient_skipped"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/CampaignRecipientSkippedPayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ]
      },
      "CampaignThrottledPayload": {
        "type": "object",
        "properties": {
          "campaignId": {
            "type": "string",
            "description": "Campaign id",
            "example": "01936b2e-5f2a-7c1d-9a3e-8b4c2d1e0f11"
          },
          "sessionKey": {
            "type": "string",
            "description": "Sending number's session key",
            "example": "sales-1"
          },
          "reason": {
            "type": "string",
            "description": "Why sending was paced",
            "example": "bansafe_throttled"
          },
          "deferredCount": {
            "type": "integer",
            "minimum": 0,
            "description": "Recipients deferred in this pass"
          },
          "at": {
            "type": "integer",
            "minimum": 0,
            "description": "Unix timestamp in seconds of the pacing decision",
            "example": 1757161200
          }
        },
        "required": [
          "campaignId",
          "sessionKey",
          "reason",
          "deferredCount",
          "at"
        ]
      },
      "CampaignThrottledEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "campaign.throttled"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/CampaignThrottledPayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ]
      },
      "CampaignCapReachedPayload": {
        "type": "object",
        "properties": {
          "campaignId": {
            "type": "string",
            "description": "Campaign id",
            "example": "01936b2e-5f2a-7c1d-9a3e-8b4c2d1e0f11"
          },
          "sessionKey": {
            "type": "string",
            "description": "Sending number's session key",
            "example": "sales-1"
          },
          "phone": {
            "type": "string",
            "description": "Sending number in E.164",
            "example": "+14155550100"
          },
          "capType": {
            "type": "string",
            "description": "Which cap was reached: hourly or daily",
            "example": "daily"
          },
          "capLimit": {
            "type": "integer",
            "minimum": 0,
            "description": "The cap that was reached"
          },
          "windowResetsAt": {
            "type": "integer",
            "minimum": 0,
            "description": "Unix timestamp in seconds when the cap window resets",
            "example": 1757161200
          },
          "at": {
            "type": "integer",
            "minimum": 0,
            "description": "Unix timestamp in seconds of the decision",
            "example": 1757161200
          }
        },
        "required": [
          "campaignId",
          "sessionKey",
          "phone",
          "capType",
          "capLimit",
          "windowResetsAt",
          "at"
        ]
      },
      "CampaignCapReachedEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "campaign.cap_reached"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/CampaignCapReachedPayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ]
      },
      "CampaignColdBlockedPayload": {
        "type": "object",
        "properties": {
          "campaignId": {
            "type": "string",
            "description": "Campaign id",
            "example": "01936b2e-5f2a-7c1d-9a3e-8b4c2d1e0f11"
          },
          "recipientId": {
            "type": "string",
            "description": "Campaign recipient id",
            "example": "01936b2e-6a11-7d2e-8f4a-1c2b3d4e5f66"
          },
          "phone": {
            "type": "string",
            "description": "Recipient phone number in E.164",
            "example": "+14155550123"
          },
          "surface": {
            "type": "string",
            "description": "Campaign surface",
            "example": "whatsapp"
          },
          "reason": {
            "type": "string",
            "description": "Stable hold reason",
            "example": "bansafe_cold_held"
          },
          "at": {
            "type": "integer",
            "minimum": 0,
            "description": "Unix timestamp in seconds when the recipient was held",
            "example": 1757161200
          }
        },
        "required": [
          "campaignId",
          "recipientId",
          "phone",
          "surface",
          "reason",
          "at"
        ]
      },
      "CampaignColdBlockedEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event identifier"
          },
          "session": {
            "type": "string",
            "description": "Session that produced this event"
          },
          "externalId": {
            "type": "string",
            "description": "Integrator reference from the QuickLink that created this session. Included on session lifecycle events when supplied."
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp"
          },
          "event": {
            "type": "string",
            "enum": [
              "campaign.cold_blocked"
            ],
            "description": "Event type"
          },
          "payload": {
            "$ref": "#/components/schemas/CampaignColdBlockedPayload"
          }
        },
        "required": [
          "id",
          "session",
          "timestamp",
          "event",
          "payload"
        ]
      },
      "PingResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "example": "ok"
          }
        },
        "required": [
          "status"
        ]
      },
      "HealthCheck": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "example": "healthy"
          },
          "error": {
            "type": "string"
          }
        },
        "required": [
          "status"
        ]
      },
      "HealthResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "example": "healthy"
          },
          "checks": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/HealthCheck"
            }
          }
        },
        "required": [
          "status",
          "checks"
        ]
      },
      "VersionResponse": {
        "type": "object",
        "properties": {
          "version": {
            "type": "string"
          },
          "buildTime": {
            "type": "string"
          },
          "env": {
            "type": "string"
          },
          "apiVersion": {
            "type": "string"
          },
          "minSupportedVersion": {
            "type": "string"
          }
        },
        "required": [
          "version",
          "buildTime",
          "env",
          "apiVersion",
          "minSupportedVersion"
        ]
      },
      "StatusResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "uptime": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "env": {
            "type": "string"
          }
        },
        "required": [
          "status",
          "uptime",
          "version",
          "env"
        ]
      },
      "SuccessResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "success"
        ]
      },
      "ClientToken": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string",
            "description": "Client token with pmfa_ct_ prefix"
          },
          "expiresAt": {
            "type": "string"
          }
        },
        "required": [
          "token",
          "expiresAt"
        ]
      },
      "MintClientTokenResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/ClientToken"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "MintClientTokenRequest": {
        "type": "object",
        "properties": {
          "session": {
            "type": "string",
            "minLength": 1
          },
          "ephemeralId": {
            "type": "string",
            "minLength": 1
          },
          "ttlSeconds": {
            "type": "integer"
          }
        },
        "required": [
          "session",
          "ephemeralId"
        ]
      },
      "ClientRules": {
        "type": "object",
        "properties": {
          "actions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "recipientMode": {
            "type": "string"
          },
          "verifiedJids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "rateLimits": {
            "type": "object",
            "properties": {
              "perMinute": {
                "type": "integer",
                "minimum": 0
              },
              "perDay": {
                "type": "integer",
                "minimum": 0
              }
            }
          }
        },
        "required": [
          "actions",
          "recipientMode"
        ]
      },
      "GetClientRulesResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/ClientRules"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "SetClientRulesRequest": {
        "type": "object",
        "properties": {
          "recipientMode": {
            "type": "string"
          },
          "allowedActions": {
            "type": "string",
            "default": ""
          },
          "rateLimit": {
            "type": "integer",
            "default": 0
          },
          "maxDaily": {
            "type": "integer",
            "default": 0
          },
          "allowedOrigins": {
            "type": "string",
            "default": ""
          },
          "enabled": {
            "type": "boolean"
          },
          "maxConcurrency": {
            "type": "integer",
            "minimum": 0,
            "default": 0
          },
          "allowedNumber": {
            "type": "string",
            "default": ""
          },
          "maxSetupsPerMinute": {
            "type": "integer",
            "minimum": 0,
            "maximum": 600,
            "default": 0
          }
        },
        "required": [
          "recipientMode",
          "enabled"
        ]
      },
      "Session": {
        "type": "object",
        "properties": {
          "sessionId": {
            "type": "string",
            "description": "Canonical per-org session identifier. Use this in /messaging/sessions/{session}/* paths."
          },
          "name": {
            "type": "string",
            "description": "Display label, or the session identifier when no label is set."
          },
          "externalId": {
            "type": "string",
            "description": "Integrator correlation supplied when creating the QuickLink for this session."
          },
          "tenantId": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "linked_device",
              "cloud_api"
            ],
            "description": "How the session connects to WhatsApp. 'linked_device' pairs as a WhatsApp linked device; 'cloud_api' uses the Meta Cloud API. Immutable after create."
          },
          "testMode": {
            "type": "boolean",
            "description": "Whether this session was created as a simulated testing number."
          },
          "status": {
            "type": "string",
            "description": "Current status: CONNECTING, CONNECTED, or DISCONNECTED"
          },
          "statusReason": {
            "type": "string"
          },
          "config": {
            "type": "object",
            "properties": {
              "historySync": {
                "type": "object",
                "properties": {
                  "mode": {
                    "type": "string",
                    "enum": [
                      "metadata_only",
                      "deliver"
                    ]
                  },
                  "requestFull": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "mode",
                  "requestFull"
                ]
              }
            }
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        },
        "required": [
          "sessionId",
          "name",
          "tenantId",
          "type",
          "testMode",
          "status",
          "config",
          "createdAt",
          "updatedAt"
        ]
      },
      "ListSessionsResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Session"
            }
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "SessionOperation": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Session"
          },
          {
            "type": "object",
            "properties": {}
          }
        ]
      },
      "CreateSessionResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/SessionOperation"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "CloudApiCredentials": {
        "type": "object",
        "properties": {
          "phoneNumberId": {
            "type": "string",
            "minLength": 1
          },
          "wabaId": {
            "type": "string",
            "minLength": 1
          },
          "businessAccountId": {
            "type": "string"
          },
          "appId": {
            "type": "string",
            "minLength": 1
          },
          "appSecret": {
            "type": "string",
            "minLength": 1
          },
          "systemUserToken": {
            "type": "string",
            "minLength": 1
          },
          "webhookVerifyToken": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "phoneNumberId",
          "wabaId",
          "appId",
          "appSecret",
          "systemUserToken",
          "webhookVerifyToken"
        ],
        "description": "Credentials required when type is cloud_api. Stored encrypted."
      },
      "HistorySyncPolicy": {
        "type": "object",
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "metadata_only",
              "deliver"
            ],
            "default": "metadata_only"
          },
          "requestFull": {
            "type": "boolean",
            "default": false
          }
        },
        "additionalProperties": false,
        "description": "History processing for linked-device sessions. Defaults to metadata-only processing."
      },
      "SessionConfig": {
        "type": "object",
        "properties": {
          "historySync": {
            "$ref": "#/components/schemas/HistorySyncPolicy"
          }
        },
        "additionalProperties": false
      },
      "CreateSessionRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "description": "Optional display label. The server generates the session identifier."
          },
          "startOnConnect": {
            "type": "boolean",
            "default": false,
            "description": "Start connecting immediately after creation. Pairing or credentials are still required."
          },
          "type": {
            "type": "string",
            "enum": [
              "linked_device",
              "cloud_api"
            ],
            "default": "linked_device",
            "description": "Connection type. Immutable after creation."
          },
          "testMode": {
            "type": "boolean",
            "default": false,
            "description": "Create a simulated testing session. Requires team enrollment in the Test numbers beta; unavailable teams receive 403."
          },
          "cloudApi": {
            "$ref": "#/components/schemas/CloudApiCredentials"
          },
          "config": {
            "$ref": "#/components/schemas/SessionConfig"
          }
        },
        "additionalProperties": false
      },
      "GetSessionResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/Session"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "UpdateSessionResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/Session"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "UpdateSessionRequest": {
        "type": "object",
        "properties": {
          "config": {
            "type": "object",
            "additionalProperties": true
          },
          "historySync": {
            "$ref": "#/components/schemas/HistorySyncPolicy"
          }
        }
      },
      "OperationAccepted": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "message": {
            "type": "string"
          },
          "immediate": {
            "type": "boolean"
          }
        },
        "required": [
          "success",
          "message"
        ]
      },
      "WhatsAppAccount": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[1-9][0-9]{0,18}$",
            "description": "Account ID when supplied by the connection.",
            "example": "739182640518203"
          },
          "phoneNumber": {
            "type": "string"
          },
          "bsuid": {
            "type": "string"
          },
          "username": {
            "type": "string"
          },
          "pushName": {
            "type": "string"
          },
          "businessName": {
            "type": "string"
          },
          "platform": {
            "type": "string"
          },
          "profilePicUrl": {
            "type": "string"
          }
        },
        "required": [
          "pushName"
        ]
      },
      "GetSessionAccountResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/WhatsAppAccount"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "HandoffKeysResponse": {
        "type": "object",
        "properties": {
          "runnerPublicKeyB64": {
            "type": "string",
            "description": "Curve25519 public key the customer must seal their snapshot to. Base64 (URL-safe, no padding)."
          },
          "handoffId": {
            "type": "string"
          }
        },
        "required": [
          "runnerPublicKeyB64",
          "handoffId"
        ]
      },
      "HandoffKeysSuccess": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/HandoffKeysResponse"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "HandoffImportSuccess": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/SuccessResponse"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "HandoffImportRequest": {
        "type": "object",
        "properties": {
          "handoffId": {
            "type": "string",
            "description": "Round-trip id returned by POST /handoff-keys."
          },
          "sealedEnvelopeB64": {
            "type": "string",
            "description": "Sealed-box envelope (ephemeral_pub(32) || ciphertext) wrapping the customer's SignalStoreSnapshot. Base64."
          },
          "snapshotHashHex": {
            "type": "string",
            "description": "SHA-256 of the unsealed snapshot JSON, hex-encoded. The runner verifies after decrypt before flipping bartenderMode."
          }
        },
        "required": [
          "handoffId",
          "sealedEnvelopeB64",
          "snapshotHashHex"
        ]
      },
      "UploadAppStateKeysSuccess": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/SuccessResponse"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "UploadAppStateKeysRequest": {
        "type": "object",
        "properties": {
          "keys": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "keyId": {
                  "type": "string",
                  "description": "Base64-encoded AppStateSyncKey id (URL-safe-no-pad)."
                },
                "keyB64": {
                  "type": "string",
                  "description": "Base64-encoded 32-byte symmetric key bytes."
                },
                "fingerprintB64": {
                  "type": "string",
                  "description": "Base64-encoded WA fingerprint blob (optional)."
                },
                "timestamp": {
                  "type": "number",
                  "description": "Unix-seconds timestamp WA stamped on the key."
                }
              },
              "required": [
                "keyId",
                "keyB64",
                "timestamp"
              ]
            }
          },
          "upgradeTo": {
            "type": "string",
            "enum": [
              "passthrough_plus"
            ],
            "description": "When set, atomically flips sessions.config.bartenderMode → passthrough_plus after the keys persist. Eliminates the window where mode is set but no keys are staged."
          }
        },
        "required": [
          "keys"
        ]
      },
      "HandoffAckSuccess": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/SuccessResponse"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "HandoffAckRequest": {
        "type": "object",
        "properties": {
          "handoffId": {
            "type": "string"
          },
          "snapshotHashHex": {
            "type": "string",
            "description": "SHA-256 of the snapshot the customer received via mode.handoff_export. API verifies this matches what the runner exported before flipping bartenderMode."
          }
        },
        "required": [
          "handoffId",
          "snapshotHashHex"
        ]
      },
      "QRResponse": {
        "type": "object",
        "properties": {
          "qr": {
            "type": "string",
            "description": "QR code data to encode into a scannable image"
          },
          "event": {
            "type": "string",
            "description": "QR channel event (e.g. success, timeout)"
          }
        }
      },
      "GetQRCodeResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/QRResponse"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "PairCodeResponse": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "Numeric pairing code for device linking"
          }
        },
        "required": [
          "code"
        ]
      },
      "RequestPairCodeResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/PairCodeResponse"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "PairCodeRequest": {
        "type": "object",
        "properties": {
          "phone": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "phone"
        ]
      },
      "ConversationIdentity": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[1-9][0-9]{0,18}$",
            "description": "Opaque Polymorfa resource ID. Keep this value as a string.",
            "example": "739182640518203"
          },
          "phoneNumber": {
            "type": "string",
            "pattern": "^\\+[1-9]\\d{1,14}$"
          },
          "bsuid": {
            "type": "string",
            "pattern": "^[A-Z]{2}\\.[A-Za-z0-9]{1,128}$"
          },
          "username": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          }
        },
        "required": [
          "id"
        ],
        "additionalProperties": false,
        "description": "The message's conversation, including its public ID and known aliases."
      },
      "SentMessage": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[1-9][0-9]{0,18}$",
            "description": "Opaque Polymorfa resource ID. Keep this value as a string.",
            "example": "739182640518203"
          },
          "whatsapp_id": {
            "type": "string",
            "minLength": 1
          },
          "conversation": {
            "$ref": "#/components/schemas/ConversationIdentity"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "type": "string",
            "description": "Upstream acceptance status. Delivery and read receipts arrive separately."
          },
          "type": {
            "type": "string"
          },
          "content": {
            "$ref": "#/components/schemas/MessageContent"
          },
          "mediaId": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "whatsapp_id",
          "conversation",
          "timestamp",
          "status",
          "type",
          "content"
        ]
      },
      "SendMessageResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/SentMessage"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "AsyncAcceptedResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "type": "object",
            "properties": {
              "requestId": {
                "type": "string",
                "format": "uuid"
              }
            },
            "required": [
              "requestId"
            ]
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "PublicError": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "invalid_request_error",
                  "authentication_error",
                  "permission_error",
                  "conflict_error",
                  "rate_limit_error",
                  "api_error",
                  "upstream_error"
                ]
              },
              "code": {
                "type": "string",
                "enum": [
                  "invalid_parameter",
                  "invalid_credential",
                  "entitlement_required",
                  "method_not_allowed",
                  "permission_denied",
                  "missing_scope",
                  "resource_not_found",
                  "media_fetch_failed",
                  "resource_gone",
                  "state_conflict",
                  "rate_limit_exceeded",
                  "internal_error",
                  "operation_not_supported",
                  "upstream_failure",
                  "service_unavailable",
                  "credential_verification_unavailable",
                  "session_not_ready",
                  "command_dispatch_failed",
                  "result_unknown"
                ]
              },
              "message": {
                "type": "string"
              },
              "param": {
                "type": "string",
                "nullable": true
              }
            },
            "required": [
              "type",
              "code",
              "message",
              "param"
            ]
          },
          "data": {
            "type": "string",
            "nullable": true,
            "enum": [
              null
            ],
            "description": "Always null for a failed request."
          },
          "docs": {
            "type": "string",
            "format": "uri"
          }
        },
        "required": [
          "error",
          "data",
          "docs"
        ]
      },
      "ConversationReference": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[1-9][0-9]{0,18}$",
            "description": "Opaque Polymorfa resource ID. Keep this value as a string.",
            "example": "739182640518203"
          },
          "phoneNumber": {
            "type": "string",
            "pattern": "^\\+[1-9]\\d{1,14}$"
          },
          "bsuid": {
            "type": "string",
            "pattern": "^[A-Z]{2}\\.[A-Za-z0-9]{1,128}$"
          },
          "username": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "description": "Known username. This field alone does not select a conversation."
          }
        },
        "additionalProperties": false,
        "anyOf": [
          {
            "required": [
              "id"
            ]
          },
          {
            "required": [
              "phoneNumber"
            ]
          },
          {
            "required": [
              "bsuid"
            ]
          }
        ]
      },
      "QuotedMessage": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[1-9][0-9]{0,18}$",
            "description": "Opaque Polymorfa resource ID. Keep this value as a string.",
            "example": "739182640518203"
          },
          "type": {
            "type": "string"
          },
          "text": {
            "type": "string"
          }
        },
        "required": [
          "id"
        ],
        "description": "Message being replied to."
      },
      "MessageContent": {
        "description": "Exactly one message kind: text, image, location, or another supported content field.",
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "text": {
                "type": "string",
                "minLength": 1,
                "description": "Text to send."
              }
            },
            "required": [
              "text"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "image": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "description": "URL of the media to send. Specify this or base64."
                  },
                  "base64": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Base64-encoded media bytes. Specify this or url."
                  },
                  "mimeType": {
                    "type": "string",
                    "description": "MIME type of the media."
                  },
                  "caption": {
                    "type": "string",
                    "description": "Caption sent with the media."
                  }
                },
                "additionalProperties": false
              }
            },
            "required": [
              "image"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "video": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "description": "URL of the media to send. Specify this or base64."
                  },
                  "base64": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Base64-encoded media bytes. Specify this or url."
                  },
                  "mimeType": {
                    "type": "string",
                    "description": "MIME type of the media."
                  },
                  "caption": {
                    "type": "string",
                    "description": "Caption sent with the media."
                  }
                },
                "additionalProperties": false
              }
            },
            "required": [
              "video"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "file": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "description": "URL of the media to send. Specify this or base64."
                  },
                  "base64": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Base64-encoded media bytes. Specify this or url."
                  },
                  "mimeType": {
                    "type": "string",
                    "description": "MIME type of the media."
                  },
                  "caption": {
                    "type": "string",
                    "description": "Caption sent with the media."
                  },
                  "filename": {
                    "type": "string"
                  }
                },
                "additionalProperties": false
              }
            },
            "required": [
              "file"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "voice": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "description": "URL of the media to send. Specify this or base64."
                  },
                  "base64": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Base64-encoded media bytes. Specify this or url."
                  },
                  "mimeType": {
                    "type": "string",
                    "description": "MIME type of the media."
                  },
                  "caption": {
                    "type": "string",
                    "description": "Caption sent with the media."
                  },
                  "ptt": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              }
            },
            "required": [
              "voice"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "location": {
                "type": "object",
                "properties": {
                  "lat": {
                    "type": "number",
                    "minimum": -90,
                    "maximum": 90,
                    "description": "Latitude in decimal degrees."
                  },
                  "long": {
                    "type": "number",
                    "minimum": -180,
                    "maximum": 180,
                    "description": "Longitude in decimal degrees."
                  },
                  "address": {
                    "type": "string",
                    "description": "Display address for the location."
                  }
                },
                "required": [
                  "lat",
                  "long"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "location"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "poll": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "minLength": 1
                  },
                  "options": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1
                    },
                    "minItems": 2
                  },
                  "multiSelect": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "title",
                  "options"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "poll"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "contact": {
                "type": "object",
                "properties": {
                  "vcard": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "vcard"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "contact"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "requestPhoneNumber": {
                "type": "object",
                "properties": {},
                "additionalProperties": false
              }
            },
            "required": [
              "requestPhoneNumber"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "product": {
                "type": "object",
                "properties": {
                  "businessOwnerId": {
                    "type": "string",
                    "pattern": "^[1-9][0-9]{0,18}$",
                    "description": "Opaque Polymorfa resource ID. Keep this value as a string.",
                    "example": "739182640518203"
                  },
                  "id": {
                    "type": "string",
                    "minLength": 1
                  },
                  "title": {
                    "type": "string",
                    "minLength": 1
                  },
                  "description": {
                    "type": "string",
                    "minLength": 0
                  },
                  "currencyCode": {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$"
                  },
                  "priceAmount1000": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "salePriceAmount1000": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "retailerId": {
                    "type": "string",
                    "minLength": 0
                  },
                  "url": {
                    "type": "string",
                    "maxLength": 2048,
                    "format": "uri"
                  },
                  "imageCount": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 100
                  },
                  "image": {
                    "type": "object",
                    "properties": {
                      "url": {
                        "type": "string",
                        "maxLength": 4096,
                        "format": "uri"
                      },
                      "base64": {
                        "type": "string",
                        "maxLength": 87384
                      },
                      "mimeType": {
                        "type": "string",
                        "minLength": 0
                      }
                    }
                  },
                  "body": {
                    "type": "string",
                    "minLength": 0
                  },
                  "footer": {
                    "type": "string",
                    "minLength": 0
                  }
                },
                "required": [
                  "businessOwnerId",
                  "id",
                  "title",
                  "currencyCode",
                  "priceAmount1000"
                ]
              }
            },
            "required": [
              "product"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "productList": {
                "type": "object",
                "properties": {
                  "businessOwnerId": {
                    "type": "string",
                    "pattern": "^[1-9][0-9]{0,18}$",
                    "description": "Opaque Polymorfa resource ID. Keep this value as a string.",
                    "example": "739182640518203"
                  },
                  "title": {
                    "type": "string",
                    "minLength": 1
                  },
                  "description": {
                    "type": "string",
                    "minLength": 0
                  },
                  "buttonText": {
                    "type": "string",
                    "minLength": 1
                  },
                  "footer": {
                    "type": "string",
                    "minLength": 0
                  },
                  "sections": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "title": {
                          "type": "string",
                          "minLength": 0
                        },
                        "productIds": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "minLength": 1
                          },
                          "minItems": 1,
                          "maxItems": 30
                        }
                      },
                      "required": [
                        "productIds"
                      ]
                    },
                    "minItems": 1,
                    "maxItems": 10
                  }
                },
                "required": [
                  "businessOwnerId",
                  "title",
                  "buttonText",
                  "sections"
                ]
              }
            },
            "required": [
              "productList"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "order": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "minLength": 1
                  },
                  "thumbnailBase64": {
                    "type": "string",
                    "maxLength": 87384
                  },
                  "itemCount": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "inquiry",
                      "accepted",
                      "declined"
                    ]
                  },
                  "message": {
                    "type": "string",
                    "minLength": 0
                  },
                  "title": {
                    "type": "string",
                    "minLength": 0
                  },
                  "sellerId": {
                    "type": "string",
                    "pattern": "^[1-9][0-9]{0,18}$",
                    "description": "Opaque Polymorfa resource ID. Keep this value as a string.",
                    "example": "739182640518203"
                  },
                  "token": {
                    "type": "string",
                    "minLength": 0
                  },
                  "totalAmount1000": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "totalCurrencyCode": {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$"
                  },
                  "catalogType": {
                    "type": "string",
                    "minLength": 0
                  }
                },
                "required": [
                  "id",
                  "itemCount",
                  "status",
                  "sellerId",
                  "totalAmount1000",
                  "totalCurrencyCode"
                ]
              }
            },
            "required": [
              "order"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "list": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "minLength": 1
                  },
                  "description": {
                    "type": "string",
                    "minLength": 0
                  },
                  "buttonText": {
                    "type": "string",
                    "minLength": 1
                  },
                  "footer": {
                    "type": "string",
                    "minLength": 0
                  },
                  "sections": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "title": {
                          "type": "string",
                          "minLength": 0
                        },
                        "rows": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "title": {
                                "type": "string",
                                "minLength": 1
                              },
                              "description": {
                                "type": "string",
                                "minLength": 0
                              }
                            },
                            "required": [
                              "id",
                              "title"
                            ]
                          },
                          "minItems": 1,
                          "maxItems": 30
                        }
                      },
                      "required": [
                        "rows"
                      ]
                    },
                    "minItems": 1,
                    "maxItems": 10
                  }
                },
                "required": [
                  "title",
                  "buttonText",
                  "sections"
                ]
              }
            },
            "required": [
              "list"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "buttons": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "minLength": 0
                  },
                  "body": {
                    "type": "string",
                    "minLength": 1
                  },
                  "footer": {
                    "type": "string",
                    "minLength": 0
                  },
                  "buttons": {
                    "type": "array",
                    "items": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "url"
                              ]
                            },
                            "text": {
                              "type": "string",
                              "minLength": 1
                            },
                            "url": {
                              "type": "string",
                              "maxLength": 2048,
                              "format": "uri"
                            }
                          },
                          "required": [
                            "type",
                            "text",
                            "url"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "call"
                              ]
                            },
                            "text": {
                              "type": "string",
                              "minLength": 1
                            },
                            "phoneNumber": {
                              "type": "string",
                              "pattern": "^\\+?\\d{6,20}$"
                            }
                          },
                          "required": [
                            "type",
                            "text",
                            "phoneNumber"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "reply"
                              ]
                            },
                            "text": {
                              "type": "string",
                              "minLength": 1
                            },
                            "id": {
                              "type": "string",
                              "minLength": 1
                            }
                          },
                          "required": [
                            "type",
                            "text",
                            "id"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "copy"
                              ]
                            },
                            "text": {
                              "type": "string",
                              "minLength": 1
                            },
                            "copyCode": {
                              "type": "string",
                              "minLength": 1
                            }
                          },
                          "required": [
                            "type",
                            "text",
                            "copyCode"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "catalog"
                              ]
                            },
                            "text": {
                              "type": "string",
                              "minLength": 1
                            },
                            "businessPhoneNumber": {
                              "type": "string",
                              "pattern": "^\\+?\\d{6,20}$"
                            },
                            "catalogProductId": {
                              "type": "string",
                              "minLength": 0
                            }
                          },
                          "required": [
                            "type",
                            "text",
                            "businessPhoneNumber"
                          ]
                        }
                      ]
                    },
                    "minItems": 1,
                    "maxItems": 3
                  }
                },
                "required": [
                  "body",
                  "buttons"
                ]
              }
            },
            "required": [
              "buttons"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "addressMessage": {
                "type": "object",
                "properties": {
                  "body": {
                    "type": "string",
                    "minLength": 1
                  },
                  "buttonText": {
                    "type": "string",
                    "minLength": 1
                  },
                  "footer": {
                    "type": "string",
                    "minLength": 0
                  },
                  "country": {
                    "type": "string",
                    "pattern": "^[A-Z]{2}$"
                  }
                },
                "required": [
                  "body"
                ]
              }
            },
            "required": [
              "addressMessage"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "flow": {
                "type": "object",
                "properties": {
                  "body": {
                    "type": "string",
                    "minLength": 1
                  },
                  "buttonText": {
                    "type": "string",
                    "minLength": 1
                  },
                  "footer": {
                    "type": "string",
                    "minLength": 0
                  },
                  "id": {
                    "type": "string",
                    "minLength": 1
                  },
                  "token": {
                    "type": "string",
                    "minLength": 1
                  },
                  "action": {
                    "type": "string",
                    "enum": [
                      "navigate",
                      "data_exchange"
                    ]
                  },
                  "screen": {
                    "type": "string",
                    "minLength": 0
                  },
                  "dataJson": {
                    "type": "string",
                    "minLength": 0
                  }
                },
                "required": [
                  "body",
                  "buttonText",
                  "id",
                  "token",
                  "action"
                ],
                "oneOf": [
                  {
                    "properties": {
                      "action": {
                        "enum": [
                          "navigate"
                        ]
                      }
                    },
                    "required": [
                      "screen"
                    ]
                  },
                  {
                    "properties": {
                      "action": {
                        "enum": [
                          "data_exchange"
                        ]
                      }
                    },
                    "not": {
                      "anyOf": [
                        {
                          "required": [
                            "screen"
                          ]
                        },
                        {
                          "required": [
                            "dataJson"
                          ]
                        }
                      ]
                    }
                  }
                ]
              }
            },
            "required": [
              "flow"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "template": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "language": {
                    "type": "string",
                    "minLength": 2
                  },
                  "components": {
                    "type": "array",
                    "items": {}
                  }
                },
                "required": [
                  "name",
                  "language"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "template"
            ],
            "additionalProperties": false
          }
        ]
      },
      "SendMessageRequest": {
        "type": "object",
        "properties": {
          "conversation": {
            "$ref": "#/components/schemas/ConversationReference"
          },
          "isForwarded": {
            "type": "boolean",
            "description": "Mark this message as forwarded."
          },
          "mentions": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,18}$",
              "description": "Opaque Polymorfa resource ID. Keep this value as a string.",
              "example": "739182640518203"
            },
            "description": "User IDs to mention in this message."
          },
          "quotedMessage": {
            "$ref": "#/components/schemas/QuotedMessage"
          },
          "content": {
            "$ref": "#/components/schemas/MessageContent"
          }
        },
        "required": [
          "conversation",
          "content"
        ],
        "additionalProperties": false,
        "description": "Specify conversation and content containing exactly one message kind. Shared options remain outside content."
      },
      "MessageActionResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string"
              }
            },
            "required": [
              "status"
            ]
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "SeenRequest": {
        "type": "object",
        "properties": {
          "conversation": {
            "$ref": "#/components/schemas/ConversationReference"
          },
          "id": {
            "type": "string",
            "pattern": "^[1-9][0-9]{0,18}$",
            "description": "Opaque Polymorfa resource ID. Keep this value as a string.",
            "example": "739182640518203"
          }
        },
        "required": [
          "conversation",
          "id"
        ],
        "additionalProperties": false
      },
      "TypingRequest": {
        "type": "object",
        "properties": {
          "conversation": {
            "$ref": "#/components/schemas/ConversationReference"
          },
          "state": {
            "type": "string",
            "enum": [
              "typing",
              "recording",
              "paused"
            ]
          }
        },
        "required": [
          "conversation",
          "state"
        ],
        "additionalProperties": false
      },
      "MessageReceipt": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[1-9][0-9]{0,18}$",
            "description": "Opaque Polymorfa resource ID. Keep this value as a string.",
            "example": "739182640518203"
          },
          "whatsapp_id": {
            "type": "string",
            "minLength": 1
          },
          "conversation": {
            "$ref": "#/components/schemas/ConversationIdentity"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "type": "string",
            "description": "Upstream acceptance status. Delivery and read receipts arrive separately."
          }
        },
        "required": [
          "id",
          "whatsapp_id",
          "conversation",
          "timestamp",
          "status"
        ]
      },
      "SendReactionResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/MessageReceipt"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "ReactRequest": {
        "type": "object",
        "properties": {
          "conversation": {
            "$ref": "#/components/schemas/ConversationReference"
          },
          "id": {
            "type": "string",
            "pattern": "^[1-9][0-9]{0,18}$",
            "description": "Opaque Polymorfa resource ID. Keep this value as a string.",
            "example": "739182640518203"
          },
          "reaction": {
            "type": "string"
          }
        },
        "required": [
          "conversation",
          "id",
          "reaction"
        ],
        "additionalProperties": false
      },
      "StarRequest": {
        "type": "object",
        "properties": {
          "conversation": {
            "$ref": "#/components/schemas/ConversationReference"
          },
          "id": {
            "type": "string",
            "pattern": "^[1-9][0-9]{0,18}$",
            "description": "Opaque Polymorfa resource ID. Keep this value as a string.",
            "example": "739182640518203"
          },
          "star": {
            "type": "boolean"
          }
        },
        "required": [
          "conversation",
          "id",
          "star"
        ],
        "additionalProperties": false
      },
      "EditMessageRequest": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "text"
        ]
      },
      "DisappearingTimerRequest": {
        "type": "object",
        "properties": {
          "durationSeconds": {
            "anyOf": [
              {
                "type": "number",
                "enum": [
                  0
                ]
              },
              {
                "type": "number",
                "enum": [
                  86400
                ]
              },
              {
                "type": "number",
                "enum": [
                  604800
                ]
              },
              {
                "type": "number",
                "enum": [
                  7776000
                ]
              }
            ]
          }
        },
        "required": [
          "durationSeconds"
        ]
      },
      "RejectCallRequest": {
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "pattern": "^[1-9][0-9]{0,18}$",
            "description": "ID of the incoming caller"
          }
        },
        "required": [
          "from"
        ]
      },
      "ICEServer": {
        "type": "object",
        "properties": {
          "urls": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ]
          },
          "username": {
            "type": "string"
          },
          "credential": {
            "type": "string"
          }
        },
        "required": [
          "urls"
        ]
      },
      "SDPAnswer": {
        "type": "object",
        "properties": {
          "sdp": {
            "type": "string"
          },
          "iceServers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ICEServer"
            }
          }
        },
        "required": [
          "sdp",
          "iceServers"
        ]
      },
      "VoipOfferResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/SDPAnswer"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "VoipOfferRequest": {
        "type": "object",
        "properties": {
          "sdp": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "sdp"
        ]
      },
      "VoipRenegotiateResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/SDPAnswer"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "VoipRenegotiateRequest": {
        "type": "object",
        "properties": {
          "sdp": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "sdp"
        ]
      },
      "VoipSocketTicket": {
        "type": "object",
        "properties": {
          "ticket": {
            "type": "string"
          },
          "expiresAt": {
            "type": "number"
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "ticket",
          "expiresAt",
          "url"
        ]
      },
      "VoipSocketTicketResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/VoipSocketTicket"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "VoipSocketTicketRequest": {
        "type": "object",
        "properties": {
          "session": {
            "type": "string",
            "minLength": 1
          }
        }
      },
      "VoipAgentToken": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string"
          },
          "expiresAt": {
            "type": "number"
          }
        },
        "required": [
          "token",
          "expiresAt"
        ]
      },
      "VoipAgentTokenResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/VoipAgentToken"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "VoipAgentTokenRequest": {
        "type": "object",
        "properties": {
          "ttlSeconds": {
            "type": "integer",
            "minimum": 1,
            "maximum": 3600
          }
        }
      },
      "VoipPlacedCall": {
        "type": "object",
        "properties": {
          "callId": {
            "type": "string"
          },
          "session": {
            "type": "string"
          },
          "video": {
            "type": "boolean"
          }
        },
        "required": [
          "callId",
          "session",
          "video"
        ]
      },
      "VoipPlacedCallResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/VoipPlacedCall"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "VoipPlaceCallRequest": {
        "type": "object",
        "properties": {
          "session": {
            "type": "string",
            "minLength": 1,
            "example": "support"
          },
          "to": {
            "type": "string",
            "pattern": "^(?:\\+[1-9]\\d{1,14}|[1-9][0-9]{0,18})$",
            "example": "+15550100"
          },
          "video": {
            "type": "boolean"
          }
        },
        "required": [
          "to"
        ]
      },
      "VoipAcceptCallRequest": {
        "type": "object",
        "properties": {
          "video": {
            "type": "boolean"
          }
        }
      },
      "VoipParticipant": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[1-9][0-9]{0,18}$",
            "description": "Opaque Polymorfa resource ID. Keep this value as a string.",
            "example": "739182640518203"
          },
          "phoneNumber": {
            "type": "string",
            "pattern": "^\\+[1-9]\\d{1,14}$"
          },
          "bsuid": {
            "type": "string",
            "pattern": "^[A-Z]{2}\\.[A-Za-z0-9]{1,128}$"
          },
          "username": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "audioMuted": {
            "type": "boolean"
          },
          "video": {
            "type": "boolean"
          },
          "state": {
            "type": "string",
            "enum": [
              "invited",
              "ringing",
              "connected",
              "left"
            ]
          }
        },
        "required": [
          "id",
          "audioMuted",
          "video",
          "state"
        ],
        "additionalProperties": false
      },
      "VoipAddParticipantResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/VoipParticipant"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "VoipAddParticipantRequest": {
        "type": "object",
        "properties": {
          "to": {
            "type": "string",
            "pattern": "^(?:\\+[1-9]\\d{1,14}|[1-9][0-9]{0,18})$",
            "example": "+15550100"
          }
        },
        "required": [
          "to"
        ]
      },
      "VoipModeResponse": {
        "type": "object",
        "properties": {
          "session": {
            "type": "string"
          },
          "mode": {
            "type": "string",
            "enum": [
              "browser",
              "agent",
              "sdk"
            ]
          }
        },
        "required": [
          "session",
          "mode"
        ]
      },
      "VoipModeResult": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/VoipModeResponse"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "VoipModeRequest": {
        "type": "object",
        "properties": {
          "session": {
            "type": "string",
            "minLength": 1,
            "example": "support"
          },
          "mode": {
            "type": "string",
            "enum": [
              "browser",
              "agent",
              "sdk"
            ]
          }
        },
        "required": [
          "mode"
        ]
      },
      "VoipCandidateRequest": {
        "type": "object",
        "properties": {
          "candidate": {
            "type": "string"
          },
          "sdpMid": {
            "type": "string"
          },
          "sdpMLineIndex": {
            "type": "integer"
          }
        },
        "required": [
          "candidate"
        ]
      },
      "TrickleCandidate": {
        "type": "object",
        "properties": {
          "candidate": {
            "type": "string"
          },
          "sdpMid": {
            "type": "string"
          },
          "sdpMLineIndex": {
            "type": "integer"
          }
        },
        "required": [
          "candidate"
        ]
      },
      "VoipCandidatesResponse": {
        "type": "object",
        "properties": {
          "candidates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TrickleCandidate"
            }
          }
        },
        "required": [
          "candidates"
        ]
      },
      "VoipCandidatesEnvelope": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/VoipCandidatesResponse"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "VoipToken": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string"
          },
          "expiresAt": {
            "type": "number"
          }
        },
        "required": [
          "token",
          "expiresAt"
        ]
      },
      "VoipTokenResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/VoipToken"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "VoipTokenRequest": {
        "type": "object",
        "properties": {
          "session": {
            "type": "string",
            "minLength": 1
          },
          "ephemeralId": {
            "type": "string",
            "minLength": 1
          },
          "ttlSeconds": {
            "type": "integer"
          }
        },
        "required": [
          "session",
          "ephemeralId"
        ]
      },
      "Participant": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[1-9][0-9]{0,18}$",
            "description": "Opaque Polymorfa resource ID. Keep this value as a string.",
            "example": "739182640518203"
          },
          "phoneNumber": {
            "type": "string"
          },
          "bsuid": {
            "type": "string"
          },
          "username": {
            "type": "string"
          },
          "isAdmin": {
            "type": "boolean"
          },
          "isSuperAdmin": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "isAdmin",
          "isSuperAdmin"
        ]
      },
      "Group": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[1-9][0-9]{0,18}$",
            "description": "Opaque Polymorfa group ID. Keep it as a string."
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "ownerId": {
            "type": "string"
          },
          "createdAt": {
            "type": "number",
            "description": "Unix timestamp in seconds"
          },
          "participants": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Participant"
            }
          }
        },
        "required": [
          "id",
          "name",
          "description",
          "ownerId",
          "createdAt",
          "participants"
        ]
      },
      "ListGroupsResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Group"
            }
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "CreateGroupResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/Group"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "CreateGroupRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "participants": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,18}$"
            },
            "minItems": 1
          }
        },
        "required": [
          "name",
          "participants"
        ]
      },
      "GroupInviteInfo": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "subject": {
            "type": "string"
          },
          "creatorId": {
            "type": "string"
          },
          "createdAt": {
            "type": "number"
          },
          "size": {
            "type": "number"
          },
          "participants": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Participant"
            }
          }
        },
        "required": [
          "id",
          "subject",
          "creatorId",
          "createdAt",
          "size",
          "participants"
        ]
      },
      "GetGroupJoinInfoResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/GroupInviteInfo"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "JoinGroupRequest": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "code"
        ]
      },
      "GetGroupResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/Group"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "SetGroupFieldRequest": {
        "type": "object",
        "properties": {
          "value": {
            "type": "string"
          }
        },
        "required": [
          "value"
        ]
      },
      "InviteCodeResponse": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "Group invite code"
          }
        },
        "required": [
          "code"
        ]
      },
      "GetGroupInviteCodeResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/InviteCodeResponse"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "RevokeGroupInviteCodeResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/InviteCodeResponse"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "GetGroupParticipantsResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Participant"
            }
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "GroupParticipantsRequest": {
        "type": "object",
        "properties": {
          "participants": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,18}$"
            },
            "minItems": 1
          }
        },
        "required": [
          "participants"
        ]
      },
      "SetGroupPictureRequest": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string"
          },
          "base64": {
            "type": "string"
          }
        }
      },
      "GroupAdminOnlySettingRequest": {
        "type": "object",
        "properties": {
          "adminsOnly": {
            "type": "boolean"
          }
        },
        "required": [
          "adminsOnly"
        ]
      },
      "GroupMemberAddModeRequest": {
        "type": "object",
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "admin_add",
              "all_member_add"
            ]
          }
        },
        "required": [
          "mode"
        ]
      },
      "GroupJoinApprovalRequest": {
        "type": "object",
        "properties": {
          "required": {
            "type": "boolean"
          }
        },
        "required": [
          "required"
        ]
      },
      "Contact": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[1-9][0-9]{0,18}$",
            "description": "Opaque Polymorfa resource ID. Keep this value as a string.",
            "example": "739182640518203"
          },
          "phoneNumber": {
            "type": "string"
          },
          "bsuid": {
            "type": "string"
          },
          "username": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "pushName": {
            "type": "string"
          },
          "businessName": {
            "type": "string"
          },
          "profileUrl": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "pushName"
        ]
      },
      "ListContactsResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Contact"
            }
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "CheckContactResult": {
        "type": "object",
        "properties": {
          "exists": {
            "type": "boolean"
          },
          "id": {
            "type": "string",
            "pattern": "^[1-9][0-9]{0,18}$",
            "description": "Opaque Polymorfa resource ID. Keep this value as a string.",
            "example": "739182640518203"
          },
          "phoneNumber": {
            "type": "string"
          },
          "bsuid": {
            "type": "string"
          },
          "username": {
            "type": "string"
          }
        },
        "required": [
          "exists"
        ]
      },
      "CheckContactsResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CheckContactResult"
            }
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "Blocklist": {
        "type": "object",
        "properties": {
          "hash": {
            "type": "string"
          },
          "contacts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^[1-9][0-9]{0,18}$",
                  "description": "Opaque Polymorfa resource ID. Keep this value as a string.",
                  "example": "739182640518203"
                },
                "phoneNumber": {
                  "type": "string"
                },
                "bsuid": {
                  "type": "string"
                },
                "username": {
                  "type": "string"
                }
              },
              "required": [
                "id"
              ]
            }
          }
        },
        "required": [
          "hash",
          "contacts"
        ]
      },
      "GetBlocklistResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/Blocklist"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "GetContactResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/Contact"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "ProfilePictureResponse": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "HTTPS URL of the profile picture"
          }
        },
        "required": [
          "url"
        ]
      },
      "GetContactPictureResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/ProfilePictureResponse"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "UserInfo": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[1-9][0-9]{0,18}$",
            "description": "Opaque Polymorfa resource ID. Keep this value as a string.",
            "example": "739182640518203"
          },
          "phoneNumber": {
            "type": "string"
          },
          "bsuid": {
            "type": "string"
          },
          "username": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "pictureId": {
            "type": "string"
          },
          "verifiedName": {
            "type": "string"
          },
          "devices": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^[1-9][0-9]{0,18}$",
                  "description": "Opaque Polymorfa resource ID. Keep this value as a string.",
                  "example": "739182640518203"
                },
                "phoneNumber": {
                  "type": "string"
                },
                "bsuid": {
                  "type": "string"
                },
                "username": {
                  "type": "string"
                },
                "device": {
                  "type": "integer"
                }
              },
              "required": [
                "id",
                "device"
              ]
            }
          }
        },
        "required": [
          "id",
          "status",
          "pictureId",
          "verifiedName",
          "devices"
        ]
      },
      "GetUserInfoResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/UserInfo"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "GetUserDevicesResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "phoneNumber": {
                  "type": "string"
                },
                "device": {
                  "type": "integer"
                }
              },
              "required": [
                "device"
              ]
            }
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "BusinessProfile": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[1-9][0-9]{0,18}$",
            "description": "Opaque Polymorfa resource ID. Keep this value as a string.",
            "example": "739182640518203"
          },
          "phoneNumber": {
            "type": "string"
          },
          "bsuid": {
            "type": "string"
          },
          "username": {
            "type": "string"
          },
          "address": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "websites": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uri"
            }
          },
          "coverPhotoId": {
            "type": "string"
          },
          "categories": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "name"
              ]
            }
          },
          "options": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "hoursTimeZone": {
            "type": "string"
          },
          "hours": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "dayOfWeek": {
                  "type": "string"
                },
                "mode": {
                  "type": "string"
                },
                "openTime": {
                  "type": "string"
                },
                "closeTime": {
                  "type": "string"
                }
              },
              "required": [
                "dayOfWeek",
                "mode",
                "openTime",
                "closeTime"
              ]
            }
          }
        },
        "required": [
          "id",
          "address",
          "email",
          "description",
          "websites",
          "coverPhotoId",
          "categories",
          "options",
          "hoursTimeZone",
          "hours"
        ]
      },
      "GetBusinessProfileResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/BusinessProfile"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "BusinessLinkedAccounts": {
        "type": "object",
        "properties": {
          "facebookPage": {
            "type": "object",
            "properties": {
              "hasActiveCTWAAd": {
                "type": "boolean"
              },
              "hasCreatedAd": {
                "type": "boolean"
              },
              "id": {
                "type": "string"
              },
              "displayName": {
                "type": "string"
              },
              "profileSync": {
                "type": "string",
                "enum": [
                  "disable",
                  "import"
                ]
              },
              "profilePictureUrl": {
                "type": "string",
                "format": "uri"
              },
              "showOnProfile": {
                "type": "boolean"
              },
              "whatsAppAsPageButton": {
                "type": "boolean"
              }
            },
            "required": [
              "hasActiveCTWAAd",
              "hasCreatedAd",
              "id",
              "displayName",
              "profilePictureUrl",
              "showOnProfile",
              "whatsAppAsPageButton"
            ]
          },
          "facebookBusiness": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "displayName": {
                "type": "string"
              },
              "catalogId": {
                "type": "string"
              },
              "catalogState": {
                "type": "string",
                "enum": [
                  "disable",
                  "import"
                ]
              }
            },
            "required": [
              "id",
              "displayName"
            ]
          },
          "instagramProfessional": {
            "type": "object",
            "properties": {
              "handle": {
                "type": "string"
              },
              "displayName": {
                "type": "string"
              },
              "profilePictureUrl": {
                "type": "string",
                "format": "uri"
              },
              "showOnProfile": {
                "type": "boolean"
              }
            },
            "required": [
              "handle",
              "displayName",
              "profilePictureUrl",
              "showOnProfile"
            ]
          },
          "whatsAppAdIdentity": {
            "type": "object",
            "properties": {
              "hasActiveCTWAAd": {
                "type": "boolean"
              },
              "hasCreatedAd": {
                "type": "boolean"
              },
              "id": {
                "type": "string"
              }
            },
            "required": [
              "hasActiveCTWAAd",
              "hasCreatedAd",
              "id"
            ]
          }
        }
      },
      "GetBusinessLinkedAccountsResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/BusinessLinkedAccounts"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "BusinessEligibility": {
        "type": "object",
        "properties": {
          "features": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "feature": {
                  "type": "string",
                  "enum": [
                    "meta_verified",
                    "marketing_messages",
                    "genai",
                    "genai_image",
                    "meta_one",
                    "bb_pro"
                  ]
                },
                "status": {
                  "type": "string"
                },
                "expiration": {
                  "type": "integer"
                },
                "additionalParams": {
                  "type": "string"
                },
                "showPrivacyInterstitialToNewUsers": {
                  "type": "boolean"
                },
                "v1Enabled": {
                  "type": "boolean"
                }
              },
              "required": [
                "feature",
                "status"
              ]
            },
            "maxItems": 6
          }
        },
        "required": [
          "features"
        ]
      },
      "GetBusinessEligibilityResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/BusinessEligibility"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "GetOwnBusinessProfileResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/BusinessProfile"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "UpdateBusinessProfileResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string"
              }
            },
            "required": [
              "status"
            ]
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "BusinessProfileUpdateRequest": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string",
            "maxLength": 512
          },
          "email": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  ""
                ]
              },
              {
                "type": "string",
                "maxLength": 320,
                "format": "email"
              }
            ]
          },
          "description": {
            "type": "string",
            "maxLength": 1024
          },
          "websites": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 2048,
              "format": "uri"
            },
            "minItems": 1,
            "maxItems": 2
          },
          "hours": {
            "type": "object",
            "properties": {
              "timeZone": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128
              },
              "days": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "dayOfWeek": {
                      "type": "string",
                      "enum": [
                        "sun",
                        "mon",
                        "tue",
                        "wed",
                        "thu",
                        "fri",
                        "sat"
                      ]
                    },
                    "mode": {
                      "type": "string",
                      "enum": [
                        "specific_hours",
                        "open_24h",
                        "appointment_only"
                      ]
                    },
                    "openTime": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 1439
                    },
                    "closeTime": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 1439
                    }
                  },
                  "required": [
                    "dayOfWeek",
                    "mode"
                  ]
                },
                "minItems": 1,
                "maxItems": 7
              }
            },
            "required": [
              "timeZone",
              "days"
            ]
          }
        }
      },
      "SetBusinessCoverPhotoResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "type": "object",
            "properties": {
              "coverPhotoId": {
                "type": "string"
              }
            },
            "required": [
              "coverPhotoId"
            ]
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "BusinessCoverPhotoRequest": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "maxLength": 2048,
            "format": "uri"
          },
          "base64": {
            "type": "string",
            "minLength": 1,
            "maxLength": 6990508
          }
        }
      },
      "DeleteBusinessCoverPhotoResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string"
              }
            },
            "required": [
              "status"
            ]
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "BusinessMerchantCompliance": {
        "type": "object",
        "properties": {
          "entityName": {
            "type": "string",
            "maxLength": 256
          },
          "entityType": {
            "type": "string",
            "enum": [
              "SOLE_PROPRIETORSHIP",
              "PARTNERSHIP",
              "PRIVATE_COMPANY",
              "PUBLIC_COMPANY",
              "LIMITED_LIABILITY_PARTNERSHIP",
              "OTHER"
            ]
          },
          "isRegistered": {
            "type": "boolean"
          },
          "entityTypeCustom": {
            "type": "string",
            "maxLength": 256
          },
          "customerCare": {
            "type": "object",
            "properties": {
              "email": {
                "type": "string",
                "maxLength": 254
              },
              "landlineNumber": {
                "type": "string",
                "maxLength": 64
              },
              "mobileNumber": {
                "type": "string",
                "maxLength": 64
              }
            },
            "required": [
              "email",
              "landlineNumber",
              "mobileNumber"
            ],
            "additionalProperties": false
          },
          "grievanceOfficer": {
            "type": "object",
            "properties": {
              "email": {
                "type": "string",
                "maxLength": 254
              },
              "landlineNumber": {
                "type": "string",
                "maxLength": 64
              },
              "mobileNumber": {
                "type": "string",
                "maxLength": 64
              },
              "name": {
                "type": "string",
                "maxLength": 256
              }
            },
            "required": [
              "email",
              "landlineNumber",
              "mobileNumber",
              "name"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "entityName",
          "entityType",
          "isRegistered",
          "entityTypeCustom",
          "customerCare",
          "grievanceOfficer"
        ],
        "additionalProperties": false
      },
      "GetBusinessMerchantComplianceResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/BusinessMerchantCompliance"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "SetBusinessMerchantComplianceResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/BusinessMerchantCompliance"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "BusinessQuickReplyMutation": {
        "type": "object",
        "properties": {
          "shortcut": {
            "type": "string",
            "minLength": 1,
            "maxLength": 25,
            "pattern": "^[\\p{L}\\p{N}]+$"
          },
          "message": {
            "type": "string",
            "minLength": 1,
            "maxLength": 65536
          },
          "keywords": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            },
            "maxItems": 100,
            "default": []
          },
          "count": {
            "type": "integer",
            "minimum": 0,
            "maximum": 2147483647,
            "default": 0
          }
        },
        "required": [
          "shortcut",
          "message"
        ]
      },
      "BusinessQuickReply": {
        "allOf": [
          {
            "$ref": "#/components/schemas/BusinessQuickReplyMutation"
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              }
            },
            "required": [
              "id"
            ]
          }
        ]
      },
      "CreateBusinessQuickReplyResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/BusinessQuickReply"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "BusinessQuickReplyObserved": {
        "allOf": [
          {
            "$ref": "#/components/schemas/BusinessQuickReply"
          },
          {
            "type": "object",
            "properties": {
              "associatedLabelIds": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "observedAt": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "associatedLabelIds",
              "observedAt"
            ]
          }
        ]
      },
      "BusinessQuickReplyCollection": {
        "type": "object",
        "properties": {
          "policy": {
            "type": "string",
            "enum": [
              "off",
              "events",
              "cache"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "disabled",
              "unknown",
              "partial",
              "fresh"
            ]
          },
          "unknownReason": {
            "type": "string",
            "enum": [
              "observation_disabled",
              "not_retained",
              "not_observed"
            ]
          },
          "observedAt": {
            "type": "string",
            "format": "date-time"
          },
          "quickReplies": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BusinessQuickReplyObserved"
            }
          }
        },
        "required": [
          "policy",
          "status",
          "quickReplies"
        ]
      },
      "ListBusinessQuickRepliesResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/BusinessQuickReplyCollection"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "SetBusinessQuickReplyResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/BusinessQuickReply"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "DeleteBusinessQuickReplyResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "status": {
                "type": "string",
                "enum": [
                  "DELETED"
                ]
              }
            },
            "required": [
              "id",
              "status"
            ]
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "BusinessProduct": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "retailerId": {
            "type": "string"
          },
          "belongsTo": {
            "type": "string",
            "pattern": "^[1-9][0-9]{0,18}$",
            "description": "Opaque Polymorfa resource ID. Keep this value as a string.",
            "example": "739182640518203"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "price": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "shimmedUrl": {
            "type": "string",
            "format": "uri"
          },
          "hidden": {
            "type": "boolean"
          },
          "sanctioned": {
            "type": "boolean"
          },
          "maxAvailable": {
            "type": "integer",
            "minimum": 0
          },
          "availability": {
            "type": "string"
          },
          "complianceCategory": {
            "type": "string"
          },
          "compliance": {
            "type": "object",
            "properties": {
              "countryCodeOrigin": {
                "type": "string"
              },
              "importerName": {
                "type": "string"
              },
              "importerAddress": {
                "type": "object",
                "properties": {
                  "street1": {
                    "type": "string"
                  },
                  "street2": {
                    "type": "string"
                  },
                  "city": {
                    "type": "string"
                  },
                  "region": {
                    "type": "string"
                  },
                  "postalCode": {
                    "type": "string"
                  },
                  "countryCode": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "media": {
            "type": "object",
            "properties": {
              "images": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "originalUrl": {
                      "type": "string",
                      "format": "uri"
                    },
                    "requestUrl": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "required": [
                    "id"
                  ]
                }
              },
              "videos": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "originalUrl": {
                      "type": "string",
                      "format": "uri"
                    },
                    "thumbnailUrl": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "required": [
                    "id"
                  ]
                }
              }
            },
            "required": [
              "images",
              "videos"
            ]
          },
          "salePrice": {
            "type": "object",
            "properties": {
              "price": {
                "type": "string"
              },
              "startDate": {
                "type": "string"
              },
              "endDate": {
                "type": "string"
              }
            },
            "required": [
              "price"
            ]
          },
          "status": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string"
              },
              "canAppeal": {
                "type": "boolean"
              }
            },
            "required": [
              "canAppeal"
            ]
          },
          "variant": {
            "type": "object",
            "properties": {
              "availability": {
                "type": "object",
                "properties": {
                  "listings": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "productId": {
                          "type": "string"
                        },
                        "available": {
                          "type": "boolean"
                        },
                        "options": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "name": {
                                "type": "string"
                              },
                              "value": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "name",
                              "value"
                            ]
                          }
                        }
                      },
                      "required": [
                        "available",
                        "options"
                      ]
                    }
                  }
                },
                "required": [
                  "listings"
                ]
              },
              "listingDetails": {
                "type": "object",
                "properties": {
                  "description": {
                    "type": "string"
                  },
                  "lowestPrice": {
                    "type": "string"
                  },
                  "multiPrice": {
                    "type": "string"
                  }
                }
              },
              "types": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "options": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "value": {
                            "type": "string"
                          },
                          "thumbnail": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "originalUrl": {
                                "type": "string",
                                "format": "uri"
                              },
                              "requestUrl": {
                                "type": "string",
                                "format": "uri"
                              },
                              "originalDimensions": {
                                "type": "object",
                                "properties": {
                                  "width": {
                                    "type": "integer",
                                    "minimum": 0
                                  },
                                  "height": {
                                    "type": "integer",
                                    "minimum": 0
                                  }
                                }
                              }
                            },
                            "required": [
                              "originalDimensions"
                            ]
                          }
                        },
                        "required": [
                          "value"
                        ]
                      }
                    }
                  },
                  "required": [
                    "name",
                    "options"
                  ]
                }
              },
              "properties": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "value": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "name",
                    "value"
                  ]
                }
              }
            },
            "required": [
              "availability",
              "listingDetails",
              "types",
              "properties"
            ]
          }
        },
        "required": [
          "id",
          "name",
          "price",
          "currency",
          "hidden",
          "sanctioned",
          "media",
          "status"
        ]
      },
      "BusinessCatalogPage": {
        "type": "object",
        "properties": {
          "next": {
            "type": "string"
          },
          "previous": {
            "type": "string"
          },
          "products": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BusinessProduct"
            }
          }
        },
        "required": [
          "products"
        ]
      },
      "GetBusinessCatalogResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/BusinessCatalogPage"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "CreateBusinessCatalogResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean",
                "enum": [
                  true
                ]
              }
            },
            "required": [
              "success"
            ]
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "SetBusinessCartEnabledResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean",
                "enum": [
                  true
                ]
              }
            },
            "required": [
              "success"
            ]
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "BusinessCartSettingRequest": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          }
        },
        "required": [
          "enabled"
        ],
        "additionalProperties": false
      },
      "GetBusinessProductResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/BusinessProduct"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "CreateBusinessProductResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/BusinessProduct"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "BusinessProductMutationRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "description": {
            "type": "string",
            "maxLength": 4096
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "price": {
            "type": "string",
            "pattern": "^\\d{1,18}$"
          },
          "salePrice": {
            "type": "string",
            "pattern": "^\\d{1,18}$"
          },
          "url": {
            "type": "string",
            "maxLength": 2048,
            "format": "uri"
          },
          "retailerId": {
            "type": "string",
            "maxLength": 256
          },
          "hidden": {
            "type": "boolean"
          },
          "images": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "url": {
                  "type": "string",
                  "maxLength": 4096,
                  "format": "uri",
                  "description": "HTTPS image source fetched through Polymorfa's SSRF-safe downloader"
                },
                "base64": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 22369624
                },
                "mediaUrl": {
                  "type": "string",
                  "maxLength": 4096,
                  "format": "uri",
                  "description": "Already-uploaded WhatsApp or Meta media URL reused without downloading"
                }
              },
              "additionalProperties": false
            },
            "minItems": 1,
            "maxItems": 10
          },
          "videoUrls": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 4096,
              "format": "uri"
            },
            "maxItems": 10
          },
          "complianceCategory": {
            "type": "string",
            "maxLength": 128
          },
          "compliance": {
            "type": "object",
            "properties": {
              "countryCodeOrigin": {
                "type": "string",
                "maxLength": 3
              },
              "importerName": {
                "type": "string",
                "maxLength": 256
              },
              "importerAddress": {
                "type": "object",
                "properties": {
                  "street1": {
                    "type": "string",
                    "maxLength": 512
                  },
                  "street2": {
                    "type": "string",
                    "maxLength": 512
                  },
                  "city": {
                    "type": "string",
                    "maxLength": 256
                  },
                  "region": {
                    "type": "string",
                    "maxLength": 256
                  },
                  "postalCode": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "countryCode": {
                    "type": "string",
                    "maxLength": 3
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "width": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1024
          },
          "height": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1024
          }
        },
        "required": [
          "name",
          "images"
        ],
        "additionalProperties": false
      },
      "UpdateBusinessProductResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/BusinessProduct"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "DeleteBusinessProductResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "type": "object",
            "properties": {
              "deletedCount": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": [
              "deletedCount"
            ]
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "SetBusinessProductVisibilityResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean",
                "enum": [
                  true
                ]
              }
            },
            "required": [
              "success"
            ]
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "BusinessProductVisibilityRequest": {
        "type": "object",
        "properties": {
          "hidden": {
            "type": "boolean"
          }
        },
        "required": [
          "hidden"
        ],
        "additionalProperties": false
      },
      "AppealBusinessProductResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean",
                "enum": [
                  true
                ]
              }
            },
            "required": [
              "success"
            ]
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "BusinessCatalogAppealRequest": {
        "type": "object",
        "properties": {
          "reason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4096
          }
        },
        "required": [
          "reason"
        ],
        "additionalProperties": false
      },
      "BusinessCollection": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "products": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BusinessProduct"
            }
          },
          "status": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string"
              },
              "canAppeal": {
                "type": "boolean"
              },
              "commerceUrl": {
                "type": "string",
                "format": "uri"
              },
              "rejectReason": {
                "type": "string"
              }
            },
            "required": [
              "canAppeal"
            ]
          }
        },
        "required": [
          "id",
          "name",
          "products",
          "status"
        ]
      },
      "BusinessCollectionPage": {
        "type": "object",
        "properties": {
          "next": {
            "type": "string"
          },
          "collections": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BusinessCollection"
            }
          }
        },
        "required": [
          "collections"
        ]
      },
      "GetBusinessCollectionsResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/BusinessCollectionPage"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "CreateBusinessCollectionResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "reviewStatus": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "reviewStatus"
            ]
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "BusinessCollectionCreateRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "productIds": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            },
            "minItems": 1,
            "maxItems": 100
          }
        },
        "required": [
          "name",
          "productIds"
        ],
        "additionalProperties": false
      },
      "GetBusinessCollectionResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/BusinessCollection"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "ReorderBusinessCollectionsResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean",
                "enum": [
                  true
                ]
              }
            },
            "required": [
              "success"
            ]
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "BusinessCollectionReorderRequest": {
        "type": "object",
        "properties": {
          "moves": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "collectionId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "fromIndex": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 99
                },
                "toIndex": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 99
                }
              },
              "required": [
                "collectionId",
                "fromIndex",
                "toIndex"
              ],
              "additionalProperties": false
            },
            "minItems": 1,
            "maxItems": 100
          }
        },
        "required": [
          "moves"
        ],
        "additionalProperties": false
      },
      "UpdateBusinessCollectionResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "reviewStatus": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "reviewStatus"
            ]
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "BusinessCollectionUpdateRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "addProductIds": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            },
            "minItems": 0,
            "maxItems": 100
          },
          "removeProductIds": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            },
            "minItems": 0,
            "maxItems": 100
          }
        },
        "additionalProperties": false
      },
      "DeleteBusinessCollectionResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean",
                "enum": [
                  true
                ]
              }
            },
            "required": [
              "success"
            ]
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "AppealBusinessCollectionResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean",
                "enum": [
                  true
                ]
              }
            },
            "required": [
              "success"
            ]
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "BusinessOrder": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "createdAt": {
            "type": "integer",
            "minimum": 0
          },
          "catalogId": {
            "type": "string"
          },
          "price": {
            "type": "object",
            "properties": {
              "subtotal": {
                "type": "string"
              },
              "total": {
                "type": "string"
              },
              "currency": {
                "type": "string"
              },
              "priceStatus": {
                "type": "string"
              }
            },
            "required": [
              "subtotal",
              "total",
              "currency"
            ]
          },
          "products": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "imageId": {
                  "type": "string"
                },
                "imageUrl": {
                  "type": "string",
                  "format": "uri"
                },
                "price": {
                  "type": "string"
                },
                "currency": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "quantity": {
                  "type": "integer",
                  "minimum": 0
                },
                "variantProperties": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "price",
                "currency",
                "name",
                "quantity"
              ]
            }
          }
        },
        "required": [
          "id",
          "createdAt",
          "price",
          "products"
        ]
      },
      "GetBusinessOrderResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/BusinessOrder"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "BusinessOrderLookupRequest": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string",
            "minLength": 1,
            "maxLength": 8192
          }
        },
        "required": [
          "token"
        ]
      },
      "ResolveIdentityResult": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[1-9][0-9]{0,18}$",
            "description": "Opaque Polymorfa resource ID. Keep this value as a string.",
            "example": "739182640518203"
          },
          "phoneNumber": {
            "type": "string"
          },
          "bsuid": {
            "type": "string"
          },
          "username": {
            "type": "string"
          },
          "keyRequired": {
            "type": "boolean"
          }
        }
      },
      "ResolveIdentityResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/ResolveIdentityResult"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "UserSecurityCode": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[1-9][0-9]{0,18}$"
          },
          "phoneNumber": {
            "type": "string"
          },
          "username": {
            "type": "string"
          },
          "numericCode": {
            "type": "string",
            "pattern": "^\\d{60}$"
          },
          "qrCode": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "numericCode",
          "qrCode"
        ]
      },
      "UserSecurityCodeResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/UserSecurityCode"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "Channel": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "profileUrl": {
            "type": "string"
          },
          "followers": {
            "type": "number"
          },
          "muted": {
            "type": "boolean"
          },
          "preview": {
            "type": "boolean"
          }
        }
      },
      "ListChannelsResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Channel"
            }
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "CreateChannelResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/Channel"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "CreateChannelRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "description": {
            "type": "string"
          },
          "picture": {
            "type": "string"
          }
        },
        "required": [
          "name"
        ]
      },
      "GetChannelResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/Channel"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "ChannelMessage": {
        "type": "object",
        "properties": {
          "position": {
            "type": "integer",
            "minimum": 0,
            "exclusiveMinimum": true,
            "maximum": 9007199254740991,
            "description": "Channel ordering position. Use this value for before and after pagination cursors, not as a message ID."
          },
          "id": {
            "type": "string",
            "pattern": "^[1-9][0-9]{0,18}$",
            "description": "Opaque Polymorfa resource ID. Keep this value as a string.",
            "example": "739182640518203"
          },
          "whatsapp_id": {
            "type": "string",
            "minLength": 1
          },
          "conversation": {
            "$ref": "#/components/schemas/ConversationIdentity"
          },
          "type": {
            "type": "string"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "views": {
            "type": "integer",
            "minimum": 0
          },
          "reactionCounts": {
            "type": "object",
            "additionalProperties": {
              "type": "integer",
              "minimum": 0
            }
          },
          "text": {
            "type": "string"
          }
        },
        "required": [
          "position",
          "id",
          "whatsapp_id",
          "conversation",
          "type",
          "timestamp",
          "views",
          "reactionCounts"
        ]
      },
      "ListChannelMessagesResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ChannelMessage"
            }
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "ListChannelMessageUpdatesResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ChannelMessage"
            }
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "ChannelReactionRequest": {
        "type": "object",
        "properties": {
          "reaction": {
            "type": "string",
            "maxLength": 32
          }
        },
        "required": [
          "reaction"
        ]
      },
      "ChannelLiveUpdates": {
        "type": "object",
        "properties": {
          "durationSeconds": {
            "type": "integer",
            "minimum": 0,
            "exclusiveMinimum": true
          }
        },
        "required": [
          "durationSeconds"
        ]
      },
      "ChannelLiveUpdatesResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/ChannelLiveUpdates"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "DeleteChannelResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "DELETED"
                ]
              }
            },
            "required": [
              "status"
            ]
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "SetPresenceRequest": {
        "type": "object",
        "properties": {
          "presence": {
            "type": "string",
            "enum": [
              "available",
              "unavailable"
            ]
          }
        },
        "required": [
          "presence"
        ]
      },
      "PresenceData": {
        "type": "object",
        "properties": {
          "desired": {
            "type": "string",
            "enum": [
              "available",
              "unavailable"
            ]
          },
          "desiredAt": {
            "type": "string",
            "format": "date-time"
          },
          "lastSent": {
            "type": "string",
            "enum": [
              "available",
              "unavailable"
            ]
          },
          "lastSentAt": {
            "type": "string",
            "format": "date-time"
          },
          "authoritative": {
            "type": "boolean",
            "enum": [
              false
            ]
          }
        },
        "required": [
          "authoritative"
        ]
      },
      "GetPresenceResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/PresenceData"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "ChatPresenceData": {
        "type": "object",
        "properties": {
          "policy": {
            "type": "string",
            "enum": [
              "off",
              "events",
              "cache"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "unknown",
              "fresh",
              "stale"
            ]
          },
          "unknownReason": {
            "type": "string",
            "enum": [
              "disabled",
              "not_observed",
              "suspended"
            ]
          },
          "available": {
            "type": "boolean"
          },
          "lastSeen": {
            "type": "string",
            "format": "date-time"
          },
          "observedAt": {
            "type": "string",
            "format": "date-time"
          },
          "subscriptionExpiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "stale": {
            "type": "boolean"
          },
          "typingPolicy": {
            "type": "string",
            "enum": [
              "off",
              "events",
              "cache"
            ]
          },
          "typingStatus": {
            "type": "string",
            "enum": [
              "unknown",
              "fresh",
              "stale"
            ]
          },
          "typingUnknownReason": {
            "type": "string",
            "enum": [
              "disabled",
              "not_observed",
              "suspended"
            ]
          },
          "chatState": {
            "type": "object",
            "properties": {
              "sender": {
                "type": "string"
              },
              "state": {
                "type": "string",
                "enum": [
                  "composing",
                  "paused"
                ]
              },
              "media": {
                "type": "string"
              },
              "observedAt": {
                "type": "string",
                "format": "date-time"
              },
              "stale": {
                "type": "boolean"
              }
            },
            "required": [
              "sender",
              "state",
              "observedAt",
              "stale"
            ]
          }
        },
        "required": [
          "policy",
          "status",
          "stale",
          "typingPolicy",
          "typingStatus"
        ]
      },
      "GetChatPresenceResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/ChatPresenceData"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "PresenceSubscriptionData": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "SUBSCRIBED"
            ]
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "status",
          "expiresAt"
        ]
      },
      "SubscribePresenceResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/PresenceSubscriptionData"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "ProjectSafeMode": {
        "type": "object",
        "properties": {
          "projectId": {
            "type": "string",
            "format": "uuid"
          },
          "ceiling": {
            "type": "object",
            "properties": {
              "presence": {
                "type": "string",
                "enum": [
                  "dark",
                  "online_while_sending",
                  "online_hours"
                ]
              },
              "typing": {
                "type": "string",
                "enum": [
                  "off",
                  "before_text",
                  "before_all"
                ]
              },
              "reads": {
                "type": "string",
                "enum": [
                  "off",
                  "replied_chats",
                  "all_inbound"
                ]
              },
              "pacing": {
                "type": "string",
                "enum": [
                  "off",
                  "jittered",
                  "conversation"
                ]
              },
              "onlineStart": {
                "type": "integer",
                "minimum": 0,
                "maximum": 23
              },
              "onlineEnd": {
                "type": "integer",
                "minimum": 0,
                "maximum": 23
              }
            },
            "required": [
              "presence",
              "typing",
              "reads",
              "pacing",
              "onlineStart",
              "onlineEnd"
            ]
          },
          "entitled": {
            "type": "boolean"
          },
          "entitlementReason": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "projectId",
          "ceiling",
          "entitled",
          "entitlementReason"
        ]
      },
      "GetProjectSafeModeResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/ProjectSafeMode"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "UpdateProjectSafeModeResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/ProjectSafeMode"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "SessionSafeMode": {
        "type": "object",
        "properties": {
          "session": {
            "type": "string"
          },
          "projectId": {
            "type": "string",
            "format": "uuid"
          },
          "project": {
            "type": "object",
            "properties": {
              "presence": {
                "type": "string",
                "enum": [
                  "dark",
                  "online_while_sending",
                  "online_hours"
                ]
              },
              "typing": {
                "type": "string",
                "enum": [
                  "off",
                  "before_text",
                  "before_all"
                ]
              },
              "reads": {
                "type": "string",
                "enum": [
                  "off",
                  "replied_chats",
                  "all_inbound"
                ]
              },
              "pacing": {
                "type": "string",
                "enum": [
                  "off",
                  "jittered",
                  "conversation"
                ]
              },
              "onlineStart": {
                "type": "integer",
                "minimum": 0,
                "maximum": 23
              },
              "onlineEnd": {
                "type": "integer",
                "minimum": 0,
                "maximum": 23
              }
            },
            "required": [
              "presence",
              "typing",
              "reads",
              "pacing",
              "onlineStart",
              "onlineEnd"
            ]
          },
          "override": {
            "type": "object",
            "properties": {
              "presence": {
                "type": "string",
                "enum": [
                  "inherit",
                  "dark",
                  "online_while_sending",
                  "online_hours"
                ]
              },
              "typing": {
                "type": "string",
                "enum": [
                  "inherit",
                  "off",
                  "before_text",
                  "before_all"
                ]
              },
              "reads": {
                "type": "string",
                "enum": [
                  "inherit",
                  "off",
                  "replied_chats",
                  "all_inbound"
                ]
              },
              "pacing": {
                "type": "string",
                "enum": [
                  "inherit",
                  "off",
                  "jittered",
                  "conversation"
                ]
              }
            },
            "required": [
              "presence",
              "typing",
              "reads",
              "pacing"
            ]
          },
          "effective": {
            "type": "object",
            "properties": {
              "presence": {
                "type": "string",
                "enum": [
                  "dark",
                  "online_while_sending",
                  "online_hours"
                ]
              },
              "typing": {
                "type": "string",
                "enum": [
                  "off",
                  "before_text",
                  "before_all"
                ]
              },
              "reads": {
                "type": "string",
                "enum": [
                  "off",
                  "replied_chats",
                  "all_inbound"
                ]
              },
              "pacing": {
                "type": "string",
                "enum": [
                  "off",
                  "jittered",
                  "conversation"
                ]
              },
              "onlineStart": {
                "type": "integer",
                "minimum": 0,
                "maximum": 23
              },
              "onlineEnd": {
                "type": "integer",
                "minimum": 0,
                "maximum": 23
              }
            },
            "required": [
              "presence",
              "typing",
              "reads",
              "pacing",
              "onlineStart",
              "onlineEnd"
            ]
          },
          "applied": {
            "type": "object",
            "nullable": true,
            "properties": {
              "observedAt": {
                "type": "string"
              },
              "presence": {
                "type": "string",
                "nullable": true
              },
              "typing": {
                "type": "string",
                "nullable": true
              },
              "reads": {
                "type": "string",
                "nullable": true
              },
              "pacing": {
                "type": "string",
                "nullable": true
              }
            },
            "required": [
              "observedAt",
              "presence",
              "typing",
              "reads",
              "pacing"
            ]
          },
          "mismatch": {
            "type": "boolean"
          },
          "entitled": {
            "type": "boolean"
          },
          "entitlementReason": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "session",
          "projectId",
          "project",
          "override",
          "effective",
          "applied",
          "mismatch",
          "entitled",
          "entitlementReason"
        ]
      },
      "GetSessionSafeModeResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/SessionSafeMode"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "UpdateSessionSafeModeResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/SessionSafeMode"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "ProjectWarmupPlan": {
        "type": "object",
        "properties": {
          "projectId": {
            "type": "string",
            "format": "uuid"
          },
          "plan": {
            "type": "object",
            "properties": {
              "enabled": {
                "type": "boolean"
              },
              "warmupDays": {
                "type": "integer",
                "minimum": 1,
                "maximum": 90
              },
              "dailyStart": {
                "type": "integer",
                "minimum": 1,
                "maximum": 2000
              }
            },
            "required": [
              "enabled",
              "warmupDays",
              "dailyStart"
            ]
          },
          "ceiling": {
            "type": "integer",
            "minimum": 1
          },
          "curve": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "day": {
                  "type": "integer",
                  "minimum": 0
                },
                "allowance": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "required": [
                "day",
                "allowance"
              ]
            },
            "maxItems": 91
          },
          "entitled": {
            "type": "boolean"
          },
          "entitlementReason": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "projectId",
          "plan",
          "ceiling",
          "curve",
          "entitled",
          "entitlementReason"
        ]
      },
      "GetProjectWarmupPlanResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/ProjectWarmupPlan"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "UpdateProjectWarmupPlanResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/ProjectWarmupPlan"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "ProjectHealthPolicy": {
        "type": "object",
        "properties": {
          "projectId": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "type": "integer",
            "minimum": 0
          },
          "enabled": {
            "type": "boolean"
          },
          "threshold": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "sessionAction": {
            "type": "string",
            "enum": [
              "none",
              "stop",
              "slow_down",
              "log_out"
            ]
          },
          "slowDownMps": {
            "type": "number",
            "nullable": true,
            "minimum": 0,
            "exclusiveMinimum": true
          },
          "emailNotification": {
            "type": "boolean"
          },
          "webhookNotification": {
            "type": "boolean"
          },
          "integrations": {
            "type": "object",
            "properties": {
              "emailConfigured": {
                "type": "boolean"
              },
              "webhookConfigured": {
                "type": "boolean"
              }
            },
            "required": [
              "emailConfigured",
              "webhookConfigured"
            ]
          }
        },
        "required": [
          "projectId",
          "version",
          "enabled",
          "threshold",
          "sessionAction",
          "slowDownMps",
          "emailNotification",
          "webhookNotification",
          "integrations"
        ]
      },
      "GetProjectHealthPolicyResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/ProjectHealthPolicy"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "UpdateProjectHealthPolicyResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/ProjectHealthPolicy"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "UpdateProjectHealthPolicyInput": {
        "type": "object",
        "properties": {
          "version": {
            "type": "integer",
            "minimum": 0
          },
          "enabled": {
            "type": "boolean"
          },
          "threshold": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "sessionAction": {
            "type": "string",
            "enum": [
              "none",
              "stop",
              "slow_down",
              "log_out"
            ]
          },
          "slowDownMps": {
            "type": "number",
            "nullable": true,
            "minimum": 0,
            "exclusiveMinimum": true
          },
          "emailNotification": {
            "type": "boolean"
          },
          "webhookNotification": {
            "type": "boolean"
          }
        },
        "required": [
          "version",
          "enabled",
          "threshold",
          "sessionAction",
          "slowDownMps",
          "emailNotification",
          "webhookNotification"
        ],
        "additionalProperties": false
      },
      "ProjectInsuranceEvidence": {
        "type": "object",
        "properties": {
          "projectId": {
            "type": "string",
            "format": "uuid"
          },
          "enabled": {
            "type": "boolean"
          },
          "banInsuranceIncluded": {
            "type": "boolean"
          }
        },
        "required": [
          "projectId",
          "enabled",
          "banInsuranceIncluded"
        ]
      },
      "GetProjectInsuranceEvidenceResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/ProjectInsuranceEvidence"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "UpdateProjectInsuranceEvidenceResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/ProjectInsuranceEvidence"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "ProjectObservationPolicy": {
        "type": "object",
        "properties": {
          "projectId": {
            "type": "string",
            "format": "uuid"
          },
          "presenceMode": {
            "type": "string",
            "enum": [
              "off",
              "events",
              "cache"
            ]
          },
          "typingMode": {
            "type": "string",
            "enum": [
              "off",
              "events",
              "cache"
            ]
          },
          "labelMode": {
            "type": "string",
            "enum": [
              "off",
              "events",
              "cache",
              "project"
            ]
          },
          "quickReplyMode": {
            "type": "string",
            "enum": [
              "off",
              "events",
              "cache"
            ]
          }
        },
        "required": [
          "projectId",
          "presenceMode",
          "typingMode",
          "labelMode",
          "quickReplyMode"
        ]
      },
      "GetProjectObservationPolicyResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/ProjectObservationPolicy"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "UpdateProjectObservationPolicyResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/ProjectObservationPolicy"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "SessionObservationPolicy": {
        "type": "object",
        "properties": {
          "sessionName": {
            "type": "string"
          },
          "projectId": {
            "type": "string",
            "format": "uuid"
          },
          "project": {
            "type": "object",
            "properties": {
              "presenceMode": {
                "type": "string",
                "enum": [
                  "off",
                  "events",
                  "cache"
                ]
              },
              "typingMode": {
                "type": "string",
                "enum": [
                  "off",
                  "events",
                  "cache"
                ]
              },
              "labelMode": {
                "type": "string",
                "enum": [
                  "off",
                  "events",
                  "cache",
                  "project"
                ]
              },
              "quickReplyMode": {
                "type": "string",
                "enum": [
                  "off",
                  "events",
                  "cache"
                ]
              }
            },
            "required": [
              "presenceMode",
              "typingMode",
              "labelMode",
              "quickReplyMode"
            ]
          },
          "override": {
            "type": "object",
            "properties": {
              "presenceMode": {
                "type": "string",
                "enum": [
                  "inherit",
                  "off",
                  "events",
                  "cache"
                ]
              },
              "typingMode": {
                "type": "string",
                "enum": [
                  "inherit",
                  "off",
                  "events",
                  "cache"
                ]
              },
              "labelMode": {
                "type": "string",
                "enum": [
                  "inherit",
                  "off",
                  "events",
                  "cache",
                  "project"
                ]
              },
              "quickReplyMode": {
                "type": "string",
                "enum": [
                  "inherit",
                  "off",
                  "events",
                  "cache"
                ]
              }
            },
            "required": [
              "presenceMode",
              "typingMode",
              "labelMode",
              "quickReplyMode"
            ]
          },
          "effective": {
            "type": "object",
            "properties": {
              "presenceMode": {
                "type": "string",
                "enum": [
                  "off",
                  "events",
                  "cache"
                ]
              },
              "typingMode": {
                "type": "string",
                "enum": [
                  "off",
                  "events",
                  "cache"
                ]
              },
              "labelMode": {
                "type": "string",
                "enum": [
                  "off",
                  "events",
                  "cache",
                  "project"
                ]
              },
              "quickReplyMode": {
                "type": "string",
                "enum": [
                  "off",
                  "events",
                  "cache"
                ]
              }
            },
            "required": [
              "presenceMode",
              "typingMode",
              "labelMode",
              "quickReplyMode"
            ]
          }
        },
        "required": [
          "sessionName",
          "projectId",
          "project",
          "override",
          "effective"
        ]
      },
      "GetSessionObservationPolicyResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/SessionObservationPolicy"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "UpdateSessionObservationPolicyResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/SessionObservationPolicy"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "ProfileData": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "profilePicUrl": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "status"
        ]
      },
      "GetProfileResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/ProfileData"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "SetProfileNameRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "name"
        ]
      },
      "SetProfileStatusRequest": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          }
        },
        "required": [
          "status"
        ]
      },
      "SetProfilePictureRequest": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string"
          },
          "base64": {
            "type": "string"
          }
        }
      },
      "PrivacySettings": {
        "type": "object",
        "properties": {
          "groupAdd": {
            "type": "string"
          },
          "lastSeen": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "profile": {
            "type": "string"
          },
          "readReceipts": {
            "type": "string"
          },
          "online": {
            "type": "string"
          },
          "callAdd": {
            "type": "string"
          },
          "messages": {
            "type": "string"
          },
          "defense": {
            "type": "string"
          },
          "stickers": {
            "type": "string"
          }
        },
        "required": [
          "groupAdd",
          "lastSeen",
          "status",
          "profile",
          "readReceipts",
          "online",
          "callAdd",
          "messages",
          "defense",
          "stickers"
        ]
      },
      "PrivacySettingsResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/PrivacySettings"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "DefaultDisappearingTimerRequest": {
        "type": "object",
        "properties": {
          "durationSeconds": {
            "anyOf": [
              {
                "type": "number",
                "enum": [
                  0
                ]
              },
              {
                "type": "number",
                "enum": [
                  86400
                ]
              },
              {
                "type": "number",
                "enum": [
                  604800
                ]
              },
              {
                "type": "number",
                "enum": [
                  7776000
                ]
              }
            ]
          }
        },
        "required": [
          "durationSeconds"
        ]
      },
      "UpdatedPrivacySettingsResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/PrivacySettings"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "SetPrivacySettingRequest": {
        "type": "object",
        "properties": {
          "value": {
            "type": "string",
            "enum": [
              "all",
              "contacts",
              "contact_allowlist",
              "contact_blacklist",
              "match_last_seen",
              "known",
              "none",
              "on_standard",
              "off"
            ]
          }
        },
        "required": [
          "value"
        ]
      },
      "Label": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "color": {
            "type": "integer"
          },
          "orderIndex": {
            "type": "integer"
          },
          "chatCount": {
            "type": "integer"
          },
          "observedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "name",
          "color"
        ]
      },
      "LabelCollection": {
        "type": "object",
        "properties": {
          "policy": {
            "type": "string",
            "enum": [
              "off",
              "events",
              "cache",
              "project"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "disabled",
              "unknown",
              "partial",
              "fresh"
            ]
          },
          "unknownReason": {
            "type": "string",
            "enum": [
              "observation_disabled",
              "not_retained",
              "not_observed",
              "expired"
            ]
          },
          "observedAt": {
            "type": "string",
            "format": "date-time"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "labels": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Label"
            }
          }
        },
        "required": [
          "policy",
          "status",
          "labels"
        ]
      },
      "LabelReadData": {
        "anyOf": [
          {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Label"
            }
          },
          {
            "$ref": "#/components/schemas/LabelCollection"
          }
        ]
      },
      "ListLabelsResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/LabelReadData"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "CreateLabelResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/Label"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "CreateLabelRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "color": {
            "type": "integer",
            "minimum": 0,
            "maximum": 19
          }
        },
        "required": [
          "name"
        ]
      },
      "UpdateLabelRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "color": {
            "type": "integer",
            "minimum": 0,
            "maximum": 19
          }
        }
      },
      "GetChatLabelsResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/LabelReadData"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "SetChatLabelsRequest": {
        "type": "object",
        "properties": {
          "labels": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "maxItems": 20
          }
        },
        "required": [
          "labels"
        ]
      },
      "RetryConfig": {
        "type": "object",
        "properties": {
          "attempts": {
            "type": "integer",
            "minimum": 0
          },
          "delaySeconds": {
            "type": "integer",
            "minimum": 0
          },
          "policy": {
            "type": "string",
            "description": "linear, exponential, or constant"
          }
        },
        "required": [
          "attempts",
          "delaySeconds",
          "policy"
        ]
      },
      "WebhookHeader": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "value"
        ]
      },
      "Webhook": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "tenantId": {
            "type": "string"
          },
          "session": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "retries": {
            "$ref": "#/components/schemas/RetryConfig"
          },
          "headers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookHeader"
            }
          },
          "enabled": {
            "type": "boolean"
          },
          "format": {
            "type": "string",
            "enum": [
              "native",
              "meta"
            ]
          },
          "createdAt": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "tenantId",
          "url",
          "events",
          "retries",
          "headers",
          "enabled",
          "createdAt"
        ]
      },
      "ListWebhooksResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhook"
            }
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "CreateWebhookResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/Webhook"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "CreateWebhookRequest": {
        "type": "object",
        "properties": {
          "session": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "hmacKey": {
            "type": "string"
          },
          "retries": {
            "$ref": "#/components/schemas/RetryConfig"
          },
          "headers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookHeader"
            }
          },
          "format": {
            "type": "string",
            "enum": [
              "native",
              "meta"
            ],
            "description": "\"native\" (default) = Polymorfa event envelope. \"meta\" = Meta Cloud API webhook shape (object/entry/changes/value), signed with X-Hub-Signature-256."
          }
        },
        "required": [
          "url"
        ]
      },
      "GetWebhookResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/Webhook"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "UpdateWebhookResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/Webhook"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "UpdateWebhookRequest": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "format": "uri"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "hmacKey": {
            "type": "string"
          },
          "retries": {
            "$ref": "#/components/schemas/RetryConfig"
          },
          "headers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookHeader"
            }
          },
          "enabled": {
            "type": "boolean"
          },
          "format": {
            "type": "string",
            "enum": [
              "native",
              "meta"
            ]
          }
        }
      },
      "MediaInfo": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "session": {
            "type": "string"
          },
          "messageId": {
            "type": "string"
          },
          "mimeType": {
            "type": "string"
          },
          "fileLength": {
            "type": "integer",
            "minimum": 0
          },
          "persisted": {
            "type": "boolean"
          },
          "s3Url": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "session",
          "messageId",
          "mimeType",
          "fileLength",
          "persisted"
        ]
      },
      "GetMediaInfoResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/MediaInfo"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "MessageTemplate": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "language": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "definition": {},
          "sampleValues": {},
          "cloudLinks": {
            "type": "array",
            "items": {}
          },
          "createdAt": {
            "type": "number"
          },
          "updatedAt": {
            "type": "number"
          }
        },
        "required": [
          "id",
          "name",
          "category",
          "language",
          "status",
          "kind",
          "cloudLinks",
          "createdAt",
          "updatedAt"
        ]
      },
      "ListProjectTemplatesResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MessageTemplate"
            }
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "GetProjectTemplateResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/MessageTemplate"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "CreateProjectTemplateResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/MessageTemplate"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "CreateMessageTemplateRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "pattern": "^[a-z0-9_]+$"
          },
          "definition": {
            "type": "object",
            "additionalProperties": {}
          },
          "sampleValues": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          }
        },
        "required": [
          "name",
          "definition"
        ]
      },
      "UpdateProjectTemplateResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/MessageTemplate"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "UpdateMessageTemplateRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "status": {
            "type": "string"
          },
          "definition": {
            "type": "object",
            "additionalProperties": {}
          },
          "sampleValues": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          }
        }
      },
      "PreviewProjectTemplateResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "type": "object",
            "additionalProperties": {}
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "PreviewMessageTemplateRequest": {
        "type": "object",
        "properties": {
          "values": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "surface": {
            "type": "string",
            "enum": [
              "cloud",
              "whatsmeow",
              "sandbox"
            ]
          }
        }
      },
      "SubmitProjectTemplateResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "type": "object",
            "additionalProperties": {}
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "SubmitMessageTemplateRequest": {
        "type": "object",
        "properties": {
          "session": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "session"
        ]
      },
      "Campaign": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "templateId": {
            "type": "string",
            "nullable": true
          },
          "recipientListId": {
            "type": "string",
            "nullable": true
          },
          "recipientCount": {
            "type": "number"
          },
          "sentCount": {
            "type": "number"
          },
          "deliveredCount": {
            "type": "number"
          },
          "readCount": {
            "type": "number"
          },
          "failedCount": {
            "type": "number"
          },
          "skippedCount": {
            "type": "number"
          },
          "scheduledAt": {
            "type": "number",
            "nullable": true
          },
          "launchedAt": {
            "type": "number",
            "nullable": true
          },
          "completedAt": {
            "type": "number",
            "nullable": true
          },
          "createdAt": {
            "type": "number"
          },
          "updatedAt": {
            "type": "number"
          }
        },
        "required": [
          "id",
          "name",
          "status",
          "templateId",
          "recipientListId",
          "recipientCount",
          "sentCount",
          "deliveredCount",
          "readCount",
          "failedCount",
          "skippedCount",
          "scheduledAt",
          "launchedAt",
          "completedAt",
          "createdAt",
          "updatedAt"
        ]
      },
      "ListCampaignsResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Campaign"
            }
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "GetCampaignResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/Campaign"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "CampaignAnalyticsResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "type": "object",
            "additionalProperties": {}
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "CreateCampaignResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/Campaign"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "CreateCampaignRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "templateId": {
            "type": "string"
          },
          "recipientListId": {
            "type": "string"
          },
          "senderConfig": {
            "type": "object",
            "additionalProperties": {}
          },
          "scheduledAt": {
            "type": "number"
          }
        },
        "required": [
          "name"
        ]
      },
      "CampaignOperation": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Campaign"
          },
          {
            "type": "object",
            "properties": {
              "operationId": {
                "type": "string",
                "format": "uuid"
              }
            },
            "required": [
              "operationId"
            ]
          }
        ]
      },
      "LaunchCampaignResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/CampaignOperation"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "LaunchCampaignRequest": {
        "type": "object",
        "properties": {
          "scheduledAt": {
            "type": "number"
          }
        }
      },
      "PauseCampaignResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/CampaignOperation"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "ResumeCampaignResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/CampaignOperation"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "StopCampaignResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/CampaignOperation"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "RequeueCampaignResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "type": "object",
            "additionalProperties": {}
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "RequeueCampaignRequest": {
        "type": "object",
        "properties": {
          "includeSkippedError": {
            "type": "boolean"
          }
        }
      },
      "EmbeddedSignupResult": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4096
          },
          "wabaId": {
            "type": "string",
            "pattern": "^\\d+$"
          },
          "phoneNumberId": {
            "type": "string",
            "pattern": "^\\d+$"
          },
          "coexistence": {
            "type": "boolean",
            "default": true
          },
          "historySync": {
            "type": "boolean",
            "default": false
          }
        },
        "required": [
          "code",
          "wabaId",
          "phoneNumberId"
        ],
        "additionalProperties": false
      },
      "EmbeddedSignupRequest": {
        "type": "object",
        "properties": {
          "session": {
            "type": "string",
            "minLength": 1
          },
          "projectId": {
            "type": "string",
            "format": "uuid"
          },
          "result": {
            "$ref": "#/components/schemas/EmbeddedSignupResult"
          },
          "metaApp": {
            "type": "object",
            "properties": {
              "appId": {
                "type": "string",
                "pattern": "^\\d+$"
              },
              "appSecret": {
                "type": "string",
                "minLength": 1
              }
            },
            "required": [
              "appId",
              "appSecret"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "session"
        ],
        "additionalProperties": false
      },
      "QuickLink": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Stable QuickLink identifier, prefixed `ql_`."
          },
          "url": {
            "type": "string",
            "description": "Hosted connection URL. Share it only with the person holding the phone."
          },
          "session": {
            "type": "string",
            "description": "Session name that receives the connected number."
          },
          "expiresAt": {
            "type": "string",
            "nullable": true,
            "description": "Null for new persistent QuickLinks. Legacy links retain their ISO-8601 expiry."
          }
        },
        "required": [
          "id",
          "url",
          "session",
          "expiresAt"
        ]
      },
      "QuickLinkResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/QuickLink"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "QuickLinkPerLinkSettings": {
        "type": "object",
        "properties": {
          "connectionPreference": {
            "type": "string",
            "enum": [
              "cloud",
              "linked",
              "both"
            ]
          },
          "connectionEnforcement": {
            "type": "string",
            "enum": [
              "prefer",
              "force"
            ]
          },
          "methods": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "qr",
                "pairing"
              ]
            },
            "minItems": 1,
            "maxItems": 2,
            "description": "Linked Devices methods for this link. The top-level `methods` field takes precedence when both are supplied."
          },
          "defaultMethod": {
            "type": "string",
            "nullable": true,
            "enum": [
              "qr",
              "pairing",
              null
            ],
            "description": "Linked Devices method opened first. Omit to inherit the saved project setting, or set null to choose by recipient device."
          },
          "allowPhoneChange": {
            "type": "boolean"
          },
          "businessName": {
            "type": "string",
            "maxLength": 120
          },
          "headline": {
            "type": "string",
            "maxLength": 80
          },
          "description": {
            "type": "string",
            "maxLength": 280
          },
          "successMessage": {
            "type": "string",
            "maxLength": 280
          },
          "supportUrl": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "pattern": "^[Hh][Tt][Tt][Pp][Ss]:\\/\\/[^@/?#]+(?:[/?#]|$)",
            "description": "HTTPS support URL for this link. Set null to clear the saved project URL."
          },
          "privacyUrl": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "pattern": "^[Hh][Tt][Tt][Pp][Ss]:\\/\\/[^@/?#]+(?:[/?#]|$)",
            "description": "HTTPS privacy policy URL for this link. Set null to clear the saved project URL."
          },
          "termsUrl": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "pattern": "^[Hh][Tt][Tt][Pp][Ss]:\\/\\/[^@/?#]+(?:[/?#]|$)",
            "description": "HTTPS terms URL for this link. Set null to clear the saved project URL."
          },
          "successCallbackUrl": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "pattern": "^[Hh][Tt][Tt][Pp][Ss]:\\/\\/[^@/?#]+(?:[/?#]|$)",
            "description": "HTTPS success callback for this link. Set null to clear the saved project callback."
          },
          "failureCallbackUrl": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "pattern": "^[Hh][Tt][Tt][Pp][Ss]:\\/\\/[^@/?#]+(?:[/?#]|$)",
            "description": "HTTPS failure callback for this link. Set null to clear the saved project callback."
          },
          "theme": {
            "type": "string",
            "enum": [
              "light",
              "dark",
              "system"
            ]
          },
          "accent": {
            "type": "string",
            "pattern": "^#[0-9A-Fa-f]{6}$"
          },
          "shape": {
            "type": "string",
            "enum": [
              "square",
              "rounded",
              "pill"
            ]
          },
          "historySync": {
            "type": "string",
            "enum": [
              "ask",
              "force_on",
              "force_off"
            ]
          }
        },
        "additionalProperties": false,
        "description": "Settings snapshotted for this link over the saved project defaults. Omit a setting to inherit it. Set `defaultMethod` to null to choose QR or pairing by recipient device. Empty page-copy strings clear saved copy; support, callback, privacy, and terms URL fields accept null to clear a saved project value. When both method fields are supplied, top-level `methods` takes precedence over `settings.methods`."
      },
      "CreateQuickLinkRequest": {
        "type": "object",
        "properties": {
          "projectId": {
            "type": "string",
            "format": "uuid",
            "description": "Project that receives the connected number. Required for organization keys with more than one project."
          },
          "customerId": {
            "type": "string",
            "format": "uuid",
            "description": "Customer that owns the connected number when Customers is enabled for the project."
          },
          "methods": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "qr",
                "pairing"
              ]
            },
            "minItems": 1,
            "maxItems": 2,
            "description": "Linked Devices methods offered on the hosted page. Takes precedence over `settings.methods`; otherwise defaults to `settings.methods`, the saved project settings, then both methods."
          },
          "externalId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "pattern": "^[^\\x00-\\x1f\\x7f]+$",
            "description": "Integrator correlation copied to the resulting session. May repeat across invitations; does not grant access."
          },
          "prefillPhone": {
            "type": "string",
            "pattern": "^\\+?\\d{6,15}$",
            "description": "Phone to prefill in international format. Creation attempts WhatsApp registration resolution; confirmed nonregistration is rejected, while an inconclusive result remains unknown."
          },
          "settings": {
            "$ref": "#/components/schemas/QuickLinkPerLinkSettings"
          }
        },
        "additionalProperties": false
      },
      "QuickLinkStatus": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "opened",
              "linked",
              "connected",
              "failed",
              "cancelled"
            ]
          },
          "session": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string",
            "nullable": true
          },
          "openedAt": {
            "type": "string",
            "nullable": true
          },
          "connectedAt": {
            "type": "string",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "nullable": true,
            "description": "Connected phone in E.164 once the link is connected."
          },
          "errorCode": {
            "type": "string",
            "nullable": true
          },
          "onboarding": {
            "type": "object",
            "nullable": true,
            "properties": {
              "stage": {
                "type": "string"
              },
              "connection": {
                "type": "string",
                "nullable": true
              },
              "coexistence": {
                "type": "boolean",
                "nullable": true
              },
              "contactsSync": {
                "type": "string"
              },
              "historySync": {
                "type": "string"
              },
              "historyProgress": {
                "type": "integer",
                "minimum": 0,
                "maximum": 100
              },
              "errorCode": {
                "type": "string",
                "nullable": true
              }
            },
            "required": [
              "stage",
              "connection",
              "coexistence",
              "contactsSync",
              "historySync",
              "historyProgress",
              "errorCode"
            ],
            "description": "Durable onboarding progress; omitted when the onboarding service is unavailable, null when no record exists."
          }
        },
        "required": [
          "id",
          "status",
          "session",
          "expiresAt",
          "openedAt",
          "connectedAt",
          "phone",
          "errorCode"
        ]
      },
      "QuickLinkStatusResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/QuickLinkStatus"
          }
        },
        "required": [
          "success",
          "data"
        ]
      },
      "PublicQuickLinkError": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ]
          },
          "data": {
            "type": "object",
            "properties": {
              "candidates": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "phone": {
                      "type": "string"
                    },
                    "whatsappPhone": {
                      "type": "string"
                    },
                    "registered": {
                      "type": "boolean",
                      "nullable": true,
                      "description": "Whether WhatsApp registration was confirmed. Null means the result is unknown."
                    },
                    "pushName": {
                      "type": "string",
                      "nullable": true
                    },
                    "pictureUrl": {
                      "type": "string",
                      "nullable": true
                    },
                    "accountType": {
                      "type": "string",
                      "enum": [
                        "whatsapp",
                        "business_app",
                        "cloud_api",
                        "coexistence",
                        "unknown",
                        "unregistered"
                      ]
                    }
                  },
                  "required": [
                    "phone",
                    "registered",
                    "pushName",
                    "pictureUrl"
                  ]
                }
              }
            },
            "required": [
              "candidates"
            ]
          }
        },
        "required": [
          "error"
        ]
      },
      "QuickLinkState": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "opened",
              "linked",
              "connected",
              "failed",
              "cancelled"
            ]
          },
          "expiresAt": {
            "type": "string",
            "nullable": true
          },
          "redirectUrl": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "description": "Snapshotted failure callback for a failed link. Omitted for non-failed states."
          },
          "connections": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "cloud",
                "linked"
              ]
            }
          },
          "selectedConnection": {
            "type": "string",
            "nullable": true,
            "enum": [
              "cloud",
              "linked",
              null
            ]
          },
          "connectionPreference": {
            "type": "string",
            "enum": [
              "cloud",
              "linked",
              "both"
            ]
          },
          "connectionEnforcement": {
            "type": "string",
            "enum": [
              "prefer",
              "force"
            ]
          },
          "cloud": {
            "type": "object",
            "nullable": true,
            "properties": {
              "appId": {
                "type": "string"
              },
              "configId": {
                "type": "string"
              }
            },
            "required": [
              "appId",
              "configId"
            ]
          },
          "onboarding": {
            "type": "object",
            "nullable": true,
            "properties": {
              "stage": {
                "type": "string"
              },
              "connection": {
                "type": "string",
                "nullable": true
              },
              "coexistence": {
                "type": "boolean",
                "nullable": true
              },
              "contactsSync": {
                "type": "string"
              },
              "historySync": {
                "type": "string"
              },
              "historyProgress": {
                "type": "integer",
                "minimum": 0,
                "maximum": 100
              },
              "errorCode": {
                "type": "string",
                "nullable": true
              }
            },
            "required": [
              "stage",
              "connection",
              "coexistence",
              "contactsSync",
              "historySync",
              "historyProgress",
              "errorCode"
            ]
          },
          "methods": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "qr",
                "pairing"
              ]
            }
          },
          "defaultMethod": {
            "type": "string",
            "nullable": true,
            "enum": [
              "qr",
              "pairing",
              null
            ]
          },
          "businessName": {
            "type": "string"
          },
          "headline": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "successMessage": {
            "type": "string",
            "nullable": true
          },
          "supportUrl": {
            "type": "string",
            "nullable": true
          },
          "privacyUrl": {
            "type": "string",
            "nullable": true
          },
          "termsUrl": {
            "type": "string",
            "nullable": true
          },
          "theme": {
            "type": "string",
            "enum": [
              "light",
              "dark",
              "system"
            ]
          },
          "accent": {
            "type": "string",
            "nullable": true
          },
          "shape": {
            "type": "string",
            "nullable": true,
            "enum": [
              "square",
              "rounded",
              "pill",
              null
            ]
          },
          "radiusPx": {
            "type": "number",
            "nullable": true
          },
          "logoUrl": {
            "type": "string",
            "nullable": true
          },
          "hideWatermark": {
            "type": "boolean"
          },
          "historySync": {
            "type": "string",
            "enum": [
              "ask",
              "force_on",
              "force_off"
            ]
          },
          "phoneStep": {
            "type": "object",
            "properties": {
              "confirmed": {
                "type": "boolean"
              },
              "allowChange": {
                "type": "boolean"
              },
              "noNumber": {
                "type": "boolean"
              },
              "allowNoNumber": {
                "type": "boolean"
              }
            },
            "required": [
              "confirmed",
              "allowChange",
              "noNumber",
              "allowNoNumber"
            ]
          },
          "prefillPhone": {
            "type": "string",
            "nullable": true
          },
          "phoneIdentity": {
            "type": "object",
            "nullable": true,
            "properties": {
              "registered": {
                "type": "boolean",
                "nullable": true,
                "description": "Whether WhatsApp registration was confirmed. Null means the result is unknown."
              },
              "phone": {
                "type": "string"
              },
              "whatsappPhone": {
                "type": "string",
                "nullable": true
              },
              "accountType": {
                "type": "string",
                "enum": [
                  "whatsapp",
                  "business_app",
                  "cloud_api",
                  "coexistence",
                  "unknown",
                  "unregistered"
                ]
              },
              "pushName": {
                "type": "string",
                "nullable": true
              },
              "pictureUrl": {
                "type": "string",
                "nullable": true,
                "format": "uri"
              }
            },
            "required": [
              "registered",
              "phone",
              "whatsappPhone",
              "accountType",
              "pushName",
              "pictureUrl"
            ]
          },
          "customer": {
            "type": "boolean",
            "description": "True when the link assigns the number to a Customer."
          },
          "session": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string"
              },
              "phone": {
                "type": "string",
                "nullable": true
              }
            },
            "required": [
              "status",
              "phone"
            ]
          },
          "qrSvg": {
            "type": "string",
            "nullable": true,
            "description": "Inline SVG of the current WhatsApp QR code, when the QR method is offered and the number is not linked yet."
          },
          "errorCode": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "id",
          "status",
          "expiresAt",
          "connections",
          "selectedConnection",
          "connectionPreference",
          "connectionEnforcement",
          "cloud",
          "onboarding",
          "methods",
          "defaultMethod",
          "businessName",
          "headline",
          "description",
          "successMessage",
          "supportUrl",
          "privacyUrl",
          "termsUrl",
          "theme",
          "accent",
          "shape",
          "radiusPx",
          "logoUrl",
          "hideWatermark",
          "historySync",
          "phoneStep",
          "prefillPhone",
          "phoneIdentity",
          "customer",
          "session",
          "qrSvg",
          "errorCode"
        ]
      },
      "QuickLinkCodeRequest": {
        "type": "object",
        "properties": {
          "phone": {
            "type": "string",
            "minLength": 6,
            "maxLength": 20
          }
        },
        "required": [
          "phone"
        ]
      },
      "QuickLinkConfirmRequest": {
        "type": "object",
        "properties": {
          "historySync": {
            "type": "boolean"
          }
        }
      }
    },
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Polymorfa organization key (pmfa_ prefix), project token (pmfa_pt_ prefix) where supported, or short-lived client token (pmfa_ct_ prefix). Organization and project keys may be personal or service-account owned and enforce selected action scopes. Organization keys cover the team and its projects; project tokens stay inside one project. Client tokens stay inside their live project and session and enforce their client rules."
      }
    }
  },
  "paths": {
    "/ping": {
      "get": {
        "operationId": "ping",
        "tags": [
          "Health"
        ],
        "summary": "Liveness probe",
        "security": [],
        "responses": {
          "200": {
            "description": "Pong",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PingResponse"
                }
              }
            }
          }
        }
      }
    },
    "/health": {
      "get": {
        "operationId": "getHealth",
        "tags": [
          "Health"
        ],
        "summary": "Full service health check",
        "security": [],
        "responses": {
          "200": {
            "description": "Required readiness checks pass; optional diagnostics may report degraded or in-progress state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthResponse"
                }
              }
            }
          },
          "503": {
            "description": "One or more services unhealthy or draining",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthResponse"
                }
              }
            }
          }
        }
      }
    },
    "/messaging/info/version": {
      "get": {
        "operationId": "getVersion",
        "tags": [
          "Info"
        ],
        "summary": "Get API version info",
        "security": [],
        "responses": {
          "200": {
            "description": "Version info",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VersionResponse"
                }
              }
            }
          }
        }
      }
    },
    "/messaging/info/status": {
      "get": {
        "operationId": "getStatus",
        "tags": [
          "Info"
        ],
        "summary": "Get API runtime status",
        "security": [],
        "responses": {
          "200": {
            "description": "Status info",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatusResponse"
                }
              }
            }
          }
        }
      }
    },
    "/messaging/bridge/route": {
      "get": {
        "operationId": "getBridgeRoute",
        "x-required-scope": "bridge:connect",
        "tags": [
          "Bridge"
        ],
        "summary": "Verify a project token, resolve live project authority, and return the regional WSS endpoint.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "wsUrl": {
                      "type": "string",
                      "format": "uri"
                    },
                    "region": {
                      "type": "string",
                      "enum": [
                        "BR",
                        "US",
                        "IN",
                        "Auto"
                      ]
                    },
                    "kind": {
                      "type": "string",
                      "enum": [
                        "sandbox",
                        "production"
                      ]
                    },
                    "signal": {
                      "type": "string",
                      "enum": [
                        "customer",
                        "bartender"
                      ]
                    },
                    "tokenKind": {
                      "type": "string",
                      "enum": [
                        "project"
                      ]
                    },
                    "expiresAt": {
                      "type": "integer",
                      "minimum": 0
                    }
                  },
                  "required": [
                    "wsUrl",
                    "region",
                    "kind",
                    "signal",
                    "tokenKind",
                    "expiresAt"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "503": {
            "description": "Service unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "service_unavailable",
                    "message": "A required service is unavailable. Check completion before repeating a write.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#service-unavailable"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">bridge:connect</Badge>"
        },
        "description": "**Required scope:** `bridge:connect`"
      }
    },
    "/messaging/client-tokens": {
      "post": {
        "operationId": "mintClientToken",
        "tags": [
          "Client Tokens"
        ],
        "summary": "Mint a short-lived browser-safe client token",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scopes": [
          "sessions:manage",
          "messages:write",
          "contacts:read",
          "presence:read",
          "presence:observe",
          "mcp"
        ],
        "x-required-scope-mode": "all",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MintClientTokenRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Token minted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MintClientTokenResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">sessions:manage</Badge> <Badge color=\"yellow\" icon=\"key\">messages:write</Badge> <Badge color=\"yellow\" icon=\"key\">contacts:read</Badge> <Badge color=\"yellow\" icon=\"key\">presence:read</Badge> <Badge color=\"yellow\" icon=\"key\">presence:observe</Badge> <Badge color=\"yellow\" icon=\"key\">mcp</Badge>"
        },
        "description": "**Required scopes (all):** `sessions:manage` · `messages:write` · `contacts:read` · `presence:read` · `presence:observe` · `mcp`"
      }
    },
    "/messaging/sessions/{session}/client-rules": {
      "get": {
        "operationId": "getClientRules",
        "tags": [
          "Client Tokens"
        ],
        "summary": "Get client-token rules for a session",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "sessions:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Client rules",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetClientRulesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">sessions:manage</Badge>"
        },
        "description": "**Required scope:** `sessions:manage`"
      },
      "put": {
        "operationId": "setClientRules",
        "tags": [
          "Client Tokens"
        ],
        "summary": "Set client-token rules for a session",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scopes": [
          "sessions:manage",
          "messages:write",
          "contacts:read",
          "presence:read",
          "presence:observe",
          "mcp"
        ],
        "x-required-scope-mode": "all",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetClientRulesRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Rules saved",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">sessions:manage</Badge> <Badge color=\"yellow\" icon=\"key\">messages:write</Badge> <Badge color=\"yellow\" icon=\"key\">contacts:read</Badge> <Badge color=\"yellow\" icon=\"key\">presence:read</Badge> <Badge color=\"yellow\" icon=\"key\">presence:observe</Badge> <Badge color=\"yellow\" icon=\"key\">mcp</Badge>"
        },
        "description": "**Required scopes (all):** `sessions:manage` · `messages:write` · `contacts:read` · `presence:read` · `presence:observe` · `mcp`"
      },
      "delete": {
        "operationId": "deleteClientRules",
        "tags": [
          "Client Tokens"
        ],
        "summary": "Delete client-token rules for a session",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "sessions:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Rules deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">sessions:manage</Badge>"
        },
        "description": "**Required scope:** `sessions:manage`"
      }
    },
    "/messaging/features/evaluate": {
      "post": {
        "operationId": "evaluateFeatures",
        "tags": [
          "Features"
        ],
        "summary": "Evaluate feature availability",
        "description": "Returns feature decisions for the authenticated organization or project. Client credentials cannot access this operation. Machine requests do not record experiment exposure.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "surface": {
                    "type": "string",
                    "maxLength": 100,
                    "pattern": "^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*$"
                  },
                  "keys": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 100,
                      "pattern": "^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*$"
                    },
                    "maxItems": 50
                  },
                  "measurementAllowed": {
                    "type": "boolean",
                    "default": false
                  }
                },
                "required": [
                  "surface",
                  "keys"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Feature decisions",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "decision": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string",
                                "maxLength": 100,
                                "pattern": "^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*$"
                              },
                              "version": {
                                "type": "integer"
                              },
                              "available": {
                                "type": "boolean"
                              },
                              "enrolled": {
                                "type": "boolean"
                              },
                              "variant": {
                                "type": "string",
                                "nullable": true
                              },
                              "experimentAssigned": {
                                "type": "boolean"
                              }
                            },
                            "required": [
                              "key",
                              "version",
                              "available",
                              "enrolled",
                              "variant",
                              "experimentAssigned"
                            ]
                          },
                          "title": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "termsRevision": {
                            "type": "string",
                            "nullable": true
                          },
                          "withdrawal": {
                            "type": "string",
                            "nullable": true
                          },
                          "exposureToken": {}
                        },
                        "required": [
                          "decision",
                          "title",
                          "description",
                          "termsRevision",
                          "withdrawal",
                          "exposureToken"
                        ]
                      }
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid feature request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Credential cannot access feature evaluation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "413": {
            "description": "Request exceeds 16 KiB",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          }
        }
      }
    },
    "/messaging/sessions": {
      "get": {
        "operationId": "listSessions",
        "tags": [
          "Sessions"
        ],
        "summary": "List all sessions for the tenant",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "sessions:read",
        "responses": {
          "200": {
            "description": "Session list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListSessionsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">sessions:read</Badge>"
        },
        "description": "**Required scope:** `sessions:read`"
      }
    },
    "/messaging/sessions/{projectId}/": {
      "post": {
        "operationId": "createSession",
        "tags": [
          "Sessions"
        ],
        "summary": "Create a new session",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "sessions:manage",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "description": "Project that owns the session."
            },
            "required": true,
            "name": "projectId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSessionRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Session created; a testing session is connected and command-ready before this response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateSessionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "409": {
            "description": "Session with this name already exists",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "conflict_error",
                    "code": "state_conflict",
                    "message": "The request conflicts with the resource state.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#state-conflict"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">sessions:manage</Badge>"
        },
        "description": "**Required scope:** `sessions:manage`"
      }
    },
    "/messaging/sessions/{session}": {
      "get": {
        "operationId": "getSession",
        "tags": [
          "Sessions"
        ],
        "summary": "Get session details",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "sessions:read",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Session details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetSessionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">sessions:read</Badge>"
        },
        "description": "**Required scope:** `sessions:read`"
      },
      "put": {
        "operationId": "updateSession",
        "tags": [
          "Sessions"
        ],
        "summary": "Update session configuration",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "sessions:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSessionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Session updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateSessionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          },
          "503": {
            "description": "Session configuration was stored but the connected runner did not acknowledge it",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "service_unavailable",
                    "message": "A required service is unavailable. Check completion before repeating a write.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#service-unavailable"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">sessions:manage</Badge>"
        },
        "description": "**Required scope:** `sessions:manage`"
      },
      "delete": {
        "operationId": "deleteSession",
        "tags": [
          "Sessions"
        ],
        "summary": "Delete a session",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "sessions:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Testing session deleted immediately after its simulated runtime closes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OperationAccepted"
                }
              }
            }
          },
          "202": {
            "description": "Session deletion scheduled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OperationAccepted"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">sessions:manage</Badge>"
        },
        "description": "**Required scope:** `sessions:manage`"
      }
    },
    "/messaging/sessions/{session}/start": {
      "post": {
        "operationId": "startSession",
        "tags": [
          "Sessions"
        ],
        "summary": "Start a session (connect to WhatsApp)",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "sessions:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          }
        ],
        "responses": {
          "202": {
            "description": "Testing-session state changed immediately, or production-session start scheduled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OperationAccepted"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">sessions:manage</Badge>"
        },
        "description": "**Required scope:** `sessions:manage`"
      }
    },
    "/messaging/sessions/{session}/stop": {
      "post": {
        "operationId": "stopSession",
        "tags": [
          "Sessions"
        ],
        "summary": "Stop a session",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "sessions:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          }
        ],
        "responses": {
          "202": {
            "description": "Testing session stopped after backend teardown, or production-session stop scheduled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OperationAccepted"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">sessions:manage</Badge>"
        },
        "description": "**Required scope:** `sessions:manage`"
      }
    },
    "/messaging/sessions/{session}/restart": {
      "post": {
        "operationId": "restartSession",
        "tags": [
          "Sessions"
        ],
        "summary": "Restart a session",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "sessions:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          }
        ],
        "responses": {
          "202": {
            "description": "Testing session reconnected and ready, or production-session restart scheduled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OperationAccepted"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">sessions:manage</Badge>"
        },
        "description": "**Required scope:** `sessions:manage`"
      }
    },
    "/messaging/sessions/{session}/logout": {
      "post": {
        "operationId": "logoutSession",
        "tags": [
          "Sessions"
        ],
        "summary": "Log the session out of WhatsApp",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "sessions:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          }
        ],
        "responses": {
          "202": {
            "description": "Session logout scheduled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OperationAccepted"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">sessions:manage</Badge>"
        },
        "description": "**Required scope:** `sessions:manage`"
      }
    },
    "/messaging/sessions/{session}/me": {
      "get": {
        "operationId": "getSessionAccount",
        "tags": [
          "Sessions"
        ],
        "summary": "Get the connected WhatsApp account info",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "sessions:read",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Account info",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetSessionAccountResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">sessions:read</Badge>"
        },
        "description": "**Required scope:** `sessions:read`"
      }
    },
    "/messaging/sessions/{session}/handoff-keys": {
      "post": {
        "operationId": "sessionHandoffKeys",
        "tags": [
          "Sessions"
        ],
        "summary": "Initiate M↔P toggle: fetch the destination Curve25519 pubkey",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "sessions:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Destination pubkey + correlation id for the handoff",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HandoffKeysSuccess"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">sessions:manage</Badge>"
        },
        "description": "**Required scope:** `sessions:manage`"
      }
    },
    "/messaging/sessions/{session}/handoff-import": {
      "post": {
        "operationId": "sessionHandoffImport",
        "tags": [
          "Sessions"
        ],
        "summary": "Ship a sealed SignalStoreSnapshot from customer Baileys to the runner",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "sessions:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HandoffImportRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Import accepted; bartenderMode will flip after the runner acks",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HandoffImportSuccess"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">sessions:manage</Badge>"
        },
        "description": "**Required scope:** `sessions:manage`"
      }
    },
    "/messaging/sessions/{session}/upload-appstate-keys": {
      "post": {
        "operationId": "sessionUploadAppStateKeys",
        "tags": [
          "Sessions"
        ],
        "summary": "Upload selected AppStateSyncKeys (Track P+ tier)",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "sessions:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UploadAppStateKeysRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Keys persisted; mode may have been flipped per upgradeTo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UploadAppStateKeysSuccess"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">sessions:manage</Badge>"
        },
        "description": "**Required scope:** `sessions:manage`"
      }
    },
    "/messaging/sessions/{session}/handoff-ack": {
      "post": {
        "operationId": "sessionHandoffAck",
        "tags": [
          "Sessions"
        ],
        "summary": "Acknowledge receipt of an M→P export; API flips bartenderMode after hash verify",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "sessions:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HandoffAckRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Ack accepted; bartenderMode flipped from magic → passthrough",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HandoffAckSuccess"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">sessions:manage</Badge>"
        },
        "description": "**Required scope:** `sessions:manage`"
      }
    },
    "/messaging/{session}/pair/qr": {
      "get": {
        "operationId": "getQRCode",
        "tags": [
          "Pairing"
        ],
        "summary": "Get QR code for device pairing",
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `sessions:manage`\n\nEnterprise only. Your team must have direct-pairing access enabled. Use [QuickLink](/integrations/quicklink) for standard connections. Requests without direct-pairing access return 403.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "sessions:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "image"
              ],
              "default": "json"
            },
            "required": false,
            "name": "format",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "QR code data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetQRCodeResponse"
                }
              },
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Enterprise direct-pairing access is required. Use QuickLink for standard connections.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">sessions:manage</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ]
      }
    },
    "/messaging/{session}/pair/code": {
      "post": {
        "operationId": "requestPairCode",
        "tags": [
          "Pairing"
        ],
        "summary": "Request a pairing code for a phone number",
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `sessions:manage`\n\nEnterprise only. Your team must have direct-pairing access enabled. Use [QuickLink](/integrations/quicklink) for standard connections. Requests without direct-pairing access return 403.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "sessions:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PairCodeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Pairing code issued",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RequestPairCodeResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Enterprise direct-pairing access is required. Use QuickLink for standard connections.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">sessions:manage</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ]
      }
    },
    "/messaging/{session}/messages/send": {
      "post": {
        "operationId": "sendMessage",
        "tags": [
          "Messages"
        ],
        "summary": "Send a message",
        "description": "**Protocols:** Linked Device API · Meta Cloud API · Polymorfa Hybrid Link\n\n**Required scope:** `messages:write`\n\nSend a message to a conversation. Put exactly one message kind inside content. Testing sessions send only to active testing numbers in the same project; supply the recipient phoneNumber.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "messages:write",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendMessageRequest"
              },
              "example": {
                "conversation": {
                  "phoneNumber": "+15550001111"
                },
                "content": {
                  "text": "Hello"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Message sent successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendMessageResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted for asynchronous processing in response to `Prefer: respond-async`; the result is not included",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AsyncAcceptedResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope or resource access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "422": {
            "description": "The supplied media URL could not be fetched",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected service failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          },
          "502": {
            "description": "Messaging provider failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "upstream_error",
                    "code": "upstream_failure",
                    "message": "The messaging provider could not complete the request.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#upstream-failure"
                }
              }
            }
          },
          "503": {
            "description": "Session or service unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "service_unavailable",
                    "message": "A required service is unavailable. Check completion before repeating a write.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#service-unavailable"
                }
              }
            }
          },
          "504": {
            "description": "Result unknown after timeout",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "result_unknown",
                    "message": "The result was not obtained before the deadline. Check completion before repeating a write.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#result-unknown"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"blue\" icon=\"meta\" iconType=\"brands\">Meta Cloud API</Badge> <Badge color=\"purple\" icon=\"shuffle\">Polymorfa Hybrid Link</Badge> <Badge color=\"yellow\" icon=\"key\">messages:write</Badge>"
        },
        "x-protocols": [
          "Linked Device API",
          "Meta Cloud API",
          "Polymorfa Hybrid Link"
        ]
      }
    },
    "/messaging/{session}/messages/seen": {
      "post": {
        "operationId": "sendSeen",
        "tags": [
          "Messages"
        ],
        "summary": "Mark messages as seen",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "messages:write",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SeenRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Seen marker confirmed by the messaging backend",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageActionResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted for asynchronous processing in response to `Prefer: respond-async`; the result is not included",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AsyncAcceptedResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope or resource access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected service failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          },
          "502": {
            "description": "Messaging provider failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "upstream_error",
                    "code": "upstream_failure",
                    "message": "The messaging provider could not complete the request.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#upstream-failure"
                }
              }
            }
          },
          "503": {
            "description": "Session or service unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "service_unavailable",
                    "message": "A required service is unavailable. Check completion before repeating a write.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#service-unavailable"
                }
              }
            }
          },
          "504": {
            "description": "Result unknown after timeout",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "result_unknown",
                    "message": "The result was not obtained before the deadline. Check completion before repeating a write.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#result-unknown"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"blue\" icon=\"meta\" iconType=\"brands\">Meta Cloud API</Badge> <Badge color=\"purple\" icon=\"shuffle\">Polymorfa Hybrid Link</Badge> <Badge color=\"yellow\" icon=\"key\">messages:write</Badge>"
        },
        "x-protocols": [
          "Linked Device API",
          "Meta Cloud API",
          "Polymorfa Hybrid Link"
        ],
        "description": "**Protocols:** Linked Device API · Meta Cloud API · Polymorfa Hybrid Link\n\n**Required scope:** `messages:write`"
      }
    },
    "/messaging/{session}/messages/typing": {
      "post": {
        "operationId": "setTyping",
        "tags": [
          "Messages"
        ],
        "summary": "Set typing indicator for a chat",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "messages:write",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TypingRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Typing state confirmed by the messaging backend",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageActionResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted for asynchronous processing in response to `Prefer: respond-async`; the result is not included",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AsyncAcceptedResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope or resource access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected service failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          },
          "502": {
            "description": "Messaging provider failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "upstream_error",
                    "code": "upstream_failure",
                    "message": "The messaging provider could not complete the request.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#upstream-failure"
                }
              }
            }
          },
          "503": {
            "description": "Session or service unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "service_unavailable",
                    "message": "A required service is unavailable. Check completion before repeating a write.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#service-unavailable"
                }
              }
            }
          },
          "504": {
            "description": "Result unknown after timeout",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "result_unknown",
                    "message": "The result was not obtained before the deadline. Check completion before repeating a write.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#result-unknown"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">messages:write</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `messages:write`"
      }
    },
    "/messaging/{session}/messages/react": {
      "post": {
        "operationId": "sendReaction",
        "tags": [
          "Messages"
        ],
        "summary": "React to a message",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "messages:write",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReactRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Reaction sent",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendReactionResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted for asynchronous processing in response to `Prefer: respond-async`; the result is not included",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AsyncAcceptedResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope or resource access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected service failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          },
          "502": {
            "description": "Messaging provider failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "upstream_error",
                    "code": "upstream_failure",
                    "message": "The messaging provider could not complete the request.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#upstream-failure"
                }
              }
            }
          },
          "503": {
            "description": "Session or service unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "service_unavailable",
                    "message": "A required service is unavailable. Check completion before repeating a write.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#service-unavailable"
                }
              }
            }
          },
          "504": {
            "description": "Result unknown after timeout",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "result_unknown",
                    "message": "The result was not obtained before the deadline. Check completion before repeating a write.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#result-unknown"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"blue\" icon=\"meta\" iconType=\"brands\">Meta Cloud API</Badge> <Badge color=\"purple\" icon=\"shuffle\">Polymorfa Hybrid Link</Badge> <Badge color=\"yellow\" icon=\"key\">messages:write</Badge>"
        },
        "x-protocols": [
          "Linked Device API",
          "Meta Cloud API",
          "Polymorfa Hybrid Link"
        ],
        "description": "**Protocols:** Linked Device API · Meta Cloud API · Polymorfa Hybrid Link\n\n**Required scope:** `messages:write`"
      }
    },
    "/messaging/{session}/messages/star": {
      "post": {
        "operationId": "starMessage",
        "tags": [
          "Messages"
        ],
        "summary": "Star or unstar a message",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "messages:write",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StarRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Star status updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageActionResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted for asynchronous processing in response to `Prefer: respond-async`; the result is not included",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AsyncAcceptedResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope or resource access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected service failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          },
          "502": {
            "description": "Messaging provider failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "upstream_error",
                    "code": "upstream_failure",
                    "message": "The messaging provider could not complete the request.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#upstream-failure"
                }
              }
            }
          },
          "503": {
            "description": "Session or service unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "service_unavailable",
                    "message": "A required service is unavailable. Check completion before repeating a write.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#service-unavailable"
                }
              }
            }
          },
          "504": {
            "description": "Result unknown after timeout",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "result_unknown",
                    "message": "The result was not obtained before the deadline. Check completion before repeating a write.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#result-unknown"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">messages:write</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `messages:write`"
      }
    },
    "/messaging/{session}/chats/{conversation}/messages/{messageId}": {
      "put": {
        "operationId": "editMessage",
        "tags": [
          "Chats"
        ],
        "summary": "Edit a previously sent message",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "chats:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "conversation",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,18}$"
            },
            "required": true,
            "name": "messageId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EditMessageRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Message edited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">chats:manage</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `chats:manage`"
      },
      "delete": {
        "operationId": "deleteMessage",
        "tags": [
          "Chats"
        ],
        "summary": "Delete a previously sent message",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "chats:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "conversation",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,18}$"
            },
            "required": true,
            "name": "messageId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Message deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">chats:manage</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `chats:manage`"
      }
    },
    "/messaging/{session}/chats/{conversation}/archive": {
      "post": {
        "operationId": "archiveChat",
        "tags": [
          "Chats"
        ],
        "summary": "Archive a chat",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "chats:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "conversation",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Chat archived",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">chats:manage</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `chats:manage`"
      }
    },
    "/messaging/{session}/chats/{conversation}/unarchive": {
      "post": {
        "operationId": "unarchiveChat",
        "tags": [
          "Chats"
        ],
        "summary": "Unarchive a chat",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "chats:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "conversation",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Chat unarchived",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">chats:manage</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `chats:manage`"
      }
    },
    "/messaging/{session}/chats/{conversation}/disappearing": {
      "put": {
        "operationId": "setChatDisappearingTimer",
        "tags": [
          "Chats"
        ],
        "summary": "Set the disappearing-message timer for a chat",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "chats:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "conversation",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DisappearingTimerRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Disappearing-message timer updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">chats:manage</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `chats:manage`"
      }
    },
    "/messaging/{session}/calls/{callId}/reject": {
      "post": {
        "operationId": "rejectCall",
        "tags": [
          "Calls"
        ],
        "summary": "Reject an incoming WhatsApp call",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "chats:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "required": true,
            "name": "callId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RejectCallRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Call rejected",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">chats:manage</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `chats:manage`"
      }
    },
    "/messaging/voip/calls/{id}/offer": {
      "post": {
        "operationId": "voipOffer",
        "tags": [
          "VoIP"
        ],
        "summary": "Submit an SDP offer and receive the pod's answer + ICE servers",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "sessions:manage",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "example": "call-123"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VoipOfferRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "SDP answer with STUN/TURN ICE servers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoipOfferResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "409": {
            "description": "Call not ready — no media session on the owning pod yet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "conflict_error",
                    "code": "state_conflict",
                    "message": "The request conflicts with the resource state.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#state-conflict"
                }
              }
            }
          },
          "410": {
            "description": "Call ended — the pod that owned its media is gone (pod_lost)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_gone",
                    "message": "The requested retained resource has expired or was removed.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-gone"
                }
              }
            }
          },
          "429": {
            "description": "Call setup rate exceeded for this client token, or its concurrency limit is reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "rate_limit_error",
                    "code": "rate_limit_exceeded",
                    "message": "The request limit was reached. Follow Retry-After when supplied.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#rate-limit-exceeded"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          },
          "503": {
            "description": "Call unavailable — the owning pod is at capacity or draining, or call authority cannot be verified",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "service_unavailable",
                    "message": "A required service is unavailable. Check completion before repeating a write.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#service-unavailable"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">sessions:manage</Badge>"
        },
        "description": "**Required scope:** `sessions:manage`"
      }
    },
    "/messaging/voip/calls/{id}/renegotiate": {
      "post": {
        "operationId": "voipRenegotiate",
        "tags": [
          "VoIP"
        ],
        "summary": "Re-offer on an established call (add video, restart ICE) and receive the pod's answer",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "sessions:manage",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "example": "call-123"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VoipRenegotiateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "SDP answer for the re-offer, on the same peer connection",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoipRenegotiateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "409": {
            "description": "Call not ready — no media session on the owning pod yet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "conflict_error",
                    "code": "state_conflict",
                    "message": "The request conflicts with the resource state.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#state-conflict"
                }
              }
            }
          },
          "410": {
            "description": "Call ended — the pod that owned its media is gone (pod_lost)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_gone",
                    "message": "The requested retained resource has expired or was removed.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-gone"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          },
          "503": {
            "description": "Call unavailable — the owning pod is at capacity or draining, or call authority cannot be verified",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "service_unavailable",
                    "message": "A required service is unavailable. Check completion before repeating a write.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#service-unavailable"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">sessions:manage</Badge>"
        },
        "description": "**Required scope:** `sessions:manage`"
      }
    },
    "/messaging/voip/ws-ticket": {
      "post": {
        "operationId": "voipSocketTicket",
        "tags": [
          "VoIP"
        ],
        "summary": "Mint a single-use ticket for the calls WebSocket",
        "description": "**Required scope:** `sessions:manage`\n\nBrowsers cannot send an Authorization header on a WebSocket upgrade, so the calls socket (`GET /voip/ws?ticket=…`) is opened with a ticket obtained here. Tickets are single-use and expire after 60 seconds. Client tokens are bound to their session; server keys must name one.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "sessions:manage",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VoipSocketTicketRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Ticket minted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoipSocketTicketResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">sessions:manage</Badge>"
        }
      }
    },
    "/messaging/voip/calls/{id}/agent-token": {
      "post": {
        "operationId": "voipAgentToken",
        "tags": [
          "VoIP"
        ],
        "summary": "Mint a per-call ticket for a voice agent's media WebSocket",
        "description": "**Required scope:** `sessions:manage`\n\nServer keys only. The ticket is bound to this call, expires after `ttlSeconds` (default 300, max 3600) and is presented by the agent to the voip pod as `Authorization: Bearer <token>`. It grants nothing else.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "sessions:manage",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "example": "call-123"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VoipAgentTokenRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Agent ticket minted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoipAgentTokenResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "409": {
            "description": "Call not ready — no media session on the owning pod yet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "conflict_error",
                    "code": "state_conflict",
                    "message": "The request conflicts with the resource state.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#state-conflict"
                }
              }
            }
          },
          "410": {
            "description": "Call ended — the pod that owned its media is gone (pod_lost)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_gone",
                    "message": "The requested retained resource has expired or was removed.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-gone"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          },
          "503": {
            "description": "Call unavailable — the owning pod is at capacity or draining, or call authority cannot be verified",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "service_unavailable",
                    "message": "A required service is unavailable. Check completion before repeating a write.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#service-unavailable"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">sessions:manage</Badge>"
        }
      }
    },
    "/messaging/voip/calls": {
      "post": {
        "operationId": "voipPlaceCall",
        "tags": [
          "VoIP"
        ],
        "summary": "Place an outbound call from a session",
        "description": "**Required scope:** `sessions:manage`\n\nOriginates a WhatsApp call to `to` (an E.164 phone number or a user ID) from the named session. The call rings on the callee's device: `call.accepted` follows when they pick up and `call.ended` when either side hangs up. Attach media like any other call — `/offer` for a browser, the SDK media socket for programmatic audio/video. Client tokens place from their bound session; server keys must name one. Outbound starts share a rate limit per organization and source session across server keys and client tokens; client-token rules also apply.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "sessions:manage",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VoipPlaceCallRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Call placed and ringing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoipPlacedCallResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "409": {
            "description": "Session not ready — the named session cannot place an outbound call yet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "conflict_error",
                    "code": "state_conflict",
                    "message": "The request conflicts with the resource state.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#state-conflict"
                }
              }
            }
          },
          "410": {
            "description": "Call ended — the pod that owned its media is gone (pod_lost)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_gone",
                    "message": "The requested retained resource has expired or was removed.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-gone"
                }
              }
            }
          },
          "429": {
            "description": "Outbound call rate exceeded for this organization and source session, or a client-token setup or concurrency limit was reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "rate_limit_error",
                    "code": "rate_limit_exceeded",
                    "message": "The request limit was reached. Follow Retry-After when supplied.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#rate-limit-exceeded"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          },
          "501": {
            "description": "Outbound calls are not available on this deployment",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "operation_not_supported",
                    "message": "This operation is not supported.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#operation-not-supported"
                }
              }
            }
          },
          "503": {
            "description": "Call unavailable — the owning pod is at capacity or draining, or call authority cannot be verified",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "service_unavailable",
                    "message": "A required service is unavailable. Check completion before repeating a write.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#service-unavailable"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">sessions:manage</Badge>"
        }
      }
    },
    "/messaging/voip/calls/{id}/accept": {
      "post": {
        "operationId": "voipAcceptCall",
        "tags": [
          "VoIP"
        ],
        "summary": "Answer a ringing inbound call",
        "description": "**Required scope:** `sessions:manage`\n\nAnswers a call the pod is holding for the SDK (sessions in `sdk` client mode ring instead of auto-answering). 409 when the call is not ringing — already answered, ended, or hosted by a session that auto-answers.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "sessions:manage",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "example": "call-123"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VoipAcceptCallRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Call answered",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "409": {
            "description": "Call not ready — no media session on the owning pod yet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "conflict_error",
                    "code": "state_conflict",
                    "message": "The request conflicts with the resource state.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#state-conflict"
                }
              }
            }
          },
          "410": {
            "description": "Call ended — the pod that owned its media is gone (pod_lost)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_gone",
                    "message": "The requested retained resource has expired or was removed.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-gone"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          },
          "503": {
            "description": "Call unavailable — the owning pod is at capacity or draining, or call authority cannot be verified",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "service_unavailable",
                    "message": "A required service is unavailable. Check completion before repeating a write.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#service-unavailable"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">sessions:manage</Badge>"
        }
      }
    },
    "/messaging/voip/calls/{id}/reject": {
      "post": {
        "operationId": "voipRejectCall",
        "tags": [
          "VoIP"
        ],
        "summary": "Decline a ringing inbound call",
        "description": "**Required scope:** `sessions:manage`\n\nDeclines a call the pod is holding for the SDK and releases it. 409 when the call is not ringing.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "sessions:manage",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "example": "call-123"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "202": {
            "description": "Call declined",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "409": {
            "description": "Call not ready — no media session on the owning pod yet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "conflict_error",
                    "code": "state_conflict",
                    "message": "The request conflicts with the resource state.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#state-conflict"
                }
              }
            }
          },
          "410": {
            "description": "Call ended — the pod that owned its media is gone (pod_lost)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_gone",
                    "message": "The requested retained resource has expired or was removed.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-gone"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          },
          "503": {
            "description": "Call unavailable — the owning pod is at capacity or draining, or call authority cannot be verified",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "service_unavailable",
                    "message": "A required service is unavailable. Check completion before repeating a write.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#service-unavailable"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">sessions:manage</Badge>"
        }
      }
    },
    "/messaging/voip/calls/{id}/participants": {
      "post": {
        "operationId": "voipAddParticipant",
        "tags": [
          "VoIP"
        ],
        "summary": "Invite another party into a live call",
        "description": "**Required scope:** `sessions:manage`\n\nRings `to` (an E.164 phone number or a user ID) into the call, turning a 1:1 call into a group call. The invitee enters the roster as `invited`; roster changes reach the SDK media socket as `participant_joined` / `participant_state` / `participant_left` frames. 409 until the call has a live leg.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "sessions:manage",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "example": "call-123"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VoipAddParticipantRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Participant invited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoipAddParticipantResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "409": {
            "description": "Call not ready — no media session on the owning pod yet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "conflict_error",
                    "code": "state_conflict",
                    "message": "The request conflicts with the resource state.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#state-conflict"
                }
              }
            }
          },
          "410": {
            "description": "Call ended — the pod that owned its media is gone (pod_lost)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_gone",
                    "message": "The requested retained resource has expired or was removed.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-gone"
                }
              }
            }
          },
          "429": {
            "description": "Call setup rate exceeded for this client token, or its concurrency limit is reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "rate_limit_error",
                    "code": "rate_limit_exceeded",
                    "message": "The request limit was reached. Follow Retry-After when supplied.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#rate-limit-exceeded"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          },
          "503": {
            "description": "Call unavailable — the owning pod is at capacity or draining, or call authority cannot be verified",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "service_unavailable",
                    "message": "A required service is unavailable. Check completion before repeating a write.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#service-unavailable"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">sessions:manage</Badge>"
        }
      }
    },
    "/messaging/voip/mode": {
      "post": {
        "operationId": "voipSetMode",
        "tags": [
          "VoIP"
        ],
        "summary": "Choose how a session answers inbound calls",
        "description": "**Required scope:** `sessions:manage`\n\n`browser` (default) answers each inbound call and bridges it to a browser through `/offer`; `agent` answers and bridges to the raw-audio socket; `sdk` lets the call ring and waits for your `/accept` or `/reject`. The claim persists until changed and applies to calls that arrive after it. Client tokens configure their bound session; server keys must name one.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "sessions:manage",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VoipModeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Mode recorded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoipModeResult"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">sessions:manage</Badge>"
        }
      }
    },
    "/messaging/voip/calls/{id}/candidate": {
      "post": {
        "operationId": "voipCandidate",
        "tags": [
          "VoIP"
        ],
        "summary": "Trickle a local ICE candidate to the owning pod",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "sessions:manage",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "example": "call-123"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VoipCandidateRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Candidate accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "409": {
            "description": "Call not ready — no media session on the owning pod yet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "conflict_error",
                    "code": "state_conflict",
                    "message": "The request conflicts with the resource state.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#state-conflict"
                }
              }
            }
          },
          "410": {
            "description": "Call ended — the pod that owned its media is gone (pod_lost)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_gone",
                    "message": "The requested retained resource has expired or was removed.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-gone"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          },
          "503": {
            "description": "Call unavailable — the owning pod is at capacity or draining, or call authority cannot be verified",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "service_unavailable",
                    "message": "A required service is unavailable. Check completion before repeating a write.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#service-unavailable"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">sessions:manage</Badge>"
        },
        "description": "**Required scope:** `sessions:manage`"
      }
    },
    "/messaging/voip/calls/{id}/candidates": {
      "get": {
        "operationId": "voipCandidates",
        "tags": [
          "VoIP"
        ],
        "summary": "Poll remote ICE candidates queued for the browser",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "sessions:manage",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "example": "call-123"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Queued remote candidates (drained on read)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoipCandidatesEnvelope"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "409": {
            "description": "Call not ready — no media session on the owning pod yet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "conflict_error",
                    "code": "state_conflict",
                    "message": "The request conflicts with the resource state.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#state-conflict"
                }
              }
            }
          },
          "410": {
            "description": "Call ended — the pod that owned its media is gone (pod_lost)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_gone",
                    "message": "The requested retained resource has expired or was removed.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-gone"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          },
          "503": {
            "description": "Call unavailable — the owning pod is at capacity or draining, or call authority cannot be verified",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "service_unavailable",
                    "message": "A required service is unavailable. Check completion before repeating a write.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#service-unavailable"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">sessions:manage</Badge>"
        },
        "description": "**Required scope:** `sessions:manage`"
      }
    },
    "/messaging/voip/calls/{id}": {
      "delete": {
        "operationId": "voipTeardown",
        "tags": [
          "VoIP"
        ],
        "summary": "Tear down a call's browser media session",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "sessions:manage",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "example": "call-123"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Call torn down",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "409": {
            "description": "Call not ready — no media session on the owning pod yet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "conflict_error",
                    "code": "state_conflict",
                    "message": "The request conflicts with the resource state.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#state-conflict"
                }
              }
            }
          },
          "410": {
            "description": "Call ended — the pod that owned its media is gone (pod_lost)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_gone",
                    "message": "The requested retained resource has expired or was removed.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-gone"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          },
          "503": {
            "description": "Call unavailable — the owning pod is at capacity or draining, or call authority cannot be verified",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "service_unavailable",
                    "message": "A required service is unavailable. Check completion before repeating a write.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#service-unavailable"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">sessions:manage</Badge>"
        },
        "description": "**Required scope:** `sessions:manage`"
      }
    },
    "/messaging/voip/token": {
      "post": {
        "operationId": "voipToken",
        "tags": [
          "VoIP"
        ],
        "summary": "Mint a short-lived browser client token for the VoIP SDK",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scopes": [
          "sessions:manage",
          "messages:write",
          "contacts:read",
          "presence:read",
          "presence:observe",
          "mcp"
        ],
        "x-required-scope-mode": "all",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VoipTokenRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Client token minted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoipTokenResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">sessions:manage</Badge> <Badge color=\"yellow\" icon=\"key\">messages:write</Badge> <Badge color=\"yellow\" icon=\"key\">contacts:read</Badge> <Badge color=\"yellow\" icon=\"key\">presence:read</Badge> <Badge color=\"yellow\" icon=\"key\">presence:observe</Badge> <Badge color=\"yellow\" icon=\"key\">mcp</Badge>"
        },
        "description": "**Required scopes (all):** `sessions:manage` · `messages:write` · `contacts:read` · `presence:read` · `presence:observe` · `mcp`"
      }
    },
    "/messaging/{session}/groups": {
      "get": {
        "operationId": "listGroups",
        "tags": [
          "Groups"
        ],
        "summary": "List groups the session is a member of",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "groups:read",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Group list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListGroupsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">groups:read</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `groups:read`"
      },
      "post": {
        "operationId": "createGroup",
        "tags": [
          "Groups"
        ],
        "summary": "Create a new group",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "groups:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateGroupRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Group created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateGroupResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">groups:manage</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `groups:manage`"
      }
    },
    "/messaging/{session}/groups/join-info": {
      "get": {
        "operationId": "getGroupJoinInfo",
        "tags": [
          "Groups"
        ],
        "summary": "Look up group info for an invite code",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "groups:read",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "required": true,
            "name": "code",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Join info",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetGroupJoinInfoResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">groups:read</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `groups:read`"
      }
    },
    "/messaging/{session}/groups/join": {
      "post": {
        "operationId": "joinGroup",
        "tags": [
          "Groups"
        ],
        "summary": "Join a group by invite code",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "groups:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JoinGroupRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Joined group",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">groups:manage</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `groups:manage`"
      }
    },
    "/messaging/{session}/groups/{id}": {
      "get": {
        "operationId": "getGroup",
        "tags": [
          "Groups"
        ],
        "summary": "Get group details",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "groups:read",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,18}$"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Group details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetGroupResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">groups:read</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `groups:read`"
      },
      "delete": {
        "operationId": "deleteGroup",
        "tags": [
          "Groups"
        ],
        "summary": "Leave a group (DELETE alias)",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "groups:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,18}$"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Left group",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">groups:manage</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `groups:manage`"
      }
    },
    "/messaging/{session}/groups/{id}/leave": {
      "post": {
        "operationId": "leaveGroup",
        "tags": [
          "Groups"
        ],
        "summary": "Leave a group",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "groups:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,18}$"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Left group",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">groups:manage</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `groups:manage`"
      }
    },
    "/messaging/{session}/groups/{id}/subject": {
      "put": {
        "operationId": "setGroupSubject",
        "tags": [
          "Groups"
        ],
        "summary": "Set group subject (name)",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "groups:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,18}$"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetGroupFieldRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Subject updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">groups:manage</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `groups:manage`"
      }
    },
    "/messaging/{session}/groups/{id}/description": {
      "put": {
        "operationId": "setGroupDescription",
        "tags": [
          "Groups"
        ],
        "summary": "Set group description",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "groups:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,18}$"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetGroupFieldRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Description updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">groups:manage</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `groups:manage`"
      }
    },
    "/messaging/{session}/groups/{id}/invite-code": {
      "get": {
        "operationId": "getGroupInviteCode",
        "tags": [
          "Groups"
        ],
        "summary": "Get the current group invite code",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "groups:read",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,18}$"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Invite code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetGroupInviteCodeResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">groups:read</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `groups:read`"
      }
    },
    "/messaging/{session}/groups/{id}/invite-code/revoke": {
      "post": {
        "operationId": "revokeGroupInviteCode",
        "tags": [
          "Groups"
        ],
        "summary": "Revoke the current invite code and generate a new one",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "groups:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,18}$"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "New invite code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RevokeGroupInviteCodeResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">groups:manage</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `groups:manage`"
      }
    },
    "/messaging/{session}/groups/{id}/participants": {
      "get": {
        "operationId": "getGroupParticipants",
        "tags": [
          "Groups"
        ],
        "summary": "List group participants",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "groups:read",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,18}$"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Participant list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetGroupParticipantsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">groups:read</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `groups:read`"
      }
    },
    "/messaging/{session}/groups/{id}/participants/add": {
      "post": {
        "operationId": "addGroupParticipants",
        "tags": [
          "Groups"
        ],
        "summary": "Add participants to a group",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "groups:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,18}$"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GroupParticipantsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Participants added",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">groups:manage</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `groups:manage`"
      }
    },
    "/messaging/{session}/groups/{id}/participants/remove": {
      "post": {
        "operationId": "removeGroupParticipants",
        "tags": [
          "Groups"
        ],
        "summary": "Remove participants from a group",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "groups:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,18}$"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GroupParticipantsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Participants removed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">groups:manage</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `groups:manage`"
      }
    },
    "/messaging/{session}/groups/{id}/admin/promote": {
      "post": {
        "operationId": "promoteGroupAdmin",
        "tags": [
          "Groups"
        ],
        "summary": "Promote participants to admin",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "groups:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,18}$"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GroupParticipantsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Participants promoted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">groups:manage</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `groups:manage`"
      }
    },
    "/messaging/{session}/groups/{id}/admin/demote": {
      "post": {
        "operationId": "demoteGroupAdmin",
        "tags": [
          "Groups"
        ],
        "summary": "Demote admin participants",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "groups:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,18}$"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GroupParticipantsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Participants demoted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">groups:manage</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `groups:manage`"
      }
    },
    "/messaging/{session}/groups/{id}/picture": {
      "put": {
        "operationId": "setGroupPicture",
        "tags": [
          "Groups"
        ],
        "summary": "Set the group profile picture",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "groups:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,18}$"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetGroupPictureRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Picture updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">groups:manage</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `groups:manage`"
      }
    },
    "/messaging/{session}/groups/{id}/settings/info-edit": {
      "put": {
        "operationId": "setGroupInfoEditing",
        "tags": [
          "Groups"
        ],
        "summary": "Choose who can edit group information",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "groups:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,18}$"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GroupAdminOnlySettingRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Group information permission updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">groups:manage</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `groups:manage`"
      }
    },
    "/messaging/{session}/groups/{id}/settings/messages": {
      "put": {
        "operationId": "setGroupMessaging",
        "tags": [
          "Groups"
        ],
        "summary": "Choose who can send group messages",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "groups:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,18}$"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GroupAdminOnlySettingRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Group messaging permission updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">groups:manage</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `groups:manage`"
      }
    },
    "/messaging/{session}/groups/{id}/settings/member-add": {
      "put": {
        "operationId": "setGroupMemberAddMode",
        "tags": [
          "Groups"
        ],
        "summary": "Choose who can add group members",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "groups:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,18}$"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GroupMemberAddModeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Group member-add mode updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">groups:manage</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `groups:manage`"
      }
    },
    "/messaging/{session}/groups/{id}/settings/join-approval": {
      "put": {
        "operationId": "setGroupJoinApproval",
        "tags": [
          "Groups"
        ],
        "summary": "Require admin approval for invite-link joins",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "groups:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,18}$"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GroupJoinApprovalRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Group join approval updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">groups:manage</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `groups:manage`"
      }
    },
    "/messaging/{session}/contacts": {
      "get": {
        "operationId": "listContacts",
        "tags": [
          "Contacts"
        ],
        "summary": "List all contacts known to the session",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "contacts:read",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Contact list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListContactsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">contacts:read</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `contacts:read`"
      }
    },
    "/messaging/{session}/contacts/check": {
      "get": {
        "operationId": "checkContacts",
        "tags": [
          "Contacts"
        ],
        "summary": "Check if phone numbers are registered on WhatsApp",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "contacts:read",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              ]
            },
            "required": true,
            "name": "phone",
            "in": "query",
            "style": "form",
            "explode": false
          }
        ],
        "responses": {
          "200": {
            "description": "Contact check results",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckContactsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">contacts:read</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `contacts:read`"
      }
    },
    "/messaging/{session}/contacts/blocked": {
      "get": {
        "operationId": "getBlocklist",
        "tags": [
          "Contacts"
        ],
        "summary": "Get blocked contacts",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "contacts:read",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Blocked contacts",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetBlocklistResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">contacts:read</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `contacts:read`"
      }
    },
    "/messaging/{session}/contacts/{contactId}": {
      "get": {
        "operationId": "getContact",
        "tags": [
          "Contacts"
        ],
        "summary": "Get a contact by stable user ID",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "contacts:read",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,18}$"
            },
            "required": true,
            "name": "contactId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Contact details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetContactResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">contacts:read</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `contacts:read`"
      }
    },
    "/messaging/{session}/contacts/{contactId}/picture": {
      "get": {
        "operationId": "getContactPicture",
        "tags": [
          "Contacts"
        ],
        "summary": "Get a contact's profile picture URL",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "contacts:read",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,18}$"
            },
            "required": true,
            "name": "contactId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Profile picture URL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetContactPictureResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">contacts:read</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `contacts:read`"
      }
    },
    "/messaging/{session}/contacts/{contactId}/info": {
      "get": {
        "operationId": "getUserInfo",
        "tags": [
          "Contacts"
        ],
        "summary": "Get live WhatsApp user metadata",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "contacts:read",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,18}$"
            },
            "required": true,
            "name": "contactId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "User metadata",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetUserInfoResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">contacts:read</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `contacts:read`"
      }
    },
    "/messaging/{session}/contacts/{contactId}/devices": {
      "get": {
        "operationId": "getUserDevices",
        "tags": [
          "Contacts"
        ],
        "summary": "Get a contact's linked devices",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "contacts:read",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,18}$"
            },
            "required": true,
            "name": "contactId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Linked devices",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetUserDevicesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">contacts:read</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `contacts:read`"
      }
    },
    "/messaging/{session}/contacts/{contactId}/business-profile": {
      "get": {
        "operationId": "getBusinessProfile",
        "tags": [
          "Contacts"
        ],
        "summary": "Get a WhatsApp business profile",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "contacts:read",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,18}$"
            },
            "required": true,
            "name": "contactId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Business profile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetBusinessProfileResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">contacts:read</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `contacts:read`"
      }
    },
    "/messaging/{session}/contacts/{contactId}/block": {
      "post": {
        "operationId": "blockContact",
        "tags": [
          "Contacts"
        ],
        "summary": "Block a contact",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "contacts:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,18}$"
            },
            "required": true,
            "name": "contactId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Contact blocked",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">contacts:manage</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `contacts:manage`"
      }
    },
    "/messaging/{session}/contacts/{contactId}/unblock": {
      "post": {
        "operationId": "unblockContact",
        "tags": [
          "Contacts"
        ],
        "summary": "Unblock a contact",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "contacts:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,18}$"
            },
            "required": true,
            "name": "contactId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Contact unblocked",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">contacts:manage</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `contacts:manage`"
      }
    },
    "/messaging/{session}/business/linked-accounts": {
      "get": {
        "operationId": "getBusinessLinkedAccounts",
        "tags": [
          "Business App"
        ],
        "summary": "Read live accounts linked to the connected WhatsApp Business App",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "business:read",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Live linked-account state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetBusinessLinkedAccountsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">business:read</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `business:read`"
      }
    },
    "/messaging/{session}/business/eligibility": {
      "get": {
        "operationId": "getBusinessEligibility",
        "tags": [
          "Business App"
        ],
        "summary": "Read live feature eligibility for the connected WhatsApp Business App",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "business:read",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Live business feature eligibility",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetBusinessEligibilityResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">business:read</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `business:read`"
      }
    },
    "/messaging/{session}/business/profile": {
      "get": {
        "operationId": "getOwnBusinessProfile",
        "tags": [
          "Business App"
        ],
        "summary": "Read the connected WhatsApp Business App profile",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "profile:read",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Live business profile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetOwnBusinessProfileResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">profile:read</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `profile:read`"
      },
      "patch": {
        "operationId": "updateBusinessProfile",
        "tags": [
          "Business App"
        ],
        "summary": "Update the connected WhatsApp Business App profile",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "profile:write",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessProfileUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Profile updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateBusinessProfileResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">profile:write</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `profile:write`"
      }
    },
    "/messaging/{session}/business/profile/cover-photo": {
      "put": {
        "operationId": "setBusinessCoverPhoto",
        "tags": [
          "Business App"
        ],
        "summary": "Set the connected WhatsApp Business App cover photo",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "profile:write",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessCoverPhotoRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Cover photo set",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SetBusinessCoverPhotoResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">profile:write</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `profile:write`"
      }
    },
    "/messaging/{session}/business/profile/cover-photo/{coverPhotoId}": {
      "delete": {
        "operationId": "deleteBusinessCoverPhoto",
        "tags": [
          "Business App"
        ],
        "summary": "Delete the connected WhatsApp Business App cover photo",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "profile:write",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            },
            "required": true,
            "name": "coverPhotoId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Cover photo removed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteBusinessCoverPhotoResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">profile:write</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `profile:write`"
      }
    },
    "/messaging/{session}/business/compliance": {
      "get": {
        "operationId": "getBusinessMerchantCompliance",
        "tags": [
          "Business App"
        ],
        "summary": "Read merchant compliance details for the connected WhatsApp Business App account",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "profile:read",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Live merchant compliance details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetBusinessMerchantComplianceResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">profile:read</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `profile:read`"
      },
      "put": {
        "operationId": "setBusinessMerchantCompliance",
        "tags": [
          "Business App"
        ],
        "summary": "Replace merchant compliance details for the connected WhatsApp Business App account",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "profile:write",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessMerchantCompliance"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Merchant compliance details updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SetBusinessMerchantComplianceResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">profile:write</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `profile:write`"
      }
    },
    "/messaging/{session}/business/quick-replies": {
      "post": {
        "operationId": "createBusinessQuickReply",
        "tags": [
          "Business App"
        ],
        "summary": "Create a WhatsApp Business App quick reply",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "profile:write",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessQuickReplyMutation"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Quick reply created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateBusinessQuickReplyResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">profile:write</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `profile:write`"
      },
      "get": {
        "operationId": "listBusinessQuickReplies",
        "tags": [
          "Business App"
        ],
        "summary": "List remembered WhatsApp Business App quick replies",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "profile:read",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Best-effort quick reply list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListBusinessQuickRepliesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">profile:read</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `profile:read`"
      }
    },
    "/messaging/{session}/business/quick-replies/{quickReplyId}": {
      "put": {
        "operationId": "setBusinessQuickReply",
        "tags": [
          "Business App"
        ],
        "summary": "Replace a WhatsApp Business App quick reply",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "profile:write",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 20,
              "pattern": "^[0-9]+$"
            },
            "required": true,
            "name": "quickReplyId",
            "in": "path"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessQuickReplyMutation"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Quick reply replaced",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SetBusinessQuickReplyResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">profile:write</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `profile:write`"
      },
      "delete": {
        "operationId": "deleteBusinessQuickReply",
        "tags": [
          "Business App"
        ],
        "summary": "Delete a WhatsApp Business App quick reply",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "profile:write",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 20,
              "pattern": "^[0-9]+$"
            },
            "required": true,
            "name": "quickReplyId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Quick reply deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteBusinessQuickReplyResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">profile:write</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `profile:write`"
      }
    },
    "/messaging/{session}/business/catalog": {
      "get": {
        "operationId": "getBusinessCatalog",
        "tags": [
          "Business App"
        ],
        "summary": "Read a WhatsApp Business App catalog",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "business:read",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "maxLength": 256,
              "pattern": "^[1-9][0-9]{0,18}$"
            },
            "required": true,
            "name": "id",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "required": false,
            "name": "after",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "required": false,
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1024
            },
            "required": false,
            "name": "width",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1024
            },
            "required": false,
            "name": "height",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Live catalog page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetBusinessCatalogResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          },
          "502": {
            "description": "Upstream WhatsApp request failed or its response could not be mapped",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "upstream_error",
                    "code": "upstream_failure",
                    "message": "The messaging provider could not complete the request.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#upstream-failure"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">business:read</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `business:read`"
      },
      "post": {
        "operationId": "createBusinessCatalog",
        "tags": [
          "Business App"
        ],
        "summary": "Create a catalog for the connected WhatsApp Business App account",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "profile:write",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Catalog created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateBusinessCatalogResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">profile:write</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `profile:write`"
      }
    },
    "/messaging/{session}/business/catalog/cart": {
      "patch": {
        "operationId": "setBusinessCartEnabled",
        "tags": [
          "Business App"
        ],
        "summary": "Enable or disable the connected WhatsApp Business App catalog cart",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "profile:write",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessCartSettingRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Cart setting updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SetBusinessCartEnabledResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">profile:write</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `profile:write`"
      }
    },
    "/messaging/{session}/business/products/{productId}": {
      "get": {
        "operationId": "getBusinessProduct",
        "tags": [
          "Business App"
        ],
        "summary": "Read a WhatsApp Business App product",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "business:read",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "maxLength": 256
            },
            "required": true,
            "name": "productId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "maxLength": 256,
              "pattern": "^[1-9][0-9]{0,18}$"
            },
            "required": true,
            "name": "id",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Live product",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetBusinessProductResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          },
          "502": {
            "description": "Upstream WhatsApp request failed or its response could not be mapped",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "upstream_error",
                    "code": "upstream_failure",
                    "message": "The messaging provider could not complete the request.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#upstream-failure"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">business:read</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `business:read`"
      },
      "put": {
        "operationId": "updateBusinessProduct",
        "tags": [
          "Business App"
        ],
        "summary": "Replace a product in the connected WhatsApp Business App catalog",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "profile:write",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "maxLength": 256
            },
            "required": true,
            "name": "productId",
            "in": "path"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessProductMutationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Product updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateBusinessProductResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">profile:write</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `profile:write`"
      },
      "delete": {
        "operationId": "deleteBusinessProduct",
        "tags": [
          "Business App"
        ],
        "summary": "Delete a product from the connected WhatsApp Business App catalog",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "profile:write",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "maxLength": 256
            },
            "required": true,
            "name": "productId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Product deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteBusinessProductResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">profile:write</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `profile:write`"
      }
    },
    "/messaging/{session}/business/products": {
      "post": {
        "operationId": "createBusinessProduct",
        "tags": [
          "Business App"
        ],
        "summary": "Create a product in the connected WhatsApp Business App catalog",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "profile:write",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessProductMutationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Product created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateBusinessProductResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">profile:write</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `profile:write`"
      }
    },
    "/messaging/{session}/business/products/{productId}/visibility": {
      "patch": {
        "operationId": "setBusinessProductVisibility",
        "tags": [
          "Business App"
        ],
        "summary": "Hide or show a product in the connected WhatsApp Business App catalog",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "profile:write",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "maxLength": 256
            },
            "required": true,
            "name": "productId",
            "in": "path"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessProductVisibilityRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Product visibility updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SetBusinessProductVisibilityResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">profile:write</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `profile:write`"
      }
    },
    "/messaging/{session}/business/products/{productId}/appeal": {
      "post": {
        "operationId": "appealBusinessProduct",
        "tags": [
          "Business App"
        ],
        "summary": "Request a review of a rejected WhatsApp Business App catalog product",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "profile:write",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "maxLength": 256
            },
            "required": true,
            "name": "productId",
            "in": "path"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessCatalogAppealRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Product appeal submitted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppealBusinessProductResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">profile:write</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `profile:write`"
      }
    },
    "/messaging/{session}/business/collections": {
      "get": {
        "operationId": "getBusinessCollections",
        "tags": [
          "Business App"
        ],
        "summary": "Read WhatsApp Business App collections",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "business:read",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "maxLength": 256,
              "pattern": "^[1-9][0-9]{0,18}$"
            },
            "required": true,
            "name": "id",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "required": false,
            "name": "after",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 20
            },
            "required": false,
            "name": "collectionLimit",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "required": false,
            "name": "itemLimit",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1024
            },
            "required": false,
            "name": "width",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1024
            },
            "required": false,
            "name": "height",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Live collection page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetBusinessCollectionsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          },
          "502": {
            "description": "Upstream WhatsApp request failed or its response could not be mapped",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "upstream_error",
                    "code": "upstream_failure",
                    "message": "The messaging provider could not complete the request.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#upstream-failure"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">business:read</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `business:read`"
      },
      "post": {
        "operationId": "createBusinessCollection",
        "tags": [
          "Business App"
        ],
        "summary": "Create a collection in the connected WhatsApp Business App catalog",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "profile:write",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessCollectionCreateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Collection created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateBusinessCollectionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">profile:write</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `profile:write`"
      }
    },
    "/messaging/{session}/business/collections/{collectionId}": {
      "get": {
        "operationId": "getBusinessCollection",
        "tags": [
          "Business App"
        ],
        "summary": "Read a WhatsApp Business App collection",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "business:read",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "maxLength": 256
            },
            "required": true,
            "name": "collectionId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "maxLength": 256,
              "pattern": "^[1-9][0-9]{0,18}$"
            },
            "required": true,
            "name": "id",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "required": false,
            "name": "after",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "required": false,
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1024
            },
            "required": false,
            "name": "width",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1024
            },
            "required": false,
            "name": "height",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Live collection",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetBusinessCollectionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          },
          "502": {
            "description": "Upstream WhatsApp request failed or its response could not be mapped",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "upstream_error",
                    "code": "upstream_failure",
                    "message": "The messaging provider could not complete the request.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#upstream-failure"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">business:read</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `business:read`"
      },
      "patch": {
        "operationId": "updateBusinessCollection",
        "tags": [
          "Business App"
        ],
        "summary": "Update a collection and its product membership",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "profile:write",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "maxLength": 256
            },
            "required": true,
            "name": "collectionId",
            "in": "path"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessCollectionUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Collection updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateBusinessCollectionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">profile:write</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `profile:write`"
      },
      "delete": {
        "operationId": "deleteBusinessCollection",
        "tags": [
          "Business App"
        ],
        "summary": "Delete a collection from the connected WhatsApp Business App catalog",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "profile:write",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "maxLength": 256
            },
            "required": true,
            "name": "collectionId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Collection deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteBusinessCollectionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">profile:write</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `profile:write`"
      }
    },
    "/messaging/{session}/business/collections/reorder": {
      "post": {
        "operationId": "reorderBusinessCollections",
        "tags": [
          "Business App"
        ],
        "summary": "Reorder connected WhatsApp Business App catalog collections",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "profile:write",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessCollectionReorderRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Collections reordered",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReorderBusinessCollectionsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">profile:write</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `profile:write`"
      }
    },
    "/messaging/{session}/business/collections/{collectionId}/appeal": {
      "post": {
        "operationId": "appealBusinessCollection",
        "tags": [
          "Business App"
        ],
        "summary": "Request a review of a rejected WhatsApp Business App catalog collection",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "profile:write",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "maxLength": 256
            },
            "required": true,
            "name": "collectionId",
            "in": "path"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessCatalogAppealRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Collection appeal submitted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppealBusinessCollectionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">profile:write</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `profile:write`"
      }
    },
    "/messaging/{session}/business/orders/{orderId}/lookup": {
      "post": {
        "operationId": "getBusinessOrder",
        "tags": [
          "Business App"
        ],
        "summary": "Read WhatsApp Business App order details",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "business:read",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "maxLength": 256
            },
            "required": true,
            "name": "orderId",
            "in": "path"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessOrderLookupRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Order details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetBusinessOrderResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          },
          "502": {
            "description": "Upstream WhatsApp request failed or its response could not be mapped",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "upstream_error",
                    "code": "upstream_failure",
                    "message": "The messaging provider could not complete the request.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#upstream-failure"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">business:read</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `business:read`"
      }
    },
    "/messaging/{session}/identities/resolve": {
      "get": {
        "operationId": "resolveIdentity",
        "tags": [
          "Identities"
        ],
        "summary": "Resolve a user alias to a stable user ID",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "contacts:read",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "phoneNumber",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,18}$"
            },
            "required": false,
            "name": "id",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 3,
              "maxLength": 35
            },
            "required": false,
            "name": "username",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}$"
            },
            "required": false,
            "name": "usernameKey",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Stable user ID and known aliases",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResolveIdentityResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">contacts:read</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `contacts:read`"
      }
    },
    "/messaging/{session}/users/{id}/security-code": {
      "get": {
        "operationId": "getUserSecurityCode",
        "tags": [
          "Users"
        ],
        "summary": "Get an identity verification code for a user",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "contacts:read",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,18}$"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Identity verification code and display QR",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserSecurityCodeResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">contacts:read</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `contacts:read`"
      }
    },
    "/messaging/{session}/channels": {
      "get": {
        "operationId": "listChannels",
        "tags": [
          "Channels"
        ],
        "summary": "List channels the session follows",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "channels:read",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Channel list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListChannelsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">channels:read</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `channels:read`"
      },
      "post": {
        "operationId": "createChannel",
        "tags": [
          "Channels"
        ],
        "summary": "Create a new channel",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "channels:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateChannelRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Channel created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateChannelResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">channels:manage</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `channels:manage`"
      }
    },
    "/messaging/{session}/channels/{id}": {
      "get": {
        "operationId": "getChannel",
        "tags": [
          "Channels"
        ],
        "summary": "Get channel details",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "channels:read",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,18}$"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Channel details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetChannelResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">channels:read</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `channels:read`"
      },
      "delete": {
        "operationId": "deleteChannel",
        "tags": [
          "Channels"
        ],
        "summary": "Delete a channel",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "channels:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,18}$"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Channel deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteChannelResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          },
          "502": {
            "description": "Upstream WhatsApp request failed or its response could not be mapped",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "upstream_error",
                    "code": "upstream_failure",
                    "message": "The messaging provider could not complete the request.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#upstream-failure"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">channels:manage</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `channels:manage`"
      }
    },
    "/messaging/{session}/channels/{id}/messages": {
      "get": {
        "operationId": "listChannelMessages",
        "tags": [
          "Channels"
        ],
        "summary": "List channel messages",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "channels:read",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,18}$"
            },
            "required": true,
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            },
            "required": false,
            "name": "count",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 0,
              "exclusiveMinimum": true
            },
            "required": false,
            "name": "before",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Channel messages",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListChannelMessagesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">channels:read</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `channels:read`"
      }
    },
    "/messaging/{session}/channels/{id}/message-updates": {
      "get": {
        "operationId": "listChannelMessageUpdates",
        "tags": [
          "Channels"
        ],
        "summary": "List channel view and reaction updates",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "channels:read",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,18}$"
            },
            "required": true,
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            },
            "required": false,
            "name": "count",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "nullable": true,
              "minimum": 0
            },
            "required": false,
            "name": "since",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 0,
              "exclusiveMinimum": true
            },
            "required": false,
            "name": "after",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Channel message updates",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListChannelMessageUpdatesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">channels:read</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `channels:read`"
      }
    },
    "/messaging/{session}/channels/{id}/messages/{messageId}/viewed": {
      "post": {
        "operationId": "markChannelMessageViewed",
        "tags": [
          "Channels"
        ],
        "summary": "Mark a channel message as viewed",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "channels:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,18}$"
            },
            "required": true,
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,18}$"
            },
            "required": true,
            "name": "messageId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Message marked viewed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">channels:manage</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `channels:manage`"
      }
    },
    "/messaging/{session}/channels/{id}/messages/{messageId}/reaction": {
      "post": {
        "operationId": "reactToChannelMessage",
        "tags": [
          "Channels"
        ],
        "summary": "React to a channel message",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "channels:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,18}$"
            },
            "required": true,
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,18}$"
            },
            "required": true,
            "name": "messageId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChannelReactionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Reaction updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">channels:manage</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `channels:manage`"
      }
    },
    "/messaging/{session}/channels/{id}/live-updates": {
      "post": {
        "operationId": "subscribeChannelLiveUpdates",
        "tags": [
          "Channels"
        ],
        "summary": "Subscribe temporarily to channel live updates",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "channels:read",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,18}$"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Live-update subscription duration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChannelLiveUpdatesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">channels:read</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `channels:read`"
      }
    },
    "/messaging/{session}/channels/{id}/follow": {
      "post": {
        "operationId": "followChannel",
        "tags": [
          "Channels"
        ],
        "summary": "Follow a channel",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "channels:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,18}$"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Channel followed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">channels:manage</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `channels:manage`"
      }
    },
    "/messaging/{session}/channels/{id}/unfollow": {
      "post": {
        "operationId": "unfollowChannel",
        "tags": [
          "Channels"
        ],
        "summary": "Unfollow a channel",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "channels:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,18}$"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Channel unfollowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">channels:manage</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `channels:manage`"
      }
    },
    "/messaging/{session}/channels/{id}/mute": {
      "post": {
        "operationId": "muteChannel",
        "tags": [
          "Channels"
        ],
        "summary": "Mute a channel",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "channels:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,18}$"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Channel muted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">channels:manage</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `channels:manage`"
      }
    },
    "/messaging/{session}/channels/{id}/unmute": {
      "post": {
        "operationId": "unmuteChannel",
        "tags": [
          "Channels"
        ],
        "summary": "Unmute a channel",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "channels:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,18}$"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Channel unmuted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">channels:manage</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `channels:manage`"
      }
    },
    "/messaging/{session}/presence": {
      "post": {
        "operationId": "setPresence",
        "tags": [
          "Presence"
        ],
        "summary": "Set the session's own presence (available / unavailable)",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "presence:write",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetPresenceRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Presence updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted for asynchronous processing in response to `Prefer: respond-async`; the result is not included",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AsyncAcceptedResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">presence:write</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `presence:write`"
      },
      "get": {
        "operationId": "getPresence",
        "tags": [
          "Presence"
        ],
        "summary": "Get the session's own presence",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "presence:read",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Presence info",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetPresenceResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">presence:read</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `presence:read`"
      }
    },
    "/messaging/{session}/presence/{conversation}": {
      "get": {
        "operationId": "getChatPresence",
        "tags": [
          "Presence"
        ],
        "summary": "Get presence for a specific chat",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "presence:read",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "conversation",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Chat presence",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetChatPresenceResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">presence:read</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `presence:read`"
      }
    },
    "/messaging/{session}/presence/{conversation}/subscribe": {
      "post": {
        "operationId": "subscribePresence",
        "tags": [
          "Presence"
        ],
        "summary": "Subscribe to presence updates for a chat",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "presence:observe",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "conversation",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Subscribed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscribePresenceResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted for asynchronous processing in response to `Prefer: respond-async`; the result is not included",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AsyncAcceptedResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "429": {
            "description": "Observation limit exceeded, or the session is inside the suspension window that follows",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "rate_limit_error",
                    "code": "rate_limit_exceeded",
                    "message": "The request limit was reached. Follow Retry-After when supplied.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#rate-limit-exceeded"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">presence:observe</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `presence:observe`"
      }
    },
    "/messaging/projects/{projectId}/safe-mode": {
      "get": {
        "operationId": "getProjectSafeMode",
        "tags": [
          "Safe Mode"
        ],
        "summary": "Get a project's Safe Mode ceiling",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "sessions:read",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "projectId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Project Safe Mode ceiling, and whether the plan includes BanSafe Lite",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetProjectSafeModeResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">sessions:read</Badge>"
        },
        "description": "**Required scope:** `sessions:read`"
      },
      "put": {
        "operationId": "updateProjectSafeMode",
        "tags": [
          "Safe Mode"
        ],
        "summary": "Set a project's Safe Mode ceiling",
        "description": "**Required scope:** `sessions:manage`\n\nSets the most visible behaviour any number in this project may use. Presence and read receipts are visible to the people this number messages: turning them on makes the number appear online, exposes last-seen subject to the account's privacy settings, and puts blue ticks on incoming messages. Every axis is off by default and only this request changes it.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "sessions:manage",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "projectId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "presence": {
                    "type": "string",
                    "enum": [
                      "dark",
                      "online_while_sending",
                      "online_hours"
                    ]
                  },
                  "typing": {
                    "type": "string",
                    "enum": [
                      "off",
                      "before_text",
                      "before_all"
                    ]
                  },
                  "reads": {
                    "type": "string",
                    "enum": [
                      "off",
                      "replied_chats",
                      "all_inbound"
                    ]
                  },
                  "pacing": {
                    "type": "string",
                    "enum": [
                      "off",
                      "jittered",
                      "conversation"
                    ]
                  },
                  "onlineStart": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 23
                  },
                  "onlineEnd": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 23
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Project Safe Mode ceiling updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateProjectSafeModeResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "402": {
            "description": "Safe Mode is part of BanSafe Lite, which is not included on this number's plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "entitlement_required",
                    "message": "The account needs the required entitlement for this action.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#entitlement-required"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          },
          "503": {
            "description": "Stored, but a connected number did not confirm the policy; retry the request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "service_unavailable",
                    "message": "A required service is unavailable. Check completion before repeating a write.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#service-unavailable"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">sessions:manage</Badge>"
        }
      }
    },
    "/messaging/{session}/safe-mode": {
      "get": {
        "operationId": "getSessionSafeMode",
        "tags": [
          "Safe Mode"
        ],
        "summary": "Get a number's effective Safe Mode",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "sessions:read",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "required": true,
            "name": "session",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Project ceiling, number override, the effective policy, and whether the plan includes BanSafe Lite",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetSessionSafeModeResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">sessions:read</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `sessions:read`"
      },
      "put": {
        "operationId": "updateSessionSafeMode",
        "tags": [
          "Safe Mode"
        ],
        "summary": "Set a number's Safe Mode override",
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `sessions:manage`\n\nSets one number's Safe Mode. Each axis accepts `inherit` to follow the project ceiling. An override may only be equally or more conservative than the ceiling; a more visible value is refused with `safe_mode_exceeds_project_ceiling`.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "sessions:manage",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "required": true,
            "name": "session",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "presence": {
                    "type": "string",
                    "enum": [
                      "inherit",
                      "dark",
                      "online_while_sending",
                      "online_hours"
                    ]
                  },
                  "typing": {
                    "type": "string",
                    "enum": [
                      "inherit",
                      "off",
                      "before_text",
                      "before_all"
                    ]
                  },
                  "reads": {
                    "type": "string",
                    "enum": [
                      "inherit",
                      "off",
                      "replied_chats",
                      "all_inbound"
                    ]
                  },
                  "pacing": {
                    "type": "string",
                    "enum": [
                      "inherit",
                      "off",
                      "jittered",
                      "conversation"
                    ]
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Number Safe Mode override updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateSessionSafeModeResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "402": {
            "description": "Safe Mode is part of BanSafe Lite, which is not included on this number's plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "entitlement_required",
                    "message": "The account needs the required entitlement for this action.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#entitlement-required"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          },
          "503": {
            "description": "Stored, but a connected number did not confirm the policy; retry the request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "service_unavailable",
                    "message": "A required service is unavailable. Check completion before repeating a write.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#service-unavailable"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">sessions:manage</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ]
      }
    },
    "/messaging/projects/{projectId}/warmup-plan": {
      "get": {
        "operationId": "getProjectWarmupPlan",
        "tags": [
          "Warm-up plan"
        ],
        "summary": "Get a project's warm-up plan",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "sessions:read",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "projectId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Project warm-up plan, its projected curve, and whether the plan includes BanSafe Lite",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetProjectWarmupPlanResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">sessions:read</Badge>"
        },
        "description": "**Required scope:** `sessions:read`"
      },
      "put": {
        "operationId": "updateProjectWarmupPlan",
        "tags": [
          "Warm-up plan"
        ],
        "summary": "Set a project's warm-up plan",
        "description": "**Required scope:** `sessions:manage`\n\nTurns the warm-up plan on or off for a project and sets how long the ramp takes and how many messages a number may send on its first day. While the plan is on, a send past a number's allowance is refused with `bansafe_daily_allowance_reached` and campaign recipients are deferred to the next reset.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "sessions:manage",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "projectId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  },
                  "warmupDays": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 90
                  },
                  "dailyStart": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 2000
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Project warm-up plan updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateProjectWarmupPlanResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "402": {
            "description": "The warm-up plan is part of BanSafe Lite, which is not included on this project's plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "entitlement_required",
                    "message": "The account needs the required entitlement for this action.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#entitlement-required"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          },
          "503": {
            "description": "Stored, but a connected number did not confirm the plan; retry the request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "service_unavailable",
                    "message": "A required service is unavailable. Check completion before repeating a write.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#service-unavailable"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">sessions:manage</Badge>"
        }
      }
    },
    "/messaging/projects/{projectId}/health-policy": {
      "get": {
        "operationId": "getProjectHealthPolicy",
        "tags": [
          "BanSafe"
        ],
        "summary": "Get a project's health policy",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "sessions:read",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "projectId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Project health threshold and configured actions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetProjectHealthPolicyResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">sessions:read</Badge>"
        },
        "description": "**Required scope:** `sessions:read`"
      },
      "put": {
        "operationId": "updateProjectHealthPolicy",
        "tags": [
          "BanSafe"
        ],
        "summary": "Set a project's health policy",
        "description": "**Required scope:** `sessions:manage`\n\nReplaces the project policy when version matches the stored version. The rule triggers only when an available health estimate is below threshold. Stopping disconnects a session while retaining its linked credentials; logging out requires relinking.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "sessions:manage",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "projectId",
            "in": "path"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProjectHealthPolicyInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Project health policy updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateProjectHealthPolicyResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "409": {
            "description": "Version conflict or selected notification integration unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "conflict_error",
                    "code": "state_conflict",
                    "message": "The request conflicts with the resource state.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#state-conflict"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">sessions:manage</Badge>"
        }
      }
    },
    "/messaging/projects/{projectId}/insurance-evidence": {
      "get": {
        "operationId": "getProjectInsuranceEvidence",
        "tags": [
          "Ban insurance"
        ],
        "summary": "Get ban insurance evidence setting",
        "description": "**Required scope:** `sessions:read`\n\nBan insurance evidence lets Polymorfa measure what the other devices linked to a number do with it: how many messages they send, to how many people, how fast, and in which hours. Only counts are kept, never messages, contacts, or device names. With it off, a claim can still be filed, but Polymorfa cannot say whether another device caused the ban and a person decides the claim.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "sessions:read",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "projectId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "The project's ban insurance evidence setting",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetProjectInsuranceEvidenceResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">sessions:read</Badge>"
        }
      },
      "put": {
        "operationId": "updateProjectInsuranceEvidence",
        "tags": [
          "Ban insurance"
        ],
        "summary": "Set ban insurance evidence setting",
        "description": "**Required scope:** `sessions:manage`\n\nBan insurance evidence lets Polymorfa measure what the other devices linked to a number do with it: how many messages they send, to how many people, how fast, and in which hours. Only counts are kept, never messages, contacts, or device names. With it off, a claim can still be filed, but Polymorfa cannot say whether another device caused the ban and a person decides the claim.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "sessions:manage",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "projectId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "enabled"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The project's ban insurance evidence setting was updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateProjectInsuranceEvidenceResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          },
          "503": {
            "description": "Stored, but a connected number did not confirm the change; retry the request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "service_unavailable",
                    "message": "A required service is unavailable. Check completion before repeating a write.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#service-unavailable"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">sessions:manage</Badge>"
        }
      }
    },
    "/messaging/projects/{projectId}/observation-policy": {
      "get": {
        "operationId": "getProjectObservationPolicy",
        "tags": [
          "Presence",
          "Labels",
          "Business App"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "presence:read",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "projectId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Project observation ceiling",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetProjectObservationPolicyResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">presence:read</Badge>"
        },
        "description": "**Required scope:** `presence:read`"
      },
      "put": {
        "operationId": "updateProjectObservationPolicy",
        "tags": [
          "Presence",
          "Labels",
          "Business App"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "presence:observe",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "projectId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "presenceMode": {
                    "type": "string",
                    "enum": [
                      "off",
                      "events",
                      "cache"
                    ]
                  },
                  "typingMode": {
                    "type": "string",
                    "enum": [
                      "off",
                      "events",
                      "cache"
                    ]
                  },
                  "labelMode": {
                    "type": "string",
                    "enum": [
                      "off",
                      "events",
                      "cache",
                      "project"
                    ]
                  },
                  "quickReplyMode": {
                    "type": "string",
                    "enum": [
                      "off",
                      "events",
                      "cache"
                    ]
                  }
                },
                "required": [
                  "presenceMode",
                  "typingMode"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Project observation ceiling updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateProjectObservationPolicyResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "409": {
            "description": "Label projection cleanup is active or failed; resolve failed cleanup before re-enabling project retention",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "conflict_error",
                    "code": "state_conflict",
                    "message": "The request conflicts with the resource state.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#state-conflict"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          },
          "503": {
            "description": "Policy was stored but a connected runner did not acknowledge it; retry the request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "service_unavailable",
                    "message": "A required service is unavailable. Check completion before repeating a write.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#service-unavailable"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">presence:observe</Badge>"
        },
        "description": "**Required scope:** `presence:observe`"
      }
    },
    "/messaging/{session}/observation-policy": {
      "get": {
        "operationId": "getSessionObservationPolicy",
        "tags": [
          "Presence",
          "Labels",
          "Business App"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "presence:read",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "required": true,
            "name": "session",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Effective session observation policy",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetSessionObservationPolicyResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">presence:read</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `presence:read`"
      },
      "put": {
        "operationId": "updateSessionObservationPolicy",
        "tags": [
          "Presence",
          "Labels",
          "Business App"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "presence:observe",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "required": true,
            "name": "session",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "presenceMode": {
                    "type": "string",
                    "enum": [
                      "inherit",
                      "off",
                      "events",
                      "cache"
                    ]
                  },
                  "typingMode": {
                    "type": "string",
                    "enum": [
                      "inherit",
                      "off",
                      "events",
                      "cache"
                    ]
                  },
                  "labelMode": {
                    "type": "string",
                    "enum": [
                      "inherit",
                      "off",
                      "events",
                      "cache",
                      "project"
                    ]
                  },
                  "quickReplyMode": {
                    "type": "string",
                    "enum": [
                      "inherit",
                      "off",
                      "events",
                      "cache"
                    ]
                  }
                },
                "required": [
                  "presenceMode",
                  "typingMode"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Session observation override updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateSessionObservationPolicyResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "409": {
            "description": "Label projection cleanup is active or failed; resolve failed cleanup before re-enabling project retention",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "conflict_error",
                    "code": "state_conflict",
                    "message": "The request conflicts with the resource state.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#state-conflict"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          },
          "503": {
            "description": "Policy was stored but a connected runner did not acknowledge it; retry the request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "service_unavailable",
                    "message": "A required service is unavailable. Check completion before repeating a write.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#service-unavailable"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">presence:observe</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `presence:observe`"
      }
    },
    "/messaging/{session}/profile": {
      "get": {
        "operationId": "getProfile",
        "tags": [
          "Profile"
        ],
        "summary": "Get the session's own profile",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "profile:read",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Profile info",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetProfileResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">profile:read</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `profile:read`"
      }
    },
    "/messaging/{session}/profile/name": {
      "put": {
        "operationId": "setProfileName",
        "tags": [
          "Profile"
        ],
        "summary": "Set profile display name (push name)",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "profile:write",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetProfileNameRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Name updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">profile:write</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `profile:write`"
      }
    },
    "/messaging/{session}/profile/status": {
      "put": {
        "operationId": "setProfileStatus",
        "tags": [
          "Profile"
        ],
        "summary": "Set profile status (about) text",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "profile:write",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetProfileStatusRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Status updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">profile:write</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `profile:write`"
      }
    },
    "/messaging/{session}/profile/picture": {
      "put": {
        "operationId": "setProfilePicture",
        "tags": [
          "Profile"
        ],
        "summary": "Set profile picture",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "profile:write",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetProfilePictureRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Picture updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">profile:write</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `profile:write`"
      },
      "delete": {
        "operationId": "deleteProfilePicture",
        "tags": [
          "Profile"
        ],
        "summary": "Remove the profile picture",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "profile:write",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Picture deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">profile:write</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `profile:write`"
      }
    },
    "/messaging/{session}/privacy": {
      "get": {
        "operationId": "getPrivacySettings",
        "tags": [
          "Privacy"
        ],
        "summary": "Get privacy settings",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "profile:read",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Privacy settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrivacySettingsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">profile:read</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `profile:read`"
      }
    },
    "/messaging/{session}/privacy/disappearing/default": {
      "put": {
        "operationId": "setDefaultDisappearingTimer",
        "tags": [
          "Privacy"
        ],
        "summary": "Set the default disappearing-message timer",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "profile:write",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DefaultDisappearingTimerRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Default disappearing-message timer updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">profile:write</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `profile:write`"
      }
    },
    "/messaging/{session}/privacy/{setting}": {
      "put": {
        "operationId": "setPrivacySetting",
        "tags": [
          "Privacy"
        ],
        "summary": "Update a privacy setting",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "profile:write",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "groupadd",
                "last",
                "status",
                "profile",
                "readreceipts",
                "online",
                "calladd",
                "messages",
                "defense",
                "stickers"
              ]
            },
            "required": true,
            "name": "setting",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetPrivacySettingRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated privacy settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdatedPrivacySettingsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">profile:write</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `profile:write`"
      }
    },
    "/messaging/{session}/labels": {
      "get": {
        "operationId": "listLabels",
        "tags": [
          "Labels"
        ],
        "summary": "List labels defined for the session",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "labels:read",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            },
            "required": false,
            "name": "includeObservation",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Label list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListLabelsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">labels:read</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `labels:read`"
      },
      "post": {
        "operationId": "createLabel",
        "tags": [
          "Labels"
        ],
        "summary": "Create a label",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "labels:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateLabelRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Label created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateLabelResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">labels:manage</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `labels:manage`"
      }
    },
    "/messaging/{session}/labels/{labelId}": {
      "put": {
        "operationId": "updateLabel",
        "tags": [
          "Labels"
        ],
        "summary": "Update a label",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "labels:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "labelId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateLabelRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Label updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "409": {
            "description": "The session has no authoritative view of its labels yet. Retry once a cached or project-retained snapshot is complete.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "conflict_error",
                    "code": "state_conflict",
                    "message": "The request conflicts with the resource state.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#state-conflict"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">labels:manage</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `labels:manage`"
      },
      "delete": {
        "operationId": "deleteLabel",
        "tags": [
          "Labels"
        ],
        "summary": "Delete a label",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "labels:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "labelId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Label deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">labels:manage</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `labels:manage`"
      }
    },
    "/messaging/{session}/labels/chats/{conversation}": {
      "get": {
        "operationId": "getChatLabels",
        "tags": [
          "Labels"
        ],
        "summary": "Get labels attached to a chat",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "labels:read",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "conversation",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            },
            "required": false,
            "name": "includeObservation",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Chat labels",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetChatLabelsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">labels:read</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `labels:read`"
      },
      "put": {
        "operationId": "setChatLabels",
        "tags": [
          "Labels"
        ],
        "summary": "Replace the set of labels attached to a chat",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "labels:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "session",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "conversation",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetChatLabelsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Chat labels updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "409": {
            "description": "The session has no authoritative view of its labels yet. Retry once a cached or project-retained snapshot is complete.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "conflict_error",
                    "code": "state_conflict",
                    "message": "The request conflicts with the resource state.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#state-conflict"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">labels:manage</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `labels:manage`"
      }
    },
    "/messaging/webhooks": {
      "get": {
        "operationId": "listWebhooks",
        "tags": [
          "Webhooks"
        ],
        "summary": "List webhooks for the tenant",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "webhooks:manage",
        "responses": {
          "200": {
            "description": "Webhook list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListWebhooksResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">webhooks:manage</Badge>"
        },
        "description": "**Required scope:** `webhooks:manage`"
      },
      "post": {
        "operationId": "createWebhook",
        "tags": [
          "Webhooks"
        ],
        "summary": "Register a new webhook",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "webhooks:manage",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWebhookRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Webhook created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateWebhookResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">webhooks:manage</Badge>"
        },
        "description": "**Required scope:** `webhooks:manage`"
      }
    },
    "/messaging/webhooks/{id}": {
      "get": {
        "operationId": "getWebhook",
        "tags": [
          "Webhooks"
        ],
        "summary": "Get a webhook by id",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "webhooks:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Webhook details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetWebhookResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">webhooks:manage</Badge>"
        },
        "description": "**Required scope:** `webhooks:manage`"
      },
      "put": {
        "operationId": "updateWebhook",
        "tags": [
          "Webhooks"
        ],
        "summary": "Update a webhook",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "webhooks:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWebhookRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Webhook updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateWebhookResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">webhooks:manage</Badge>"
        },
        "description": "**Required scope:** `webhooks:manage`"
      },
      "delete": {
        "operationId": "deleteWebhook",
        "tags": [
          "Webhooks"
        ],
        "summary": "Delete a webhook",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "webhooks:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Webhook deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">webhooks:manage</Badge>"
        },
        "description": "**Required scope:** `webhooks:manage`"
      }
    },
    "/messaging/media/{id}": {
      "get": {
        "operationId": "downloadMedia",
        "tags": [
          "Media"
        ],
        "summary": "Download media (binary stream or redirect to S3)",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "media:read",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Media binary stream"
          },
          "302": {
            "description": "Redirect to S3"
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">media:read</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `media:read`"
      }
    },
    "/messaging/media/{id}/info": {
      "get": {
        "operationId": "getMediaInfo",
        "tags": [
          "Media"
        ],
        "summary": "Get media metadata",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "media:read",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Media info",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetMediaInfoResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">media:read</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `media:read`"
      }
    },
    "/messaging/media/{id}/download-and-save": {
      "post": {
        "operationId": "downloadAndSaveMedia",
        "tags": [
          "Media"
        ],
        "summary": "Download media and persist it to the tenant's S3 bucket",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "media:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Persistence queued or already persisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"green\" icon=\"laptop\">Linked Device API</Badge> <Badge color=\"yellow\" icon=\"key\">media:manage</Badge>"
        },
        "x-protocols": [
          "Linked Device API"
        ],
        "description": "**Protocols:** Linked Device API\n\n**Required scope:** `media:manage`"
      }
    },
    "/messaging/projects/{projectSlug}/templates": {
      "get": {
        "operationId": "listProjectTemplates",
        "tags": [
          "Templates"
        ],
        "summary": "List project message templates",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "templates:read",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "projectSlug",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Templates",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListProjectTemplatesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">templates:read</Badge>"
        },
        "description": "**Required scope:** `templates:read`"
      },
      "post": {
        "operationId": "createProjectTemplate",
        "tags": [
          "Templates"
        ],
        "summary": "Create a project message template",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "templates:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "projectSlug",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateMessageTemplateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateProjectTemplateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">templates:manage</Badge>"
        },
        "description": "**Required scope:** `templates:manage`"
      }
    },
    "/messaging/projects/{projectSlug}/templates/{id}": {
      "get": {
        "operationId": "getProjectTemplate",
        "tags": [
          "Templates"
        ],
        "summary": "Get a project message template",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "templates:read",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "projectSlug",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Template",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetProjectTemplateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">templates:read</Badge>"
        },
        "description": "**Required scope:** `templates:read`"
      },
      "patch": {
        "operationId": "updateProjectTemplate",
        "tags": [
          "Templates"
        ],
        "summary": "Update a project message template",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "templates:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "projectSlug",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateMessageTemplateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateProjectTemplateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">templates:manage</Badge>"
        },
        "description": "**Required scope:** `templates:manage`"
      },
      "delete": {
        "operationId": "deleteProjectTemplate",
        "tags": [
          "Templates"
        ],
        "summary": "Delete a project message template",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "templates:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "projectSlug",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">templates:manage</Badge>"
        },
        "description": "**Required scope:** `templates:manage`"
      }
    },
    "/messaging/projects/{projectSlug}/templates/{id}/preview": {
      "post": {
        "operationId": "previewProjectTemplate",
        "tags": [
          "Templates"
        ],
        "summary": "Render a template preview (idealized) or surface-specific output",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "templates:read",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "projectSlug",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PreviewMessageTemplateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Rendered",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreviewProjectTemplateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">templates:read</Badge>"
        },
        "description": "**Required scope:** `templates:read`"
      }
    },
    "/messaging/projects/{projectSlug}/templates/{id}/submit": {
      "post": {
        "operationId": "submitProjectTemplateToMeta",
        "tags": [
          "Templates"
        ],
        "summary": "Submit a project template to Meta for approval on a Cloud-API session",
        "description": "**Required scope:** `templates:manage`\n\nRenders the canonical template into a Meta create-template payload and submits it through the given cloud_api session. Records a per-session approval pointer (cloudLinks) and returns the updated template. The Meta review verdict arrives later via webhook.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "templates:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "projectSlug",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubmitMessageTemplateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Submitted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubmitProjectTemplateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">templates:manage</Badge>"
        }
      }
    },
    "/messaging/projects/{projectSlug}/campaigns": {
      "get": {
        "operationId": "listCampaigns",
        "tags": [
          "Campaigns"
        ],
        "summary": "List campaigns",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "campaigns:read",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "projectSlug",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListCampaignsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">campaigns:read</Badge>"
        },
        "description": "**Required scope:** `campaigns:read`"
      },
      "post": {
        "operationId": "createCampaign",
        "tags": [
          "Campaigns"
        ],
        "summary": "Create a campaign",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "campaigns:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "projectSlug",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCampaignRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateCampaignResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "402": {
            "description": "This project has no number on a plan that includes Campaigns (`campaigns_not_entitled`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "entitlement_required",
                    "message": "The account needs the required entitlement for this action.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#entitlement-required"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">campaigns:manage</Badge>"
        },
        "description": "**Required scope:** `campaigns:manage`"
      }
    },
    "/messaging/projects/{projectSlug}/campaigns/{id}": {
      "get": {
        "operationId": "getCampaign",
        "tags": [
          "Campaigns"
        ],
        "summary": "Get a campaign",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "campaigns:read",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "projectSlug",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetCampaignResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "402": {
            "description": "This project has no number on a plan that includes Campaigns (`campaigns_not_entitled`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "entitlement_required",
                    "message": "The account needs the required entitlement for this action.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#entitlement-required"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">campaigns:read</Badge>"
        },
        "description": "**Required scope:** `campaigns:read`"
      }
    },
    "/messaging/projects/{projectSlug}/campaigns/{id}/analytics": {
      "get": {
        "operationId": "getCampaignAnalytics",
        "tags": [
          "Campaigns"
        ],
        "summary": "Campaign analytics (funnel, response timing, retries)",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "campaigns:read",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "projectSlug",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignAnalyticsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "402": {
            "description": "This project has no number on a plan that includes Campaigns (`campaigns_not_entitled`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "entitlement_required",
                    "message": "The account needs the required entitlement for this action.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#entitlement-required"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">campaigns:read</Badge>"
        },
        "description": "**Required scope:** `campaigns:read`"
      }
    },
    "/messaging/projects/{projectSlug}/campaigns/{id}/launch": {
      "post": {
        "operationId": "launchCampaign",
        "tags": [
          "Campaigns"
        ],
        "summary": "Launch a campaign",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "campaigns:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "projectSlug",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LaunchCampaignRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LaunchCampaignResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "402": {
            "description": "This project has no number on a plan that includes Campaigns (`campaigns_not_entitled`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "entitlement_required",
                    "message": "The account needs the required entitlement for this action.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#entitlement-required"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">campaigns:manage</Badge>"
        },
        "description": "**Required scope:** `campaigns:manage`"
      }
    },
    "/messaging/projects/{projectSlug}/campaigns/{id}/pause": {
      "post": {
        "operationId": "pauseCampaign",
        "tags": [
          "Campaigns"
        ],
        "summary": "Pause a campaign",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "campaigns:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "projectSlug",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PauseCampaignResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "402": {
            "description": "This project has no number on a plan that includes Campaigns (`campaigns_not_entitled`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "entitlement_required",
                    "message": "The account needs the required entitlement for this action.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#entitlement-required"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">campaigns:manage</Badge>"
        },
        "description": "**Required scope:** `campaigns:manage`"
      }
    },
    "/messaging/projects/{projectSlug}/campaigns/{id}/resume": {
      "post": {
        "operationId": "resumeCampaign",
        "tags": [
          "Campaigns"
        ],
        "summary": "Resume a campaign",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "campaigns:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "projectSlug",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResumeCampaignResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "402": {
            "description": "This project has no number on a plan that includes Campaigns (`campaigns_not_entitled`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "entitlement_required",
                    "message": "The account needs the required entitlement for this action.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#entitlement-required"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">campaigns:manage</Badge>"
        },
        "description": "**Required scope:** `campaigns:manage`"
      }
    },
    "/messaging/projects/{projectSlug}/campaigns/{id}/stop": {
      "post": {
        "operationId": "stopCampaign",
        "tags": [
          "Campaigns"
        ],
        "summary": "Stop a campaign",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "campaigns:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "projectSlug",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StopCampaignResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "402": {
            "description": "This project has no number on a plan that includes Campaigns (`campaigns_not_entitled`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "entitlement_required",
                    "message": "The account needs the required entitlement for this action.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#entitlement-required"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">campaigns:manage</Badge>"
        },
        "description": "**Required scope:** `campaigns:manage`"
      }
    },
    "/messaging/projects/{projectSlug}/campaigns/{id}/requeue": {
      "post": {
        "operationId": "requeueCampaign",
        "tags": [
          "Campaigns"
        ],
        "summary": "Re-queue failed recipients",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "campaigns:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "projectSlug",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RequeueCampaignRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RequeueCampaignResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "402": {
            "description": "This project has no number on a plan that includes Campaigns (`campaigns_not_entitled`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "entitlement_required",
                    "message": "The account needs the required entitlement for this action.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#entitlement-required"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">campaigns:manage</Badge>"
        },
        "description": "**Required scope:** `campaigns:manage`"
      }
    },
    "/messaging/cloud-api/embedded-signup": {
      "post": {
        "operationId": "embeddedSignup",
        "tags": [
          "Cloud API"
        ],
        "summary": "Advance Cloud onboarding for a reserved session",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "sessions:manage",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmbeddedSignupRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Onboarding progress",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "stage": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "stage"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">sessions:manage</Badge>"
        },
        "description": "**Required scope:** `sessions:manage`"
      }
    },
    "/messaging/quicklinks": {
      "post": {
        "operationId": "createQuickLink",
        "tags": [
          "QuickLink"
        ],
        "summary": "Create a QuickLink",
        "description": "**Required scope:** `quicklink:manage`\n\nCreates a persistent hosted link that connects one WhatsApp number to a new session in the project.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "quicklink:manage",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateQuickLinkRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "QuickLink created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuickLinkResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">quicklink:manage</Badge>"
        }
      }
    },
    "/messaging/quicklinks/{id}": {
      "get": {
        "operationId": "getQuickLink",
        "tags": [
          "QuickLink"
        ],
        "summary": "Read QuickLink status",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "quicklink:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Current QuickLink status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuickLinkStatusResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">quicklink:manage</Badge>"
        },
        "description": "**Required scope:** `quicklink:manage`"
      },
      "delete": {
        "operationId": "cancelQuickLink",
        "tags": [
          "QuickLink"
        ],
        "summary": "Cancel a QuickLink",
        "description": "**Required scope:** `quicklink:manage`\n\nInvalidates the link and removes its pending session. Connected links cannot be cancelled.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scope": "quicklink:manage",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Cancelled",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request — request body or params failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Correct the invalid request field.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "authentication_error",
                    "code": "invalid_credential",
                    "message": "Supply a valid credential.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated but not permitted (missing scope or rule violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "The credential does not have access to this resource.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "The resource is unavailable to this caller.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicError"
                },
                "example": {
                  "error": {
                    "type": "api_error",
                    "code": "internal_error",
                    "message": "An unexpected service failure occurred. Keep the request ID for support.",
                    "param": null
                  },
                  "data": null,
                  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
                }
              }
            }
          }
        },
        "x-mint": {
          "content": "<Badge color=\"yellow\" icon=\"key\">quicklink:manage</Badge>"
        }
      }
    },
    "/quicklink/{token}/phone": {
      "post": {
        "operationId": "confirmQuickLinkPhone",
        "tags": [
          "QuickLink"
        ],
        "security": [],
        "summary": "Confirm the number for this invitation",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Opaque QuickLink token from the hosted URL."
            },
            "required": true,
            "name": "token",
            "in": "path"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "phone": {
                    "type": "string",
                    "maxLength": 32
                  },
                  "noNumber": {
                    "type": "boolean",
                    "enum": [
                      true
                    ]
                  },
                  "whatsappPhone": {
                    "type": "string",
                    "maxLength": 32
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Phone confirmed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "confirmed": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "confirmed"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "403": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "404": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "409": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "422": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "429": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "500": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "503": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          }
        }
      }
    },
    "/quicklink/{token}/phone/reset": {
      "post": {
        "operationId": "resetQuickLinkPhone",
        "tags": [
          "QuickLink"
        ],
        "security": [],
        "summary": "Return to phone entry before connecting",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Opaque QuickLink token from the hosted URL."
            },
            "required": true,
            "name": "token",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Phone entry restored",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "confirmed": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "confirmed"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "403": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "404": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "409": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "422": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "429": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "500": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "503": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          }
        }
      }
    },
    "/quicklink/{token}/connection": {
      "post": {
        "operationId": "selectQuickLinkConnection",
        "tags": [
          "QuickLink"
        ],
        "security": [],
        "summary": "Select an allowed connection type",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Opaque QuickLink token from the hosted URL."
            },
            "required": true,
            "name": "token",
            "in": "path"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "connection": {
                    "type": "string",
                    "enum": [
                      "cloud",
                      "linked"
                    ]
                  }
                },
                "required": [
                  "connection"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Selected",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "connection": {
                          "type": "string",
                          "enum": [
                            "cloud",
                            "linked"
                          ]
                        }
                      },
                      "required": [
                        "connection"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "403": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "404": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "409": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "422": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "429": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "500": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "503": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          }
        }
      }
    },
    "/quicklink/{token}/cloud": {
      "post": {
        "operationId": "completeQuickLinkCloudSignup",
        "tags": [
          "QuickLink"
        ],
        "security": [],
        "summary": "Advance Cloud onboarding",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Opaque QuickLink token from the hosted URL."
            },
            "required": true,
            "name": "token",
            "in": "path"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "result": {
                    "$ref": "#/components/schemas/EmbeddedSignupResult"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Onboarding progress",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "stage": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "stage"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "403": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "404": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "409": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "422": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "429": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "500": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "503": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          }
        }
      }
    },
    "/quicklink/{token}": {
      "get": {
        "operationId": "getQuickLinkState",
        "tags": [
          "QuickLink"
        ],
        "security": [],
        "summary": "Read QuickLink state",
        "description": "Returns the hosted page state for a QuickLink. Public; the token in the URL is the credential. Starts linked-device pairing after an allowed connection type has been selected.",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Opaque QuickLink token from the hosted URL."
            },
            "required": true,
            "name": "token",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Current QuickLink state",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/QuickLinkState"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "403": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "404": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "409": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "422": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "429": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "500": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "503": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          }
        }
      }
    },
    "/quicklink/{token}/logo": {
      "get": {
        "operationId": "getQuickLinkLogo",
        "tags": [
          "QuickLink"
        ],
        "security": [],
        "summary": "Read the QuickLink page logo",
        "description": "Returns the saved logo image for the page. Public; the token in the URL is the credential.",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Opaque QuickLink token from the hosted URL."
            },
            "required": true,
            "name": "token",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Logo image",
            "content": {
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "403": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "404": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "409": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "422": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "429": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "500": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "503": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          }
        }
      }
    },
    "/quicklink/{token}/code": {
      "post": {
        "operationId": "requestQuickLinkCode",
        "tags": [
          "QuickLink"
        ],
        "security": [],
        "summary": "Request a QuickLink pairing code",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Opaque QuickLink token from the hosted URL."
            },
            "required": true,
            "name": "token",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuickLinkCodeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Pairing code issued",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "phone": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "phone"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "403": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "404": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "409": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "422": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "429": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "500": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "503": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          }
        }
      }
    },
    "/quicklink/{token}/confirm": {
      "post": {
        "operationId": "confirmQuickLink",
        "tags": [
          "QuickLink"
        ],
        "security": [],
        "summary": "Confirm a linked QuickLink",
        "description": "Records consent, applies the chat-history choice, assigns Customer ownership when applicable, and returns the redirect target.",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Opaque QuickLink token from the hosted URL."
            },
            "required": true,
            "name": "token",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuickLinkConfirmRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Connected",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "connected"
                          ]
                        },
                        "phone": {
                          "type": "string",
                          "nullable": true
                        },
                        "historySync": {
                          "type": "boolean"
                        },
                        "redirectUrl": {
                          "type": "string",
                          "nullable": true
                        }
                      },
                      "required": [
                        "status",
                        "phone",
                        "historySync",
                        "redirectUrl"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "403": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "404": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "409": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "422": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "429": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "500": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "503": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          }
        }
      }
    },
    "/quicklink/{token}/cancel": {
      "post": {
        "operationId": "cancelQuickLinkByToken",
        "tags": [
          "QuickLink"
        ],
        "security": [],
        "summary": "Cancel a QuickLink from the hosted page",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Opaque QuickLink token from the hosted URL."
            },
            "required": true,
            "name": "token",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Cancelled",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "cancelled"
                          ]
                        },
                        "redirectUrl": {
                          "type": "string",
                          "nullable": true
                        }
                      },
                      "required": [
                        "status",
                        "redirectUrl"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "403": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "404": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "409": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "422": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "429": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "500": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          },
          "503": {
            "description": "QuickLink request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuickLinkError"
                }
              }
            }
          }
        }
      }
    }
  },
  "x-webhooks": {
    "message.received": {
      "post": {
        "operationId": "onMessageReceived",
        "summary": "Incoming message",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MessageReceivedEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "message.sent": {
      "post": {
        "operationId": "onMessageSent",
        "summary": "Outgoing message successfully sent",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MessageSentEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "message.ack": {
      "post": {
        "operationId": "onMessageAck",
        "summary": "Delivery acknowledgement",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MessageAckEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "message.revoked": {
      "post": {
        "operationId": "onMessageRevoked",
        "summary": "Message revoked",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MessageRevokedEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "message.reaction": {
      "post": {
        "operationId": "onMessageReaction",
        "summary": "Reaction added or removed",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MessageReactionEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "message.edited": {
      "post": {
        "operationId": "onMessageEdited",
        "summary": "Message edited",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MessageEditedEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "message.update": {
      "post": {
        "operationId": "onMessageUpdate",
        "summary": "Generic message update",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MessageUpdateEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "message.delete": {
      "post": {
        "operationId": "onMessageDelete",
        "summary": "Message deleted from another device",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MessageDeleteEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "message.vote": {
      "post": {
        "operationId": "onMessageVote",
        "summary": "Poll vote cast",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MessageVoteEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "session.status": {
      "post": {
        "operationId": "onSessionStatus",
        "summary": "Session status change",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SessionStatusEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "session.connected": {
      "post": {
        "operationId": "onSessionConnected",
        "summary": "Session connected to WhatsApp",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SessionConnectedEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "session.logged_out": {
      "post": {
        "operationId": "onSessionLoggedOut",
        "summary": "Session logged out",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SessionLoggedOutEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "session.phone_offline": {
      "post": {
        "operationId": "onSessionPhoneOffline",
        "summary": "Primary phone has been offline for an extended period",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SessionPhoneOfflineEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "group.update": {
      "post": {
        "operationId": "onGroupUpdate",
        "summary": "Group metadata changed",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GroupUpdateEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "group.participant": {
      "post": {
        "operationId": "onGroupParticipant",
        "summary": "Group participants added/removed/promoted/demoted",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GroupParticipantEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "presence.update": {
      "post": {
        "operationId": "onPresenceUpdate",
        "summary": "User or chat presence change",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PresenceUpdateEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "contact.update": {
      "post": {
        "operationId": "onContactUpdate",
        "summary": "Contact info changed",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactUpdateEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "chat.archive": {
      "post": {
        "operationId": "onChatArchive",
        "summary": "Chat archived or pinned",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatArchiveEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "chat.mute": {
      "post": {
        "operationId": "onChatMute",
        "summary": "Chat muted or unmuted",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatMuteEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "chat.read": {
      "post": {
        "operationId": "onChatRead",
        "summary": "Chat marked read or unread",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatReadEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "chat.clear": {
      "post": {
        "operationId": "onChatClear",
        "summary": "Chat cleared",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatClearEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "chat.delete": {
      "post": {
        "operationId": "onChatDelete",
        "summary": "Chat deleted",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatDeleteEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "call.received": {
      "post": {
        "operationId": "onCallReceived",
        "summary": "Incoming call",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CallReceivedEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "call.missed": {
      "post": {
        "operationId": "onCallMissed",
        "summary": "Call missed",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CallMissedEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "call.accepted": {
      "post": {
        "operationId": "onCallAccepted",
        "summary": "Call accepted",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CallAcceptedEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "call.rejected": {
      "post": {
        "operationId": "onCallRejected",
        "summary": "Call rejected",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CallRejectedEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "call.ended": {
      "post": {
        "operationId": "onCallEnded",
        "summary": "Call ended",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CallEndedEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "call.telemetry": {
      "post": {
        "operationId": "onCallTelemetry",
        "summary": "Call telemetry",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CallTelemetryEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "call.participant_joined": {
      "post": {
        "operationId": "onCallParticipantJoined",
        "summary": "Participant joined a call",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CallParticipantJoinedEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "call.participant_state": {
      "post": {
        "operationId": "onCallParticipantState",
        "summary": "Participant call state changed",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CallParticipantStateEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "call.participant_left": {
      "post": {
        "operationId": "onCallParticipantLeft",
        "summary": "Participant left a call",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CallParticipantLeftEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "newsletter.update": {
      "post": {
        "operationId": "onNewsletterUpdate",
        "summary": "Newsletter subscription change",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewsletterUpdateEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "blocklist.update": {
      "post": {
        "operationId": "onBlocklistUpdate",
        "summary": "Blocklist changed",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BlocklistUpdateEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "labels.update": {
      "post": {
        "operationId": "onLabelsUpdate",
        "summary": "Label edited / associated / star toggled",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LabelsUpdateEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "business.quick_reply.update": {
      "post": {
        "operationId": "onBusinessQuickReplyUpdate",
        "summary": "WhatsApp Business App quick reply changed",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessQuickReplyUpdateEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "contact.sync": {
      "post": {
        "operationId": "onContactSync",
        "summary": "WhatsApp Business app contact synchronization",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactsSyncEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "message.echo": {
      "post": {
        "operationId": "onMessageEcho",
        "summary": "Message sent from the WhatsApp Business app",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MessageEchoEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "history.sync": {
      "post": {
        "operationId": "onHistorySync",
        "summary": "History sync chunk",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HistorySyncEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "command.result": {
      "post": {
        "operationId": "onCommandResult",
        "summary": "Async command completed",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CommandResultEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "customer.enabled": {
      "post": {
        "operationId": "onCustomerEnabled",
        "summary": "Customers enabled for a project",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerEnabledEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "customer.created": {
      "post": {
        "operationId": "onCustomerCreated",
        "summary": "Customer created",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerCreatedEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "customer.updated": {
      "post": {
        "operationId": "onCustomerUpdated",
        "summary": "Customer updated",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerUpdatedEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "customer.archiving": {
      "post": {
        "operationId": "onCustomerArchiving",
        "summary": "Customer archival started",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerArchivingEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "customer.archived": {
      "post": {
        "operationId": "onCustomerArchived",
        "summary": "Customer archived",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerArchivedEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "customer.restored": {
      "post": {
        "operationId": "onCustomerRestored",
        "summary": "Customer restored",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerRestoredEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "customer.pairing_link.created": {
      "post": {
        "operationId": "onCustomerPairingLinkCreated",
        "summary": "Customer pairing link created",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerPairingLinkCreatedEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "customer.pairing_link.opened": {
      "post": {
        "operationId": "onCustomerPairingLinkOpened",
        "summary": "Customer pairing link opened",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerPairingLinkOpenedEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "customer.pairing_link.connected": {
      "post": {
        "operationId": "onCustomerPairingLinkConnected",
        "summary": "Customer pairing link connected",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerPairingLinkConnectedEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "customer.pairing_link.failed": {
      "post": {
        "operationId": "onCustomerPairingLinkFailed",
        "summary": "Customer pairing attempt failed",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerPairingLinkFailedEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "customer.pairing_link.expired": {
      "post": {
        "operationId": "onCustomerPairingLinkExpired",
        "summary": "Customer pairing link expired",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerPairingLinkExpiredEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "customer.pairing_link.revoked": {
      "post": {
        "operationId": "onCustomerPairingLinkRevoked",
        "summary": "Customer pairing link revoked",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerPairingLinkRevokedEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "customer.number.attached": {
      "post": {
        "operationId": "onCustomerNumberAttached",
        "summary": "Number attached to a Customer",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerNumberAttachedEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "customer.number.transferred": {
      "post": {
        "operationId": "onCustomerNumberTransferred",
        "summary": "Number transferred to a Customer",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerNumberTransferredEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "customer.number.disconnected": {
      "post": {
        "operationId": "onCustomerNumberDisconnected",
        "summary": "Customer Number disconnected",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerNumberDisconnectedEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "bansafe.enforcement": {
      "post": {
        "operationId": "onBansafeEnforcement",
        "summary": "WhatsApp applied an enforcement to a number, or a ban was reported",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BanSafeEnforcementEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "bansafe.action": {
      "post": {
        "operationId": "onBansafeAction",
        "summary": "Polymorfa applied, changed, or lifted a safety restriction on a number",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BanSafeActionEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "bansafe.health_threshold": {
      "post": {
        "operationId": "onBansafeHealthThreshold",
        "summary": "A project's present Health rule crossed below its threshold",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BanSafeHealthThresholdEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "bansafe.incident": {
      "post": {
        "operationId": "onBansafeIncident",
        "summary": "A restriction was recorded on a number, or the record of one settled",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BanSafeIncidentEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "bansafe.claim": {
      "post": {
        "operationId": "onBansafeClaim",
        "summary": "A Ban Insurance claim was filed on a ban, decided, paid, or reversed",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BanSafeClaimEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "message.failed": {
      "post": {
        "operationId": "onMessageFailed",
        "summary": "Outbound send failed, including a send refused by safety",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MessageFailedEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "template.status": {
      "post": {
        "operationId": "onTemplateStatus",
        "summary": "Message template approval status changed",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TemplateStatusEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "campaign.paused": {
      "post": {
        "operationId": "onCampaignPaused",
        "summary": "Campaign paused",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CampaignPausedEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "campaign.completed": {
      "post": {
        "operationId": "onCampaignCompleted",
        "summary": "Campaign finished sending",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CampaignCompletedEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "campaign.failed": {
      "post": {
        "operationId": "onCampaignFailed",
        "summary": "Campaign failed",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CampaignFailedEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "campaign.recipient_sent": {
      "post": {
        "operationId": "onCampaignRecipientSent",
        "summary": "A campaign recipient was sent",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CampaignRecipientSentEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "campaign.recipient_failed": {
      "post": {
        "operationId": "onCampaignRecipientFailed",
        "summary": "A campaign recipient failed after its last attempt",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CampaignRecipientFailedEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "campaign.recipient_skipped": {
      "post": {
        "operationId": "onCampaignRecipientSkipped",
        "summary": "A campaign recipient was skipped",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CampaignRecipientSkippedEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "campaign.throttled": {
      "post": {
        "operationId": "onCampaignThrottled",
        "summary": "Campaign sending was paced",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CampaignThrottledEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "campaign.cap_reached": {
      "post": {
        "operationId": "onCampaignCapReached",
        "summary": "A sending number reached its hourly or daily cap",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CampaignCapReachedEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    },
    "campaign.cold_blocked": {
      "post": {
        "operationId": "onCampaignColdBlocked",
        "summary": "A campaign recipient was held because they never wrote first",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CampaignColdBlockedEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Return any 2xx status to acknowledge receipt. Non-2xx responses are retried according to the retry policy."
          }
        }
      }
    }
  }
}
