HydraCore
API by router

Telegram channel

Get Telegram Channel Status

Get current Telegram channel configuration status.

Bot token is NEVER returned — only a boolean indicating whether one is stored. "What we've got here is a failure to exfiltrate." — Captain, Cool Hand Luke (modified)

GET
/v1/instances/{instance_id}/channels/telegram
AuthorizationBearer <token>

In: header

Path Parameters

instance_idInstance Id

Header Parameters

X-Api-Key?X-Api-Key

Response Body

curl -X GET "https://loading/v1/instances/string/channels/telegram" \  -H "X-Api-Key: string"
{
  "bot_username": "string",
  "has_bot_token": true,
  "telegram_enabled": true,
  "webhook_url": "string"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}

Setup Telegram Channel

Configure Telegram bot token and register webhook with Telegram API.

Steps:

  1. Encrypt and store bot token
  2. Generate webhook secret
  3. Call Telegram setWebhook to point at our relay
  4. Store webhook secret for verification

Note: telegram_enabled is set TRUE on setup. The agent runtime is fail-closed: customer channels use customer_facing prompt if set, otherwise a safe generic prompt.

"Fasten your seatbelts, it's going to be a bumpy night." — Margo Channing, All About Eve (about Telegram webhook setup)

POST
/v1/instances/{instance_id}/channels/telegram
AuthorizationBearer <token>

In: header

Path Parameters

instance_idInstance Id

Header Parameters

X-Api-Key?X-Api-Key
bot_tokenBot Token
Length30 <= length <= 100

Response Body

curl -X POST "https://loading/v1/instances/string/channels/telegram" \  -H "X-Api-Key: string" \  -H "Content-Type: application/json" \  -d '{    "bot_token": "stringstringstringstringstring"  }'
{
  "instance_id": "string",
  "message": "string",
  "telegram_enabled": true,
  "webhook_registered": false,
  "webhook_url": "string"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}

Remove Telegram Channel

Remove Telegram bot token and deregister webhook.

"I'll be back." — T-800, Terminator (about maybe re-enabling Telegram later)

DELETE
/v1/instances/{instance_id}/channels/telegram
AuthorizationBearer <token>

In: header

Path Parameters

instance_idInstance Id

Header Parameters

X-Api-Key?X-Api-Key

Response Body

curl -X DELETE "https://loading/v1/instances/string/channels/telegram" \  -H "X-Api-Key: string"
{
  "instance_id": "string",
  "message": "string",
  "telegram_enabled": true,
  "webhook_registered": false,
  "webhook_url": "string"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}