{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/run402-com/json-schema/run402-com-telegram-binding-schema.json",
  "title": "TelegramBinding",
  "description": "A bound Telegram chat (notification-channel-routing-telegram, v1.126). Returned by GET /agent/v1/notifications/channels; the create response (POST .../channels/telegram) returns the same core fields inline plus connect_url/connect_group_url.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/run402-com-agent-api-openapi.yml#/components/schemas/TelegramBinding",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "recipient_email": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "pending",
        "active"
      ],
      "description": "Revoked bindings are never returned by list reads (revoked_at IS NULL is the read filter)."
    },
    "chat_id": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Populated once the owner taps the connect link; null while pending."
    },
    "chat_type": {
      "type": [
        "string",
        "null"
      ]
    },
    "chat_title": {
      "type": [
        "string",
        "null"
      ]
    },
    "label": {
      "type": [
        "string",
        "null"
      ]
    },
    "consecutive_failures": {
      "type": "integer"
    },
    "disabled_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "Set when 10 consecutive HARD delivery failures auto-disabled this binding (transient failures never count). A disabled binding still appears in this list — reconnect by deleting and re-creating, or PATCH a rule off it."
    },
    "code_expires_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "Present only while status=pending."
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "activated_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    }
  }
}