Bots
GET
/bots
List Bots
Get a paginated list of all your Telegram bots.
Required abilities:
read
Headers
| Authorization | Bearer {token} |
| Accept | application/json |
Response
{
"success": true,
"data": [
{
"id": 1,
"username": "my_bot",
"name": "My Bot",
"is_active": true,
"is_broadcast_active": true,
"webhook_url": "https://gramsea.com/api/webhook/telegram/xxx",
"stats": {
"users_count": 1250,
"messages_count": 5,
"rules_count": 3
},
"created_at": "2024-01-01T00:00:00.000000Z",
"updated_at": "2024-01-01T00:00:00.000000Z"
}
],
"meta": {
"current_page": 1,
"last_page": 1,
"per_page": 15,
"total": 1
}
}
GET
/bots/{id}
Get Bot
Get detailed information about a specific bot.
Required abilities:
read
Headers
| Authorization | Bearer {token} |
| Accept | application/json |
Response
{
"success": true,
"data": {
"id": 1,
"username": "my_bot",
"name": "My Bot",
"is_active": true,
"is_broadcast_active": true,
"stats": {
"users_count": 1250,
"messages_count": 5,
"rules_count": 3,
"broadcasts_count": 2
},
"settings": []
}
}
POST
/bots
Create Bot
Create a new bot. The token will be validated with Telegram API.
Required abilities:
create
Headers
| Authorization | Bearer {token} |
| Accept | application/json |
| Content-Type | application/json |
Response
{
"success": true,
"message": "Bot created successfully",
"data": {
"id": 1,
"username": "my_bot"
}
}
PUT
/bots/{id}
Update Bot
Update bot settings.
Required abilities:
update
Headers
| Authorization | Bearer {token} |
| Accept | application/json |
| Content-Type | application/json |
DELETE
/bots/{id}
Delete Bot
Delete a bot. Webhook will be deactivated automatically.
Required abilities:
delete
POST
/bots/{id}/activate
Activate Bot
Activate the bot webhook to start receiving updates.
Required abilities:
update
POST
/bots/{id}/deactivate
Deactivate Bot
Deactivate the bot webhook to stop receiving updates.
Required abilities:
update
POST
/bots/{id}/send-message
Send Message
Send a message to a specific bot user. Requires sufficient credit balance.
Required abilities:
create
Headers
| Authorization | Bearer {token} |
| Accept | application/json |
| Content-Type | application/json |
Response
{
"success": true,
"message": "Message sent successfully",
"data": {
"telegram_message_id": 12345,
"user_id": 1,
"chat_id": 123456789,
"cost": 3
}
}