OpenClaw HTTP API documentation.
All API requests require authentication:
curl -H "Authorization: Bearer YOUR_GATEWAY_TOKEN" \
http://localhost:3000/api/endpointGET /health
Response:
{
"status": "ok",
"version": "2026.2.13",
"uptime": 86400
}GET /api/status
Response:
{
"gateway": "running",
"channels": {
"telegram": "connected",
"discord": "connected"
},
"sessions": 5,
"memory": {
"used": 256,
"total": 512
}
}GET /api/sessions
Response:
{
"sessions": [
{
"id": "session-123",
"channel": "telegram",
"userId": "user-456",
"messageCount": 42,
"lastActivity": "2026-02-14T12:00:00Z"
}
]
}GET /api/sessions/:id
DELETE /api/sessions/:id
POST /api/messages
Body:
{
"channel": "telegram",
"userId": "user-123",
"message": "Hello from API!"
}GET /api/channels
Response:
{
"channels": [
{
"name": "telegram",
"status": "connected",
"messagesReceived": 1000,
"messagesSent": 500
}
]
}GET /api/tools
Response:
{
"tools": [
{
"name": "read",
"description": "Read file contents",
"enabled": true
}
]
}POST /api/tools/:name/invoke
Body:
{
"params": {
"path": "/path/to/file"
}
}GET /api/cron
POST /api/cron/:id/run
GET /api/config
PATCH /api/config
Body:
{
"logging": {
"level": "debug"
}
}Connect to real-time events:
const ws = new WebSocket('ws://localhost:3000/ws');
ws.onmessage = (event) => {
const data = JSON.parse(event.data);
console.log('Event:', data.type, data.payload);
};| Event | Description |
|---|---|
message:received |
New message from channel |
message:sent |
Message sent to channel |
session:created |
New session created |
tool:invoked |
Tool was called |
error |
Error occurred |
All errors follow this format:
{
"error": {
"code": "INVALID_REQUEST",
"message": "Description of the error",
"details": {}
}
}| Code | Description |
|---|---|
UNAUTHORIZED |
Missing or invalid token |
FORBIDDEN |
Insufficient permissions |
NOT_FOUND |
Resource not found |
INVALID_REQUEST |
Malformed request |
RATE_LIMITED |
Too many requests |
INTERNAL_ERROR |
Server error |
| Endpoint | Limit |
|---|---|
/api/messages |
100/minute |
/api/tools/invoke |
50/minute |
| Other endpoints | 200/minute |
::: tip API Client Use the official OpenClaw SDK for your language:
- JavaScript:
npm install @openclaw/sdk - Python:
pip install openclaw:::