{
  "schemaVersion": "1.0",
  "item": {
    "slug": "telegram-api",
    "name": "Telegram Bot",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/byungkyu/telegram-api",
    "canonicalUrl": "https://clawhub.ai/byungkyu/telegram-api",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/telegram-api",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=telegram-api",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md",
      "LICENSE.txt"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-07T17:22:31.273Z",
      "expiresAt": "2026-05-14T17:22:31.273Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=afrexai-annual-report",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=afrexai-annual-report",
        "contentDisposition": "attachment; filename=\"afrexai-annual-report-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/telegram-api"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/telegram-api",
    "agentPageUrl": "https://openagent3.xyz/skills/telegram-api/agent",
    "manifestUrl": "https://openagent3.xyz/skills/telegram-api/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/telegram-api/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Telegram Bot API",
        "body": "Access the Telegram Bot API with managed authentication. Send messages, photos, polls, locations, and more through your Telegram bot."
      },
      {
        "title": "Quick Start",
        "body": "# Get bot info\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://gateway.maton.ai/telegram/:token/getMe')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF"
      },
      {
        "title": "Base URL",
        "body": "https://gateway.maton.ai/telegram/:token/{method}\n\nThe :token placeholder is automatically replaced with your bot token from the connection configuration. Replace {method} with the Telegram Bot API method name (e.g., sendMessage, getUpdates)."
      },
      {
        "title": "Authentication",
        "body": "All requests require the Maton API key in the Authorization header:\n\nAuthorization: Bearer $MATON_API_KEY\n\nEnvironment Variable: Set your API key as MATON_API_KEY:\n\nexport MATON_API_KEY=\"YOUR_API_KEY\""
      },
      {
        "title": "Getting Your API Key",
        "body": "Sign in or create an account at maton.ai\nGo to maton.ai/settings\nCopy your API key"
      },
      {
        "title": "Connection Management",
        "body": "Manage your Telegram bot connections at https://ctrl.maton.ai."
      },
      {
        "title": "List Connections",
        "body": "python <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections?app=telegram&status=ACTIVE')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF"
      },
      {
        "title": "Create Connection",
        "body": "python <<'EOF'\nimport urllib.request, os, json\ndata = json.dumps({'app': 'telegram'}).encode()\nreq = urllib.request.Request('https://ctrl.maton.ai/connections', data=data, method='POST')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nreq.add_header('Content-Type', 'application/json')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF"
      },
      {
        "title": "Get Connection",
        "body": "python <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\nResponse:\n\n{\n  \"connection\": {\n    \"connection_id\": \"e8f5078d-e507-4139-aabe-1615181ea8fc\",\n    \"status\": \"ACTIVE\",\n    \"creation_time\": \"2026-02-07T10:37:21.053942Z\",\n    \"last_updated_time\": \"2026-02-07T10:37:59.881901Z\",\n    \"url\": \"https://connect.maton.ai/?session_token=...\",\n    \"app\": \"telegram\",\n    \"metadata\": {}\n  }\n}\n\nOpen the returned url in a browser to complete the bot token configuration."
      },
      {
        "title": "Delete Connection",
        "body": "python <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}', method='DELETE')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF"
      },
      {
        "title": "Specifying Connection",
        "body": "If you have multiple Telegram connections (multiple bots), specify which one to use with the Maton-Connection header:\n\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://gateway.maton.ai/telegram/:token/getMe')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nreq.add_header('Maton-Connection', 'e8f5078d-e507-4139-aabe-1615181ea8fc')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\nIf omitted, the gateway uses the default (oldest) active connection."
      },
      {
        "title": "Bot Information",
        "body": "Get Bot Info\n\nGET /telegram/:token/getMe\n\nReturns information about the bot.\n\nResponse:\n\n{\n  \"ok\": true,\n  \"result\": {\n    \"id\": 8523474253,\n    \"is_bot\": true,\n    \"first_name\": \"Maton\",\n    \"username\": \"maton_bot\",\n    \"can_join_groups\": true,\n    \"can_read_all_group_messages\": true,\n    \"supports_inline_queries\": true\n  }\n}"
      },
      {
        "title": "Getting Updates",
        "body": "Get Updates (Long Polling)\n\nPOST /telegram/:token/getUpdates\nContent-Type: application/json\n\n{\n  \"limit\": 100,\n  \"timeout\": 30,\n  \"offset\": 625435210\n}\n\nParameterTypeRequiredDescriptionoffsetIntegerNoFirst update ID to returnlimitIntegerNoNumber of updates (1-100, default 100)timeoutIntegerNoLong polling timeout in secondsallowed_updatesArrayNoUpdate types to receive\n\nGet Webhook Info\n\nGET /telegram/:token/getWebhookInfo\n\nSet Webhook\n\nPOST /telegram/:token/setWebhook\nContent-Type: application/json\n\n{\n  \"url\": \"https://example.com/webhook\",\n  \"allowed_updates\": [\"message\", \"callback_query\"],\n  \"secret_token\": \"your_secret_token\"\n}\n\nDelete Webhook\n\nPOST /telegram/:token/deleteWebhook\nContent-Type: application/json\n\n{\n  \"drop_pending_updates\": true\n}"
      },
      {
        "title": "Sending Messages",
        "body": "Send Text Message\n\nPOST /telegram/:token/sendMessage\nContent-Type: application/json\n\n{\n  \"chat_id\": 6442870329,\n  \"text\": \"Hello, World!\",\n  \"parse_mode\": \"HTML\"\n}\n\nParameterTypeRequiredDescriptionchat_idInteger/StringYesTarget chat ID or @usernametextStringYesMessage text (1-4096 characters)parse_modeStringNoHTML, Markdown, or MarkdownV2reply_markupObjectNoInline keyboard or reply keyboardreply_parametersObjectNoReply to a specific message\n\nWith HTML Formatting:\n\nPOST /telegram/:token/sendMessage\nContent-Type: application/json\n\n{\n  \"chat_id\": 6442870329,\n  \"text\": \"<b>Bold</b> and <i>italic</i> with <a href=\\\"https://example.com\\\">link</a>\",\n  \"parse_mode\": \"HTML\"\n}\n\nWith Inline Keyboard:\n\nPOST /telegram/:token/sendMessage\nContent-Type: application/json\n\n{\n  \"chat_id\": 6442870329,\n  \"text\": \"Choose an option:\",\n  \"reply_markup\": {\n    \"inline_keyboard\": [\n      [\n        {\"text\": \"Option 1\", \"callback_data\": \"opt1\"},\n        {\"text\": \"Option 2\", \"callback_data\": \"opt2\"}\n      ],\n      [\n        {\"text\": \"Visit Website\", \"url\": \"https://example.com\"}\n      ]\n    ]\n  }\n}\n\nSend Photo\n\nPOST /telegram/:token/sendPhoto\nContent-Type: application/json\n\n{\n  \"chat_id\": 6442870329,\n  \"photo\": \"https://example.com/image.jpg\",\n  \"caption\": \"Image caption\"\n}\n\nParameterTypeRequiredDescriptionchat_idInteger/StringYesTarget chat IDphotoStringYesPhoto URL or file_idcaptionStringNoCaption (0-1024 characters)parse_modeStringNoCaption parse mode\n\nSend Document\n\nPOST /telegram/:token/sendDocument\nContent-Type: application/json\n\n{\n  \"chat_id\": 6442870329,\n  \"document\": \"https://example.com/file.pdf\",\n  \"caption\": \"Document caption\"\n}\n\nSend Video\n\nPOST /telegram/:token/sendVideo\nContent-Type: application/json\n\n{\n  \"chat_id\": 6442870329,\n  \"video\": \"https://example.com/video.mp4\",\n  \"caption\": \"Video caption\"\n}\n\nSend Audio\n\nPOST /telegram/:token/sendAudio\nContent-Type: application/json\n\n{\n  \"chat_id\": 6442870329,\n  \"audio\": \"https://example.com/audio.mp3\",\n  \"caption\": \"Audio caption\"\n}\n\nSend Location\n\nPOST /telegram/:token/sendLocation\nContent-Type: application/json\n\n{\n  \"chat_id\": 6442870329,\n  \"latitude\": 37.7749,\n  \"longitude\": -122.4194\n}\n\nSend Contact\n\nPOST /telegram/:token/sendContact\nContent-Type: application/json\n\n{\n  \"chat_id\": 6442870329,\n  \"phone_number\": \"+1234567890\",\n  \"first_name\": \"John\",\n  \"last_name\": \"Doe\"\n}\n\nSend Poll\n\nPOST /telegram/:token/sendPoll\nContent-Type: application/json\n\n{\n  \"chat_id\": 6442870329,\n  \"question\": \"What is your favorite color?\",\n  \"options\": [\n    {\"text\": \"Red\"},\n    {\"text\": \"Blue\"},\n    {\"text\": \"Green\"}\n  ],\n  \"is_anonymous\": false\n}\n\nParameterTypeRequiredDescriptionchat_idInteger/StringYesTarget chat IDquestionStringYesPoll question (1-300 characters)optionsArrayYesPoll options (2-10 items)is_anonymousBooleanNoAnonymous poll (default true)typeStringNoregular or quizallows_multiple_answersBooleanNoAllow multiple answerscorrect_option_idIntegerNoCorrect answer for quiz\n\nSend Dice\n\nPOST /telegram/:token/sendDice\nContent-Type: application/json\n\n{\n  \"chat_id\": 6442870329,\n  \"emoji\": \"🎲\"\n}\n\nSupported emoji: 🎲 🎯 🎳 🏀 ⚽ 🎰"
      },
      {
        "title": "Editing Messages",
        "body": "Edit Message Text\n\nPOST /telegram/:token/editMessageText\nContent-Type: application/json\n\n{\n  \"chat_id\": 6442870329,\n  \"message_id\": 123,\n  \"text\": \"Updated message text\"\n}\n\nEdit Message Caption\n\nPOST /telegram/:token/editMessageCaption\nContent-Type: application/json\n\n{\n  \"chat_id\": 6442870329,\n  \"message_id\": 123,\n  \"caption\": \"Updated caption\"\n}\n\nEdit Message Reply Markup\n\nPOST /telegram/:token/editMessageReplyMarkup\nContent-Type: application/json\n\n{\n  \"chat_id\": 6442870329,\n  \"message_id\": 123,\n  \"reply_markup\": {\n    \"inline_keyboard\": [\n      [{\"text\": \"New Button\", \"callback_data\": \"new\"}]\n    ]\n  }\n}\n\nDelete Message\n\nPOST /telegram/:token/deleteMessage\nContent-Type: application/json\n\n{\n  \"chat_id\": 6442870329,\n  \"message_id\": 123\n}"
      },
      {
        "title": "Forwarding & Copying",
        "body": "Forward Message\n\nPOST /telegram/:token/forwardMessage\nContent-Type: application/json\n\n{\n  \"chat_id\": 6442870329,\n  \"from_chat_id\": 6442870329,\n  \"message_id\": 123\n}\n\nCopy Message\n\nPOST /telegram/:token/copyMessage\nContent-Type: application/json\n\n{\n  \"chat_id\": 6442870329,\n  \"from_chat_id\": 6442870329,\n  \"message_id\": 123\n}"
      },
      {
        "title": "Chat Information",
        "body": "Get Chat\n\nPOST /telegram/:token/getChat\nContent-Type: application/json\n\n{\n  \"chat_id\": 6442870329\n}\n\nGet Chat Administrators\n\nPOST /telegram/:token/getChatAdministrators\nContent-Type: application/json\n\n{\n  \"chat_id\": -1001234567890\n}\n\nGet Chat Member Count\n\nPOST /telegram/:token/getChatMemberCount\nContent-Type: application/json\n\n{\n  \"chat_id\": -1001234567890\n}\n\nGet Chat Member\n\nPOST /telegram/:token/getChatMember\nContent-Type: application/json\n\n{\n  \"chat_id\": -1001234567890,\n  \"user_id\": 6442870329\n}"
      },
      {
        "title": "Bot Commands",
        "body": "Set My Commands\n\nPOST /telegram/:token/setMyCommands\nContent-Type: application/json\n\n{\n  \"commands\": [\n    {\"command\": \"start\", \"description\": \"Start the bot\"},\n    {\"command\": \"help\", \"description\": \"Get help\"},\n    {\"command\": \"settings\", \"description\": \"Open settings\"}\n  ]\n}\n\nGet My Commands\n\nGET /telegram/:token/getMyCommands\n\nDelete My Commands\n\nPOST /telegram/:token/deleteMyCommands\nContent-Type: application/json\n\n{}"
      },
      {
        "title": "Bot Profile",
        "body": "Get My Description\n\nGET /telegram/:token/getMyDescription\n\nSet My Description\n\nPOST /telegram/:token/setMyDescription\nContent-Type: application/json\n\n{\n  \"description\": \"This bot helps you manage tasks.\"\n}\n\nSet My Name\n\nPOST /telegram/:token/setMyName\nContent-Type: application/json\n\n{\n  \"name\": \"Task Bot\"\n}"
      },
      {
        "title": "Files",
        "body": "Get File\n\nPOST /telegram/:token/getFile\nContent-Type: application/json\n\n{\n  \"file_id\": \"AgACAgQAAxkDAAM...\"\n}\n\nResponse:\n\n{\n  \"ok\": true,\n  \"result\": {\n    \"file_id\": \"AgACAgQAAxkDAAM...\",\n    \"file_unique_id\": \"AQAD27ExGysnfVBy\",\n    \"file_size\": 7551,\n    \"file_path\": \"photos/file_0.jpg\"\n  }\n}\n\nDownload files from: https://api.telegram.org/file/bot<token>/<file_path>"
      },
      {
        "title": "Callback Queries",
        "body": "Answer Callback Query\n\nPOST /telegram/:token/answerCallbackQuery\nContent-Type: application/json\n\n{\n  \"callback_query_id\": \"12345678901234567\",\n  \"text\": \"Button clicked!\",\n  \"show_alert\": false\n}"
      },
      {
        "title": "JavaScript",
        "body": "// Send a message\nconst response = await fetch(\n  'https://gateway.maton.ai/telegram/:token/sendMessage',\n  {\n    method: 'POST',\n    headers: {\n      'Authorization': `Bearer ${process.env.MATON_API_KEY}`,\n      'Content-Type': 'application/json'\n    },\n    body: JSON.stringify({\n      chat_id: 6442870329,\n      text: 'Hello from JavaScript!'\n    })\n  }\n);\nconst data = await response.json();\nconsole.log(data);"
      },
      {
        "title": "Python",
        "body": "import os\nimport requests\n\n# Send a message\nresponse = requests.post(\n    'https://gateway.maton.ai/telegram/:token/sendMessage',\n    headers={'Authorization': f'Bearer {os.environ[\"MATON_API_KEY\"]}'},\n    json={\n        'chat_id': 6442870329,\n        'text': 'Hello from Python!'\n    }\n)\nprint(response.json())"
      },
      {
        "title": "Python (urllib)",
        "body": "import urllib.request, os, json\n\ndata = json.dumps({\n    'chat_id': 6442870329,\n    'text': 'Hello from Python!'\n}).encode()\nreq = urllib.request.Request(\n    'https://gateway.maton.ai/telegram/:token/sendMessage',\n    data=data,\n    method='POST'\n)\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nreq.add_header('Content-Type', 'application/json')\nresponse = json.load(urllib.request.urlopen(req))\nprint(json.dumps(response, indent=2))"
      },
      {
        "title": "Response Format",
        "body": "All Telegram Bot API responses follow this format:\n\nSuccess:\n\n{\n  \"ok\": true,\n  \"result\": { ... }\n}\n\nError:\n\n{\n  \"ok\": false,\n  \"error_code\": 400,\n  \"description\": \"Bad Request: chat not found\"\n}"
      },
      {
        "title": "Notes",
        "body": ":token is automatically replaced with your bot token from the connection\nChat IDs are integers for private chats and can be negative for groups\nAll methods support both GET and POST, but POST is recommended for methods with parameters\nText messages have a 4096 character limit\nCaptions have a 1024 character limit\nPolls support 2-10 options\nFile uploads require multipart/form-data (use URLs for simplicity)\nIMPORTANT: When piping curl output to jq or other commands, environment variables like $MATON_API_KEY may not expand correctly in some shell environments"
      },
      {
        "title": "Error Handling",
        "body": "StatusMeaning400Missing Telegram connection or bad request401Invalid or missing Maton API key429Rate limited (Telegram limits vary by method)4xx/5xxPassthrough error from Telegram Bot API"
      },
      {
        "title": "Troubleshooting: API Key Issues",
        "body": "Check that the MATON_API_KEY environment variable is set:\n\necho $MATON_API_KEY\n\nVerify the API key is valid by listing connections:\n\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF"
      },
      {
        "title": "Troubleshooting: Invalid App Name",
        "body": "Ensure your URL path starts with telegram. For example:\n\nCorrect: https://gateway.maton.ai/telegram/:token/sendMessage\nIncorrect: https://gateway.maton.ai/:token/sendMessage"
      },
      {
        "title": "Resources",
        "body": "Telegram Bot API Documentation\nAvailable Methods\nFormatting Options\nInline Keyboards\nBot Commands\nMaton Community\nMaton Support"
      }
    ],
    "body": "Telegram Bot API\n\nAccess the Telegram Bot API with managed authentication. Send messages, photos, polls, locations, and more through your Telegram bot.\n\nQuick Start\n# Get bot info\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://gateway.maton.ai/telegram/:token/getMe')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\nBase URL\nhttps://gateway.maton.ai/telegram/:token/{method}\n\n\nThe :token placeholder is automatically replaced with your bot token from the connection configuration. Replace {method} with the Telegram Bot API method name (e.g., sendMessage, getUpdates).\n\nAuthentication\n\nAll requests require the Maton API key in the Authorization header:\n\nAuthorization: Bearer $MATON_API_KEY\n\n\nEnvironment Variable: Set your API key as MATON_API_KEY:\n\nexport MATON_API_KEY=\"YOUR_API_KEY\"\n\nGetting Your API Key\nSign in or create an account at maton.ai\nGo to maton.ai/settings\nCopy your API key\nConnection Management\n\nManage your Telegram bot connections at https://ctrl.maton.ai.\n\nList Connections\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections?app=telegram&status=ACTIVE')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\nCreate Connection\npython <<'EOF'\nimport urllib.request, os, json\ndata = json.dumps({'app': 'telegram'}).encode()\nreq = urllib.request.Request('https://ctrl.maton.ai/connections', data=data, method='POST')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nreq.add_header('Content-Type', 'application/json')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\nGet Connection\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\n\nResponse:\n\n{\n  \"connection\": {\n    \"connection_id\": \"e8f5078d-e507-4139-aabe-1615181ea8fc\",\n    \"status\": \"ACTIVE\",\n    \"creation_time\": \"2026-02-07T10:37:21.053942Z\",\n    \"last_updated_time\": \"2026-02-07T10:37:59.881901Z\",\n    \"url\": \"https://connect.maton.ai/?session_token=...\",\n    \"app\": \"telegram\",\n    \"metadata\": {}\n  }\n}\n\n\nOpen the returned url in a browser to complete the bot token configuration.\n\nDelete Connection\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}', method='DELETE')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\nSpecifying Connection\n\nIf you have multiple Telegram connections (multiple bots), specify which one to use with the Maton-Connection header:\n\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://gateway.maton.ai/telegram/:token/getMe')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nreq.add_header('Maton-Connection', 'e8f5078d-e507-4139-aabe-1615181ea8fc')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\n\nIf omitted, the gateway uses the default (oldest) active connection.\n\nAPI Reference\nBot Information\nGet Bot Info\nGET /telegram/:token/getMe\n\n\nReturns information about the bot.\n\nResponse:\n\n{\n  \"ok\": true,\n  \"result\": {\n    \"id\": 8523474253,\n    \"is_bot\": true,\n    \"first_name\": \"Maton\",\n    \"username\": \"maton_bot\",\n    \"can_join_groups\": true,\n    \"can_read_all_group_messages\": true,\n    \"supports_inline_queries\": true\n  }\n}\n\nGetting Updates\nGet Updates (Long Polling)\nPOST /telegram/:token/getUpdates\nContent-Type: application/json\n\n{\n  \"limit\": 100,\n  \"timeout\": 30,\n  \"offset\": 625435210\n}\n\nParameter\tType\tRequired\tDescription\noffset\tInteger\tNo\tFirst update ID to return\nlimit\tInteger\tNo\tNumber of updates (1-100, default 100)\ntimeout\tInteger\tNo\tLong polling timeout in seconds\nallowed_updates\tArray\tNo\tUpdate types to receive\nGet Webhook Info\nGET /telegram/:token/getWebhookInfo\n\nSet Webhook\nPOST /telegram/:token/setWebhook\nContent-Type: application/json\n\n{\n  \"url\": \"https://example.com/webhook\",\n  \"allowed_updates\": [\"message\", \"callback_query\"],\n  \"secret_token\": \"your_secret_token\"\n}\n\nDelete Webhook\nPOST /telegram/:token/deleteWebhook\nContent-Type: application/json\n\n{\n  \"drop_pending_updates\": true\n}\n\nSending Messages\nSend Text Message\nPOST /telegram/:token/sendMessage\nContent-Type: application/json\n\n{\n  \"chat_id\": 6442870329,\n  \"text\": \"Hello, World!\",\n  \"parse_mode\": \"HTML\"\n}\n\nParameter\tType\tRequired\tDescription\nchat_id\tInteger/String\tYes\tTarget chat ID or @username\ntext\tString\tYes\tMessage text (1-4096 characters)\nparse_mode\tString\tNo\tHTML, Markdown, or MarkdownV2\nreply_markup\tObject\tNo\tInline keyboard or reply keyboard\nreply_parameters\tObject\tNo\tReply to a specific message\n\nWith HTML Formatting:\n\nPOST /telegram/:token/sendMessage\nContent-Type: application/json\n\n{\n  \"chat_id\": 6442870329,\n  \"text\": \"<b>Bold</b> and <i>italic</i> with <a href=\\\"https://example.com\\\">link</a>\",\n  \"parse_mode\": \"HTML\"\n}\n\n\nWith Inline Keyboard:\n\nPOST /telegram/:token/sendMessage\nContent-Type: application/json\n\n{\n  \"chat_id\": 6442870329,\n  \"text\": \"Choose an option:\",\n  \"reply_markup\": {\n    \"inline_keyboard\": [\n      [\n        {\"text\": \"Option 1\", \"callback_data\": \"opt1\"},\n        {\"text\": \"Option 2\", \"callback_data\": \"opt2\"}\n      ],\n      [\n        {\"text\": \"Visit Website\", \"url\": \"https://example.com\"}\n      ]\n    ]\n  }\n}\n\nSend Photo\nPOST /telegram/:token/sendPhoto\nContent-Type: application/json\n\n{\n  \"chat_id\": 6442870329,\n  \"photo\": \"https://example.com/image.jpg\",\n  \"caption\": \"Image caption\"\n}\n\nParameter\tType\tRequired\tDescription\nchat_id\tInteger/String\tYes\tTarget chat ID\nphoto\tString\tYes\tPhoto URL or file_id\ncaption\tString\tNo\tCaption (0-1024 characters)\nparse_mode\tString\tNo\tCaption parse mode\nSend Document\nPOST /telegram/:token/sendDocument\nContent-Type: application/json\n\n{\n  \"chat_id\": 6442870329,\n  \"document\": \"https://example.com/file.pdf\",\n  \"caption\": \"Document caption\"\n}\n\nSend Video\nPOST /telegram/:token/sendVideo\nContent-Type: application/json\n\n{\n  \"chat_id\": 6442870329,\n  \"video\": \"https://example.com/video.mp4\",\n  \"caption\": \"Video caption\"\n}\n\nSend Audio\nPOST /telegram/:token/sendAudio\nContent-Type: application/json\n\n{\n  \"chat_id\": 6442870329,\n  \"audio\": \"https://example.com/audio.mp3\",\n  \"caption\": \"Audio caption\"\n}\n\nSend Location\nPOST /telegram/:token/sendLocation\nContent-Type: application/json\n\n{\n  \"chat_id\": 6442870329,\n  \"latitude\": 37.7749,\n  \"longitude\": -122.4194\n}\n\nSend Contact\nPOST /telegram/:token/sendContact\nContent-Type: application/json\n\n{\n  \"chat_id\": 6442870329,\n  \"phone_number\": \"+1234567890\",\n  \"first_name\": \"John\",\n  \"last_name\": \"Doe\"\n}\n\nSend Poll\nPOST /telegram/:token/sendPoll\nContent-Type: application/json\n\n{\n  \"chat_id\": 6442870329,\n  \"question\": \"What is your favorite color?\",\n  \"options\": [\n    {\"text\": \"Red\"},\n    {\"text\": \"Blue\"},\n    {\"text\": \"Green\"}\n  ],\n  \"is_anonymous\": false\n}\n\nParameter\tType\tRequired\tDescription\nchat_id\tInteger/String\tYes\tTarget chat ID\nquestion\tString\tYes\tPoll question (1-300 characters)\noptions\tArray\tYes\tPoll options (2-10 items)\nis_anonymous\tBoolean\tNo\tAnonymous poll (default true)\ntype\tString\tNo\tregular or quiz\nallows_multiple_answers\tBoolean\tNo\tAllow multiple answers\ncorrect_option_id\tInteger\tNo\tCorrect answer for quiz\nSend Dice\nPOST /telegram/:token/sendDice\nContent-Type: application/json\n\n{\n  \"chat_id\": 6442870329,\n  \"emoji\": \"🎲\"\n}\n\n\nSupported emoji: 🎲 🎯 🎳 🏀 ⚽ 🎰\n\nEditing Messages\nEdit Message Text\nPOST /telegram/:token/editMessageText\nContent-Type: application/json\n\n{\n  \"chat_id\": 6442870329,\n  \"message_id\": 123,\n  \"text\": \"Updated message text\"\n}\n\nEdit Message Caption\nPOST /telegram/:token/editMessageCaption\nContent-Type: application/json\n\n{\n  \"chat_id\": 6442870329,\n  \"message_id\": 123,\n  \"caption\": \"Updated caption\"\n}\n\nEdit Message Reply Markup\nPOST /telegram/:token/editMessageReplyMarkup\nContent-Type: application/json\n\n{\n  \"chat_id\": 6442870329,\n  \"message_id\": 123,\n  \"reply_markup\": {\n    \"inline_keyboard\": [\n      [{\"text\": \"New Button\", \"callback_data\": \"new\"}]\n    ]\n  }\n}\n\nDelete Message\nPOST /telegram/:token/deleteMessage\nContent-Type: application/json\n\n{\n  \"chat_id\": 6442870329,\n  \"message_id\": 123\n}\n\nForwarding & Copying\nForward Message\nPOST /telegram/:token/forwardMessage\nContent-Type: application/json\n\n{\n  \"chat_id\": 6442870329,\n  \"from_chat_id\": 6442870329,\n  \"message_id\": 123\n}\n\nCopy Message\nPOST /telegram/:token/copyMessage\nContent-Type: application/json\n\n{\n  \"chat_id\": 6442870329,\n  \"from_chat_id\": 6442870329,\n  \"message_id\": 123\n}\n\nChat Information\nGet Chat\nPOST /telegram/:token/getChat\nContent-Type: application/json\n\n{\n  \"chat_id\": 6442870329\n}\n\nGet Chat Administrators\nPOST /telegram/:token/getChatAdministrators\nContent-Type: application/json\n\n{\n  \"chat_id\": -1001234567890\n}\n\nGet Chat Member Count\nPOST /telegram/:token/getChatMemberCount\nContent-Type: application/json\n\n{\n  \"chat_id\": -1001234567890\n}\n\nGet Chat Member\nPOST /telegram/:token/getChatMember\nContent-Type: application/json\n\n{\n  \"chat_id\": -1001234567890,\n  \"user_id\": 6442870329\n}\n\nBot Commands\nSet My Commands\nPOST /telegram/:token/setMyCommands\nContent-Type: application/json\n\n{\n  \"commands\": [\n    {\"command\": \"start\", \"description\": \"Start the bot\"},\n    {\"command\": \"help\", \"description\": \"Get help\"},\n    {\"command\": \"settings\", \"description\": \"Open settings\"}\n  ]\n}\n\nGet My Commands\nGET /telegram/:token/getMyCommands\n\nDelete My Commands\nPOST /telegram/:token/deleteMyCommands\nContent-Type: application/json\n\n{}\n\nBot Profile\nGet My Description\nGET /telegram/:token/getMyDescription\n\nSet My Description\nPOST /telegram/:token/setMyDescription\nContent-Type: application/json\n\n{\n  \"description\": \"This bot helps you manage tasks.\"\n}\n\nSet My Name\nPOST /telegram/:token/setMyName\nContent-Type: application/json\n\n{\n  \"name\": \"Task Bot\"\n}\n\nFiles\nGet File\nPOST /telegram/:token/getFile\nContent-Type: application/json\n\n{\n  \"file_id\": \"AgACAgQAAxkDAAM...\"\n}\n\n\nResponse:\n\n{\n  \"ok\": true,\n  \"result\": {\n    \"file_id\": \"AgACAgQAAxkDAAM...\",\n    \"file_unique_id\": \"AQAD27ExGysnfVBy\",\n    \"file_size\": 7551,\n    \"file_path\": \"photos/file_0.jpg\"\n  }\n}\n\n\nDownload files from: https://api.telegram.org/file/bot<token>/<file_path>\n\nCallback Queries\nAnswer Callback Query\nPOST /telegram/:token/answerCallbackQuery\nContent-Type: application/json\n\n{\n  \"callback_query_id\": \"12345678901234567\",\n  \"text\": \"Button clicked!\",\n  \"show_alert\": false\n}\n\nCode Examples\nJavaScript\n// Send a message\nconst response = await fetch(\n  'https://gateway.maton.ai/telegram/:token/sendMessage',\n  {\n    method: 'POST',\n    headers: {\n      'Authorization': `Bearer ${process.env.MATON_API_KEY}`,\n      'Content-Type': 'application/json'\n    },\n    body: JSON.stringify({\n      chat_id: 6442870329,\n      text: 'Hello from JavaScript!'\n    })\n  }\n);\nconst data = await response.json();\nconsole.log(data);\n\nPython\nimport os\nimport requests\n\n# Send a message\nresponse = requests.post(\n    'https://gateway.maton.ai/telegram/:token/sendMessage',\n    headers={'Authorization': f'Bearer {os.environ[\"MATON_API_KEY\"]}'},\n    json={\n        'chat_id': 6442870329,\n        'text': 'Hello from Python!'\n    }\n)\nprint(response.json())\n\nPython (urllib)\nimport urllib.request, os, json\n\ndata = json.dumps({\n    'chat_id': 6442870329,\n    'text': 'Hello from Python!'\n}).encode()\nreq = urllib.request.Request(\n    'https://gateway.maton.ai/telegram/:token/sendMessage',\n    data=data,\n    method='POST'\n)\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nreq.add_header('Content-Type', 'application/json')\nresponse = json.load(urllib.request.urlopen(req))\nprint(json.dumps(response, indent=2))\n\nResponse Format\n\nAll Telegram Bot API responses follow this format:\n\nSuccess:\n\n{\n  \"ok\": true,\n  \"result\": { ... }\n}\n\n\nError:\n\n{\n  \"ok\": false,\n  \"error_code\": 400,\n  \"description\": \"Bad Request: chat not found\"\n}\n\nNotes\n:token is automatically replaced with your bot token from the connection\nChat IDs are integers for private chats and can be negative for groups\nAll methods support both GET and POST, but POST is recommended for methods with parameters\nText messages have a 4096 character limit\nCaptions have a 1024 character limit\nPolls support 2-10 options\nFile uploads require multipart/form-data (use URLs for simplicity)\nIMPORTANT: When piping curl output to jq or other commands, environment variables like $MATON_API_KEY may not expand correctly in some shell environments\nError Handling\nStatus\tMeaning\n400\tMissing Telegram connection or bad request\n401\tInvalid or missing Maton API key\n429\tRate limited (Telegram limits vary by method)\n4xx/5xx\tPassthrough error from Telegram Bot API\nTroubleshooting: API Key Issues\nCheck that the MATON_API_KEY environment variable is set:\necho $MATON_API_KEY\n\nVerify the API key is valid by listing connections:\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\nTroubleshooting: Invalid App Name\nEnsure your URL path starts with telegram. For example:\nCorrect: https://gateway.maton.ai/telegram/:token/sendMessage\nIncorrect: https://gateway.maton.ai/:token/sendMessage\nResources\nTelegram Bot API Documentation\nAvailable Methods\nFormatting Options\nInline Keyboards\nBot Commands\nMaton Community\nMaton Support"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/byungkyu/telegram-api",
    "publisherUrl": "https://clawhub.ai/byungkyu/telegram-api",
    "owner": "byungkyu",
    "version": "1.0.2",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/telegram-api",
    "downloadUrl": "https://openagent3.xyz/downloads/telegram-api",
    "agentUrl": "https://openagent3.xyz/skills/telegram-api/agent",
    "manifestUrl": "https://openagent3.xyz/skills/telegram-api/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/telegram-api/agent.md"
  }
}