Clawdbot API Integration Guide: Connect Telegram, Discord, Calendar & More (2026)
TL;DR
Clawdbot's API integration capabilities transform it from a local AI assistant into a connected automation hub that works with Telegram, Discord, Google Calendar, email providers, and hundreds of other services. This guide covers 8 essential integrations that extend Clawdbot's reach across your digital workflow.
What you'll learn:
- Setting up Telegram bot for on-the-go AI access from your phone
- Discord server integration for team collaboration with AI
- Google Calendar automation for intelligent scheduling
- Email integration (Gmail, Outlook) for automated drafting and responses
- GitHub/GitLab webhook integration for CI/CD workflows
- Custom RESTful API development for external applications
- Security best practices for API key management
Who this is for: Developers building automation workflows, teams wanting collaborative AI, mobile users needing remote access, professionals integrating AI into existing tools.
๐ก Takeaways
- ๐ Telegram bot integration provides full Clawdbot access from any device via messaging app
- ๐ Discord commands enable team-wide AI assistance with role-based permissions
- ๐ค Calendar automation intelligently schedules meetings by analyzing availability and preferences
- ๐ Email integration drafts context-aware responses saving 40% of email time
- ๐ผ GitHub webhooks trigger automated code reviews and testing on every commit
- ๐ฅ RESTful API exposes Clawdbot capabilities to external applications via HTTP endpoints
- โก OAuth2 support enables secure third-party authentication without exposing credentials
- ๐ Rate limiting protects API from abuse with configurable requests-per-minute limits
โ Q & A
How do I set up a Telegram bot for Clawdbot?
Telegram integration lets you interact with Clawdbot from your phone anywhere:
Step 1: Create Telegram bot via BotFather
1. Open Telegram app
2. Search for "@BotFather" (official Telegram bot)
3. Start conversation: /start
4. Create new bot: /newbot
5. Follow prompts:
- Bot name: My Clawdbot Assistant
- Username: my_clawdbot_bot (must end in 'bot')
6. BotFather returns API token:
123456789:ABCdefGHIjklMNOpqrsTUVwxyz
7. Save this token securely!
Step 2: Install Telegram integration skill
clawdbot skill install telegram-integration
# Configure with bot token
clawdbot skill config telegram-integration \
--set bot_token=123456789:ABCdefGHIjklMNOpqrsTUVwxyz \
--set authorized_users=your_telegram_username
Step 3: Start Telegram bot service
# Start bot (runs in background)
clawdbot telegram start
# Verify bot is running
clawdbot telegram status
# Output: โ
Telegram bot is running (connected to @my_clawdbot_bot)
Step 4: Use bot from Telegram
Open Telegram, search for @my_clawdbot_bot, and start:
You: /start
Bot: ๐ Welcome! I'm your personal AI assistant powered by Clawdbot.
You: Summarize today's news about AI
Bot: [Searches web, generates summary in 10 seconds]
๐ฐ Top AI News Today:
1. OpenAI announces GPT-5 with 10T parameters
2. Google's Gemini 2.0 reaches human-level coding
...
You: Remind me to review PR #234 in 2 hours
Bot: โฐ Reminder set for 4:30 PM: Review PR #234
You: What's my next calendar event?
Bot: ๐
Next: Team standup at 3:00 PM (in 15 minutes)
Advanced features:
# ~/.clawdbot/config.yaml
telegram:
bot_token: "${TELEGRAM_BOT_TOKEN}"
authorized_users:
- "your_username"
- "teammate_username" # Allow multiple users
# Enable voice messages
voice_enabled: true
# Auto-translate responses
auto_translate:
enabled: true
target_language: "en" # Translate to English
# Notifications
notifications:
enabled: true
events:
- "calendar_reminder"
- "email_urgent"
- "github_pr_review_requested"
Security best practices:
# Store token in environment variable (not config file)
export TELEGRAM_BOT_TOKEN="123456789:ABCdefGHIjklMNOpqrsTUVwxyz"
# Restrict to specific users only
clawdbot telegram whitelist add @your_username
# Enable end-to-end encryption for sensitive data
clawdbot skill config telegram-integration --set encryption=true
How do I integrate Clawdbot with Discord for team collaboration?
Discord integration creates a shared AI assistant for your team:
Step 1: Create Discord bot application
1. Visit https://discord.com/developers/applications
2. Click "New Application"
3. Name: Clawdbot Assistant
4. Go to "Bot" tab โ Click "Add Bot"
5. Under "TOKEN", click "Copy" (save securely)
6. Enable "MESSAGE CONTENT INTENT" (required for reading messages)
7. Go to "OAuth2" โ "URL Generator":
- Scopes: โ bot, โ applications.commands
- Bot Permissions: โ Send Messages, โ Read Message History, โ Use Slash Commands
8. Copy generated URL, paste in browser
9. Select your Discord server, authorize bot
Step 2: Configure Clawdbot Discord integration
clawdbot skill install discord-integration
# Configure bot
clawdbot skill config discord-integration \
--set bot_token="${DISCORD_BOT_TOKEN}" \
--set command_prefix="!" \
--set allowed_channels="general,ai-assistant"
# Start Discord bot
clawdbot discord start
Step 3: Use in Discord server
In Discord #general channel:
User: !help
Clawdbot: ๐ค Available Commands:
- !ask <question> - Ask me anything
- !code-review <file> - Review code
- !summarize <url> - Summarize article/video
- !schedule <event> - Schedule meeting
- !translate <text> - Translate text
User: !ask What's the best way to optimize React performance?
Clawdbot: [Generates detailed response with code examples]
User: !code-review src/components/Dashboard.tsx
Clawdbot: [Analyzes file, provides feedback]
๐ Code Review Results:
โ
Good: Proper prop types
โ ๏ธ Warning: Missing error boundaries
โ Issue: Inefficient re-renders (line 45)
Advanced: Slash commands
// Create custom slash command
clawdbot discord add-command \
--name "sprint-summary" \
--description "Generate sprint summary from Jira" \
--options "sprint_id:string,format:markdown|pdf"
// Usage in Discord:
// /sprint-summary sprint_id:SPRINT-123 format:markdown
Role-based permissions:
# ~/.clawdbot/config.yaml
discord:
bot_token: "${DISCORD_BOT_TOKEN}"
# Role-based command restrictions
permissions:
admin: # Users with "Admin" role
- "all"
developer: # Users with "Developer" role
- "code-review"
- "git-*"
everyone: # All server members
- "ask"
- "summarize"
How do I automate Google Calendar with Clawdbot?
Calendar integration enables intelligent meeting scheduling:
Step 1: Enable Google Calendar API
1. Visit https://console.cloud.google.com
2. Create project: "Clawdbot Calendar Integration"
3. Enable "Google Calendar API"
4. Create credentials:
- Type: OAuth 2.0 Client ID
- Application type: Desktop app
5. Download credentials.json
6. Move to: ~/.clawdbot/credentials/google-calendar.json
Step 2: Authenticate Clawdbot
clawdbot skill install calendar-integration
# Authenticate (opens browser for Google login)
clawdbot calendar auth
# Follow prompts:
# 1. Sign in to Google account
# 2. Grant calendar permissions
# 3. Clawdbot saves OAuth token
Step 3: Use calendar automation
# Find free time slots
clawdbot calendar find-free \
--attendees john@company.com,sarah@company.com \
--duration 60 \
--next-week
# Output:
# ๐
Available Time Slots:
# - Monday, Feb 3, 2:00 PM - 3:00 PM
# - Tuesday, Feb 4, 10:00 AM - 11:00 AM
# - Wednesday, Feb 5, 3:00 PM - 4:00 PM
# Schedule meeting at optimal time
clawdbot calendar schedule \
--title "Q1 Planning Meeting" \
--attendees team@company.com \
--duration 90 \
--auto-find-time
# Auto-suggests: "Tuesday, Feb 4, 2:00 PM" (highest attendee availability)
Smart scheduling with AI:
# Natural language scheduling
clawdbot chat "Schedule a 1-hour meeting with John and Sarah next week to discuss the API redesign. Find a time that works for everyone."
# Clawdbot:
# 1. Checks all attendees' calendars
# 2. Finds 3 optimal time slots
# 3. Suggests: "Tuesday, Feb 4, 2:00 PM (all attendees available)"
# 4. Creates calendar invite
# 5. Sends email notifications
# โ
Meeting scheduled: Q1 API Redesign Discussion
# Time: Tuesday, Feb 4, 2:00 PM - 3:00 PM
# Attendees: You, John Smith, Sarah Johnson
# Zoom link: [auto-generated]
Automated rescheduling:
# ~/.clawdbot/workflows/calendar-automation.yml
name: Smart Calendar Management
triggers:
- calendar_event_cancelled
- calendar_conflict_detected
steps:
- skill: calendar-integration
action: find_alternative_time
input:
original_event: ${{ trigger.event_id }}
min_attendees: 80% # Require 80% attendance
- skill: email-assistant
action: send_reschedule_proposal
input:
attendees: ${{ event.attendees }}
suggested_times: ${{ steps.0.output.options }}
How do I integrate Clawdbot with email (Gmail/Outlook)?
Email integration automates drafting, responses, and inbox management:
Gmail Setup:
# Install email integration skill
clawdbot skill install email-integration
# Authenticate Gmail
clawdbot email auth --provider gmail
# Grant permissions:
# - Read emails
# - Send emails
# - Manage labels
# Verify connection
clawdbot email test-connection
# โ
Connected to: your.email@gmail.com
Basic usage:
# Draft email
clawdbot email draft \
--to client@example.com \
--subject "Q4 Project Update" \
--context "We completed the API migration ahead of schedule"
# AI generates:
"""
Subject: Q4 Project Update
Hi [Client Name],
I'm pleased to inform you that we've successfully completed the API migration project three weeks ahead of our original timeline.
Key achievements:
- Migrated 47 endpoints to new architecture
- Improved response times by 40%
- Zero downtime during transition
I'd be happy to schedule a call next week to discuss the results in detail.
Best regards,
[Your Name]
"""
# Review and send
clawdbot email send --draft-id last
Smart inbox management:
# Categorize unread emails
clawdbot email categorize --labels "urgent,followup,newsletter,spam"
# Output:
# ๐ง Inbox Analysis:
# - Urgent (3): Client escalation, P0 bug report, contract deadline
# - Follow-up (12): Pending responses, waiting on info
# - Newsletters (28): Marketing emails, updates
# - Spam (5): Promotional emails
# Auto-respond to common questions
clawdbot email auto-respond \
--filter "subject:pricing OR subject:demo" \
--template "Thank you for your interest. Our pricing starts at $X/month..."
# Generate response suggestions
clawdbot email suggest-reply inbox/message-id-123
# AI suggests 3 response tones:
# 1. Professional: "Thank you for reaching out..."
# 2. Friendly: "Hey! Thanks for the email..."
# 3. Concise: "Confirmed. I'll send the report by EOD."
Email workflows:
# ~/.clawdbot/workflows/email-automation.yml
name: Email Automation
triggers:
- email_received:
filter: "is:unread important"
steps:
- skill: email-assistant
action: analyze_sentiment
input:
email_id: ${{ trigger.email_id }}
- skill: email-assistant
action: draft_response
input:
email_id: ${{ trigger.email_id }}
tone: ${{ steps.0.output.sentiment == 'urgent' ? 'professional' : 'friendly' }}
- skill: slack-integration
action: notify
input:
channel: "#support"
message: "New urgent email from ${{ trigger.sender }}"
condition: ${{ steps.0.output.urgency == 'high' }}
How do I create custom RESTful API for Clawdbot?
Custom API exposes Clawdbot to external applications:
Step 1: Enable API server
# ~/.clawdbot/config.yaml
api:
enabled: true
host: "0.0.0.0" # Allow external access
port: 8080
# Authentication
auth:
enabled: true
method: "bearer" # Bearer token authentication
# Rate limiting
rate_limit:
enabled: true
requests_per_minute: 60
# CORS
cors:
enabled: true
allowed_origins:
- "https://myapp.com"
- "http://localhost:3000"
Step 2: Generate API key
# Create API key
clawdbot api create-key --name "External App" --permissions "chat,skills"
# Output:
# โ
API Key Created
# Key: clw_1234567890abcdef
# Permissions: chat, skills
#
# IMPORTANT: Save this key securely. It will not be shown again.
Step 3: Make API requests
Chat completion:
curl -X POST http://localhost:8080/v1/chat/completions \
-H "Authorization: Bearer clw_1234567890abcdef" \
-H "Content-Type: application/json" \
-d '{
"model": "local-llama",
"messages": [
{"role": "user", "content": "Explain quantum computing"}
],
"temperature": 0.7,
"max_tokens": 500
}'
# Response:
{
"id": "chatcmpl-123",
"object": "chat.completion",
"created": 1737936000,
"model": "local-llama",
"choices": [{
"index": 0,
"message": {
"role": "assistant",
"content": "Quantum computing is a type of computation that..."
},
"finish_reason": "stop"
}],
"usage": {
"prompt_tokens": 10,
"completion_tokens": 85,
"total_tokens": 95
}
}
Execute skill:
curl -X POST http://localhost:8080/v1/skills/execute \
-H "Authorization: Bearer clw_1234567890abcdef" \
-H "Content-Type: application/json" \
-d '{
"skill": "code-reviewer",
"input": {
"filePath": "src/app.js"
}
}'
# Response:
{
"success": true,
"result": {
"issues": [
{"type": "security", "severity": "high", "line": 42, "message": "Potential SQL injection"},
{"type": "performance", "severity": "medium", "line": 58, "message": "Inefficient loop"}
],
"score": 7.5
}
}
JavaScript/TypeScript client:
// clawdbot-client.ts
import axios from 'axios';
class ClawdbotAPI {
private apiKey: string;
private baseURL: string;
constructor(apiKey: string, baseURL = 'http://localhost:8080/v1') {
this.apiKey = apiKey;
this.baseURL = baseURL;
}
async chat(message: string, options = {}) {
const response = await axios.post(
`${this.baseURL}/chat/completions`,
{
model: 'local-llama',
messages: [{ role: 'user', content: message }],
...options
},
{
headers: {
'Authorization': `Bearer ${this.apiKey}`,
'Content-Type': 'application/json'
}
}
);
return response.data.choices[0].message.content;
}
async executeSkill(skillName: string, input: any) {
const response = await axios.post(
`${this.baseURL}/skills/execute`,
{ skill: skillName, input },
{
headers: {
'Authorization': `Bearer ${this.apiKey}`,
'Content-Type': 'application/json'
}
}
);
return response.data;
}
}
// Usage
const clawdbot = new ClawdbotAPI('clw_1234567890abcdef');
// Chat
const answer = await clawdbot.chat('What is the capital of France?');
console.log(answer);
// Execute skill
const review = await clawdbot.executeSkill('code-reviewer', {
filePath: 'src/auth.ts'
});
console.log(review);
What are common API integration use cases?
1. Mobile App Backend:
// React Native app with Clawdbot backend
import { ClawdbotAPI } from './clawdbot-client';
const clawdbot = new ClawdbotAPI(process.env.CLAWDBOT_API_KEY);
// Voice assistant
async function voiceQuery(audioFile) {
// 1. Transcribe audio to text
const transcript = await transcribeAudio(audioFile);
// 2. Query Clawdbot
const response = await clawdbot.chat(transcript);
// 3. Convert to speech
const audio = await textToSpeech(response);
return audio;
}
// Code snippet analysis
async function analyzeCodeSnippet(code, language) {
return await clawdbot.chat(`Review this ${language} code:\n\`\`\`${code}\`\`\``);
}
2. CI/CD Pipeline Integration:
# .github/workflows/clawdbot-review.yml
name: AI Code Review
on: [pull_request]
jobs:
clawdbot-review:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Review Changed Files
run: |
for file in $(git diff --name-only origin/main...HEAD); do
curl -X POST ${{ secrets.CLAWDBOT_API_URL }}/v1/skills/execute \
-H "Authorization: Bearer ${{ secrets.CLAWDBOT_API_KEY }}" \
-d "{\"skill\":\"code-reviewer\",\"input\":{\"filePath\":\"$file\"}}" \
>> review-results.json
done
- name: Post Review Comment
uses: actions/github-script@v6
with:
script: |
const fs = require('fs');
const results = JSON.parse(fs.readFileSync('review-results.json'));
const comment = formatReviewResults(results);
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: comment
});
3. Chatbot for Customer Support:
# chatbot.py
import requests
from flask import Flask, request, jsonify
app = Flask(__name__)
CLAWDBOT_API_KEY = "clw_1234567890abcdef"
CLAWDBOT_URL = "http://localhost:8080/v1"
@app.route('/webhook', methods=['POST'])
def chatbot_webhook():
user_message = request.json['message']
# Query Clawdbot
response = requests.post(
f"{CLAWDBOT_URL}/chat/completions",
headers={"Authorization": f"Bearer {CLAWDBOT_API_KEY}"},
json={
"model": "local-llama",
"messages": [
{"role": "system", "content": "You are a helpful customer support agent for ACME Corp."},
{"role": "user", "content": user_message}
]
}
)
ai_response = response.json()['choices'][0]['message']['content']
return jsonify({"reply": ai_response})
if __name__ == '__main__':
app.run(port=5000)
4. Data Analysis Dashboard:
// dashboard.js - Real-time data analysis
async function analyzeSalesData() {
const salesData = await fetchSalesData(); // Get from database
// Use Clawdbot to analyze trends
const analysis = await clawdbot.chat(`Analyze this sales data and identify trends:
${JSON.stringify(salesData)}
Focus on:
1. Month-over-month growth
2. Top performing products
3. Regional variations
4. Anomalies or unusual patterns`);
// Display analysis in dashboard
updateDashboard(analysis);
}
๐ Key Technical Concepts
๐ก Webhook Architecture
Webhooks are HTTP callbacks that notify Clawdbot when events occur in external services.
How webhooks work:
External Service (GitHub) โ Event occurs (PR opened)
โ
Sends HTTP POST to Clawdbot webhook URL
โ
Clawdbot receives event โ Executes workflow
โ
Clawdbot performs actions (code review, tests)
โ
Posts results back to GitHub (comment on PR)
Setting up webhooks:
# ~/.clawdbot/config.yaml
webhooks:
enabled: true
port: 9000
secret: "${WEBHOOK_SECRET}" # Verifies requests are authentic
endpoints:
- path: "/github"
service: "github"
events:
- "pull_request.opened"
- "push"
workflow: "ci-pipeline"
- path: "/gitlab"
service: "gitlab"
events:
- "merge_request_events"
workflow: "code-review"
GitHub webhook configuration:
1. Go to GitHub repo โ Settings โ Webhooks
2. Payload URL: https://your-server.com:9000/github
3. Content type: application/json
4. Secret: [same as WEBHOOK_SECRET]
5. Events: Pull requests, Pushes
6. Active: โ
๐ก OAuth2 Authentication Flow
OAuth2 allows Clawdbot to access third-party services securely without storing passwords.
Authorization Code Flow (most secure):
1. User initiates connection: clawdbot calendar auth
โ
2. Clawdbot redirects to Google's authorization page
โ
3. User logs in, grants permissions
โ
4. Google redirects back with authorization code
โ
5. Clawdbot exchanges code for access token + refresh token
โ
6. Clawdbot stores tokens securely (encrypted)
โ
7. Future API requests use access token
โ
8. When access token expires (1 hour), use refresh token to get new one
Token storage:
# ~/.clawdbot/credentials/oauth-tokens.yaml (encrypted)
google_calendar:
access_token: "ya29.a0AfH6SMBx..."
refresh_token: "1//0gX7..."
expires_at: 1737939600 # Unix timestamp
scopes:
- "https://www.googleapis.com/auth/calendar"
- "https://www.googleapis.com/auth/calendar.events"
๐ก Rate Limiting
Rate limiting prevents API abuse by restricting requests per time window.
Implementation:
# ~/.clawdbot/config.yaml
api:
rate_limit:
enabled: true
# Different limits for different endpoints
limits:
"/v1/chat/completions":
requests_per_minute: 20
requests_per_hour: 500
"/v1/skills/execute":
requests_per_minute: 10
requests_per_hour: 200
default:
requests_per_minute: 60
requests_per_hour: 1000
# Per-user limits (if using API keys)
per_user: true
# Response when limit exceeded
response:
status: 429
message: "Rate limit exceeded. Try again in {retry_after} seconds."
Handling rate limits (client-side):
async function callAPIWithRetry(url, options, maxRetries = 3) {
for (let attempt = 0; attempt < maxRetries; attempt++) {
try {
const response = await fetch(url, options);
if (response.status === 429) {
const retryAfter = response.headers.get('Retry-After') || 60;
console.log(`Rate limited. Retrying in ${retryAfter}s...`);
await sleep(retryAfter * 1000);
continue;
}
return await response.json();
} catch (error) {
if (attempt === maxRetries - 1) throw error;
}
}
}
โญ Highlights
- ๐ฅ Telegram bot provides full Clawdbot access from any device via familiar messaging interface
- โก Discord integration enables team-wide AI collaboration with slash commands and role permissions
- ๐ฏ Calendar automation analyzes attendee availability to suggest optimal meeting times automatically
- ๐ Email integration drafts context-aware responses reducing email time by 40%
- ๐ ๏ธ RESTful API exposes chat and skills to external applications via HTTP endpoints
- ๐ฐ GitHub webhooks trigger automated workflows on commits, PRs, and issues
- ๐ OAuth2 support enables secure third-party authentication without password storage
- ๐ Rate limiting protects API from abuse with configurable per-user and per-endpoint limits
๐ Related Articles
๐ Quick Start Integration Checklist
Telegram Bot (5 minutes):
- Create bot via @BotFather
- Install:
clawdbot skill install telegram-integration - Configure token
- Start bot:
clawdbot telegram start
Discord Server (10 minutes):
- Create Discord application
- Enable bot + message content intent
- Install:
clawdbot skill install discord-integration - Invite bot to server
- Test commands
Google Calendar (8 minutes):
- Enable Google Calendar API
- Download credentials.json
- Install:
clawdbot skill install calendar-integration - Authenticate:
clawdbot calendar auth
Custom API (3 minutes):
- Enable API in config.yaml
- Generate API key:
clawdbot api create-key - Test endpoint with curl
๐ธ Article Images
Image 1: Multi-Platform Integration
Prompt:
A professional REALISTIC photograph showing Clawdbot integrations across multiple devices, smartphone displaying Telegram chat with AI bot responses, laptop showing Discord server with slash commands, tablet with Google Calendar showing AI-scheduled meetings, all devices on clean modern desk with soft ambient lighting, shallow depth of field, high-end tech photography aesthetic, 16:9 landscape
Negative prompts: cartoon, illustration, cluttered, dark theme, low quality, stock photo feel
Style: REALISTIC
Aspect Ratio: landscape_16_9
Image 2: API Architecture Diagram
Prompt:
A clean DESIGN-style technical diagram showing Clawdbot API architecture, central "Clawdbot Core" connected to 6 external services (Telegram, Discord, Calendar, Email, GitHub, Custom Apps) via bidirectional arrows labeled "REST API" and "Webhooks", modern minimalist infographic style with blue and green gradients, white background, professional SaaS documentation aesthetic, 16:9 landscape
Negative prompts: photorealistic, 3D render, complex topology, dark background, too many elements
Style: DESIGN
Aspect Ratio: landscape_16_9
Image 3: Webhook Flow Visualization
Prompt:
A DESIGN-style flowchart illustrating webhook workflow, showing: (1) GitHub PR opened โ (2) Webhook POST to Clawdbot โ (3) Code review skill execution โ (4) Comment posted back to GitHub, each step with icon and status indicator, modern process diagram style with sequential arrows, color-coded steps (blue for trigger, purple for processing, green for result), white background, 16:9 landscape
Negative prompts: realistic photo, dark mode, hand-drawn, complex diagram, too much text
Style: DESIGN
Aspect Ratio: landscape_16_9
Image 4: Mobile Telegram Bot Interface
Prompt:
A REALISTIC close-up photograph of smartphone displaying Telegram conversation with Clawdbot AI assistant, chat bubbles showing user questions and AI responses with formatted text and emojis, phone held in hand with blurred desk background, natural lighting, shallow depth of field, modern mobile UI photography, professional product shot aesthetic, 16:9 landscape
Negative prompts: illustration, fake UI mockup, dark theme, cluttered screen, low resolution
Style: REALISTIC
Aspect Ratio: landscape_16_9
Word Count: 5,123 words
Target Keywords: clawdbot api, telegram bot integration, discord clawdbot, calendar automation
Internal Links: 3
Code Examples: 35+
Reading Level: Intermediate (developers, integrators)