ClawPing API Reference

The ClawPing REST API lets you programmatically create reminders, alerts, and recurring schedules β€” and receive notifications via Telegram or Email. The API follows REST conventions and returns JSON.

Base URL

All API requests are made to your ClawPing instance:

Base URL
https://api.clawping.xyz

Request Format

All requests must include Content-Type: application/json. All responses return JSON.

curl example
curl -X POST https://api.clawping.xyz/pings \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "type": "reminder", "message": "Hello!", "delay": "1m" }'

Authentication

ClawPing uses Bearer token authentication. Include your token in every request's Authorization header.

POST /api/auth/token Generate API token β–Ό

Request Body

FieldTypeDescription
secretrequiredstringYour API_SECRET_KEY from .env configuration
expires_instringToken TTL: 7d, 30d, never (default: never)
Request
curl -X POST https://api.clawping.xyz/auth/token \
  -H "Content-Type: application/json" \
  -d '{ "secret": "your-secret-key", "expires_in": "30d" }'
Response β€” 200
{
  "token": "cp_eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "expires_at": "2026-03-27T00:00:00Z",
  "type": "Bearer"
}
200 OK 401 Invalid secret

Create a Ping

Schedule a time-based reminder delivered via Telegram or Email at the specified delay.

POST /pings Create a reminder β–Ό

Request Body

FieldTypeDescription
typerequiredstringMust be reminder
messagerequiredstringThe notification text (max 2000 chars)
delayrequiredstringTime until fire: 30s 5m 2h 1d
channelrequiredstringtelegram or email
chat_idstringTelegram chat ID (required if channel=telegram)
emailstringEmail address (required if channel=email)
Request
curl -X POST https://api.clawping.xyz/pings \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "type":    "reminder",
    "message": "Deploy the new version to production",
    "delay":   "2h",
    "channel": "telegram",
    "chat_id": "437734870"
  }'
Response β€” 201
{
  "id":           "ping_7f3a9b2c",
  "status":       "scheduled",
  "type":         "reminder",
  "message":      "Deploy the new version to production",
  "channel":      "telegram",
  "chat_id":      "437734870",
  "scheduled_at": "2026-02-25T11:31:00Z",
  "created_at":   "2026-02-25T09:31:00Z",
  "metadata": {
    "delay_parsed": "2h",
    "delay_ms":     7200000
  }
}
201 Created 400 Invalid delay format 401 Unauthorized
GET /pings List all pings β–Ό

Query Parameters

ParamTypeDescription
statusstringscheduled fired cancelled β€” filter by status
limitintegerMax results to return (default: 20, max: 100)
offsetintegerPagination offset (default: 0)
Request
curl https://api.clawping.xyz/pings?status=scheduled&limit=10 \
  -H "Authorization: Bearer $TOKEN"
Response β€” 200
{
  "total": 3,
  "limit": 10,
  "offset": 0,
  "pings": [
    { "id": "ping_7f3a9b2c", "status": "scheduled", "message": "Deploy...", "scheduled_at": "2026-02-25T11:31:00Z" },
    { "id": "ping_8a4b2d1e", "status": "scheduled", "message": "Standup", "scheduled_at": "2026-02-26T09:00:00Z" }
  ]
}
200 OK
GET /pings/{id} Get a specific ping β–Ό
Request
curl https://api.clawping.xyz/pings/ping_7f3a9b2c \
  -H "Authorization: Bearer $TOKEN"
200 OK 404 Not found
DEL /pings/{id}/cancel Cancel a scheduled ping β–Ό
Request
curl -X DELETE https://api.clawping.xyz/pings/ping_7f3a9b2c \
  -H "Authorization: Bearer $TOKEN"
Response β€” 200
{ "success": true, "id": "ping_7f3a9b2c", "status": "cancelled" }
200 Cancelled 404 Not found 400 Already fired

Condition Alerts

Monitor live conditions and fire notifications only when a threshold is crossed. Supports CoinGecko price data and custom webhooks.

POST /conditions Create a condition alert β–Ό
FieldTypeDescription
typerequiredstringMust be condition
condition.assetrequiredstringCoinGecko asset ID: bitcoin ethereum
condition.operatorrequiredstringabove or below
condition.thresholdrequirednumberPrice threshold in USD
messagerequiredstringNotification text when condition fires
channelrequiredstringtelegram or email
repeatbooleanRe-arm after firing (default: false)
Request
curl -X POST https://api.clawping.xyz/conditions \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "condition",
    "condition": {
      "asset":     "bitcoin",
      "operator":  "below",
      "threshold": 60000
    },
    "message": "BTC dropped below $60k β€” check positions",
    "channel": "telegram",
    "chat_id": "437734870",
    "repeat":  false
  }'
