API Documentation

Everything you need to integrate ClawConnect with your AI agent.

Authentication

All API requests require a Bearer token. Generate an API key from your dashboard.

Authorization: Bearer oc_live_abc123...

Rate Limits

100 requests per minute per API key. Rate limit info is in response headers:

X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1721234567

OpenClaw Integration

To use with an OpenClaw agent, add the API key to your agent's tools configuration:

// In your OpenClaw agent config
{
  "tools": {
    "openclaw_connect": {
      "api_key": "oc_live_abc123...",
      "base_url": "https://your-domain.com/api/v1"
    }
  }
}

// The agent can then call:
// GET /api/v1/gmail/messages — to check emails
// POST /api/v1/twitter/tweet — to post tweets
// POST /api/v1/calendar/events — to schedule meetings

Endpoints

GET/api/v1/connections

List all connected accounts

Request

curl https://your-domain.com/api/v1/connections \
  -H "Authorization: Bearer oc_live_abc123..."

Response

{
  "data": [
    {
      "id": "clx...",
      "provider": "twitter",
      "displayName": "@username",
      "status": "active",
      "scopes": "read,write"
    }
  ]
}
GET/api/v1/twitter/me

Get connected Twitter profile

Request

curl https://your-domain.com/api/v1/twitter/me \
  -H "Authorization: Bearer oc_live_abc123..."

Response

{
  "data": {
    "id": "123456789",
    "name": "Your Name",
    "username": "yourhandle",
    "profile_image_url": "https://..."
  }
}
POST/api/v1/twitter/tweet

Post a tweet

Request

curl -X POST https://your-domain.com/api/v1/twitter/tweet \
  -H "Authorization: Bearer oc_live_abc123..." \
  -H "Content-Type: application/json" \
  -d '{"text": "Hello from my AI agent! 🤖"}'

Response

{
  "data": {
    "id": "1234567890",
    "text": "Hello from my AI agent! 🤖"
  }
}
GET/api/v1/twitter/timeline

Get home timeline

Request

curl "https://your-domain.com/api/v1/twitter/timeline?limit=10" \
  -H "Authorization: Bearer oc_live_abc123..."

Response

{
  "data": [
    {
      "id": "...",
      "text": "...",
      "created_at": "2025-07-17T12:00:00Z",
      "public_metrics": { "like_count": 5 }
    }
  ]
}
GET/api/v1/gmail/messages

List recent emails

Request

curl "https://your-domain.com/api/v1/gmail/messages?limit=10&q=is:unread" \
  -H "Authorization: Bearer oc_live_abc123..."

Response

{
  "data": [
    {
      "id": "msg_id",
      "subject": "Hello!",
      "from": "sender@example.com",
      "snippet": "Preview text..."
    }
  ]
}
GET/api/v1/gmail/messages/:id

Get full email content

Request

curl https://your-domain.com/api/v1/gmail/messages/msg_123 \
  -H "Authorization: Bearer oc_live_abc123..."

Response

{
  "data": {
    "id": "msg_123",
    "subject": "Hello!",
    "from": "sender@example.com",
    "to": "you@example.com",
    "body": "Full email content..."
  }
}
POST/api/v1/gmail/send

Send an email

Request

curl -X POST https://your-domain.com/api/v1/gmail/send \
  -H "Authorization: Bearer oc_live_abc123..." \
  -H "Content-Type: application/json" \
  -d '{
    "to": "recipient@example.com",
    "subject": "Sent by my AI agent",
    "body": "Hello from ClawConnect!"
  }'

Response

{
  "data": {
    "id": "msg_456",
    "threadId": "thread_789"
  }
}
GET/api/v1/calendar/events

List upcoming calendar events

Request

curl "https://your-domain.com/api/v1/calendar/events?limit=5" \
  -H "Authorization: Bearer oc_live_abc123..."

Response

{
  "data": [
    {
      "id": "evt_123",
      "summary": "Team standup",
      "start": { "dateTime": "2025-07-17T10:00:00Z" },
      "end": { "dateTime": "2025-07-17T10:30:00Z" }
    }
  ]
}
POST/api/v1/calendar/events

Create a calendar event

Request

curl -X POST https://your-domain.com/api/v1/calendar/events \
  -H "Authorization: Bearer oc_live_abc123..." \
  -H "Content-Type: application/json" \
  -d '{
    "summary": "AI Agent Review",
    "start": "2025-07-18T14:00:00Z",
    "end": "2025-07-18T15:00:00Z",
    "description": "Scheduled by AI"
  }'

Response

{
  "data": {
    "id": "evt_456",
    "summary": "AI Agent Review",
    "htmlLink": "https://calendar.google.com/..."
  }
}