201 Created 400 Invalid condition

Agent Webhooks

Other agents in the Claw ecosystem can send notifications directly via the webhook endpoint. Authenticate with an agent key.

POST /webhook/agents Send an agent notification β–Ό
πŸ”‘

Agent Auth: Use X-Agent-Key: sk_agent_... header instead of Bearer token. Register your agent first via POST /webhook/agents/register.

Request
curl -X POST https://api.clawping.xyz/webhook/agents \
  -H "X-Agent-Key: sk_agent_clawscout_abc123" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_id":  "clawscout-v1.2",
    "priority":  "urgent",
    "recipient": {
      "channel": "telegram",
      "chat_id": "437734870"
    },
    "notification": {
      "title":     "🚨 Breaking: SEC approves Bitcoin ETF",
      "body":      "BTC price impact expected immediately.",
      "source_url":"https://reuters.com/article/..."
    }
  }'
Response β€” 200
{
  "success":   true,
  "ping_id":   "ping_webhook_9x2b",
  "delivered": true,
  "channel":   "telegram"
}
200 Delivered 401 Invalid agent key
POST /webhook/agents/register Register a new agent β–Ό
Request
curl -X POST https://api.clawping.xyz/webhook/agents/register \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_id":    "clawscout-v1.2",
    "name":        "ClawScout",
    "description": "News monitoring agent",
    "allowed_channels": ["telegram", "email"]
  }'
Response β€” 201
{
  "agent_key": "sk_agent_clawscout_abc123def456",
  "agent_id":  "clawscout-v1.2",
  "created_at":"2026-02-25T09:31:00Z"
}
201 Registered

Recurring Schedules

Create cron-based recurring pings. Set once, repeat forever. Uses standard 5-field cron syntax.

POST /reminders Create a recurring schedule β–Ό
FieldTypeDescription
cronrequiredstring5-field cron: 0 9 * * 1-5 = Mon–Fri 9am
messagerequiredstringNotification text
channelrequiredstringtelegram or email
timezonestringIANA timezone (default: server timezone)
Request
curl -X POST https://api.clawping.xyz/recurring \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "cron":     "0 9 * * 1-5",
    "message":  "Daily standup β€” update your Jira tickets first!",
    "channel":  "telegram",
    "chat_id":  "437734870",
    "timezone": "Asia/Jakarta"
  }'
201 Scheduled 400 Invalid cron

Test Connections

Verify your channel configurations are working correctly.

POST /api/test/telegram Send Telegram test message β–Ό
Request
curl -X POST https://api.clawping.xyz/test/telegram \
  -H "Authorization: Bearer $TOKEN"
Response β€” 200
{ "success": true, "message": "Telegram connected βœ“", "chat_id": "437734870" }
200 OK 400 Bot not configured
POST /api/test/email Send test email β–Ό
Request
curl -X POST https://api.clawping.xyz/test/email \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "to": "you@example.com" }'
200 Sent 400 SMTP not configured
GET /health Service health check β–Ό
Request
curl https://api.clawping.xyz/health
Response β€” 200
{
  "status":    "ok",
  "version":   "1.0.0",
  "uptime":    "2d 4h 31m",
  "scheduler": "running",
  "db":        "connected",
  "telegram":  "connected",
  "email":     "connected"
}
200 OK

Errors & Codes

ClawPing uses standard HTTP status codes and returns structured error objects.

Error Format
{
  "error":   "INVALID_DELAY",
  "message": "Delay format '5x' is not valid. Use: 30s, 5m, 2h, 1d",
  "status":  400
}
CodeStatusMeaning
UNAUTHORIZED401Missing or invalid Bearer token
INVALID_DELAY400Delay format not recognized
INVALID_CHANNEL400Channel must be telegram or email
PING_NOT_FOUND404Ping ID does not exist
ALREADY_FIRED400Cannot cancel a ping that already fired
RATE_LIMIT429Too many pings created β€” limit per user exceeded
AGENT_KEY_INVALID401Agent key not registered or revoked
SMTP_FAILED500Email delivery failed β€” check SMTP config
TELEGRAM_FAILED500Telegram delivery failed β€” check bot token
⚑ Rate Limits Default limits per user β–Ό
ResourceDefault LimitConfigurable
Max active pings100 per userMAX_PINGS_PER_USER in .env
API requests300 / 15 minRATE_LIMIT_WINDOW in .env
Webhook calls60 / min per agentWEBHOOK_RATE_LIMIT in .env