Skip to content

API Overview

The Snippbot API is a REST API served by the local daemon. All endpoints are available at http://{host}:{port}/api (default: http://localhost:18781/api).

All API requests (except health checks and the bootstrap check) require a Bearer token in the Authorization header.

Terminal window
curl http://localhost:18781/api/agents \
-H "Authorization: Bearer snip_your_api_key_here"
TypePrefixDescription
API keysnip_Long-lived, for CLI/automation
Session tokensess_24-hour session from username/password login

Create an API key via:

  • Setup wizard (Step 3 — Account tab → API Key)
  • Settings → API Keys in the web UI
  • POST /api/auth/keys endpoint

http://localhost:18781/api

For VM or server installations (custom host/port):

http://{SNIPPBOT_HOST}:{SNIPPBOT_PORT}/api

  • All request bodies use Content-Type: application/json
  • Dates use ISO 8601 format: 2026-03-01T09:00:00Z
  • IDs use prefixed strings: proj_abc123, agt_xyz789
Terminal window
curl -X POST http://localhost:18781/api/projects \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "AI Framework Research", "description": "Research top 5 AI frameworks"}'

All responses return JSON. Successful responses include the resource directly or wrapped in a result object:

// Single resource
{ "id": "proj_abc123", "status": "pending", ... }
// List resource
{ "items": [...], "total": 42 }

Errors follow a consistent structure:

{
"error": "not_found",
"message": "Project proj_abc123 not found",
"status": 404
}
HTTP StatusError codeMeaning
400bad_requestInvalid request body or parameters
401unauthorizedMissing or invalid auth token
403forbiddenToken valid but insufficient permissions
404not_foundResource does not exist
409conflictState conflict (e.g., approving a non-pending project)
422validation_errorValid JSON but invalid field values
500internal_errorServer error

Chat and some execution endpoints use Server-Sent Events for streaming responses:

Terminal window
curl http://localhost:18781/api/chat/messages/stream \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"message": "Hello", "conversation_id": "conv_abc123"}' \
--no-buffer

SSE events use the format:

event: token
data: {"content": "Hello"}
event: done
data: {"total_tokens": 42}

Two WebSocket endpoints are available:

EndpointDescription
ws://localhost:18781/ws/eventsMain event bus — real-time updates
ws://localhost:18781/device/wsDevice connection protocol
ws://localhost:18781/api/browser/streamBrowser viewport live stream

Connect with a token in the query string:

ws://localhost:18781/ws/events?token=snip_your_key

GroupBase pathDescription
Auth/api/authBootstrap, register, login, API keys
Chat/api/chatConversations, streaming messages
Projects/api/projectsProject CRUD, plan, approve, execute
Agents/api/agentsAgent CRUD
Memory/api/memoryEpisodes, clusters, search, graph
Scheduler/api/schedulerJobs CRUD, runs, NL parsing
Workflows/api/workflowsWorkflow CRUD, templates, execute
Devices/api/devices, /api/device-groupsDevice pairing, groups, health
Browser/api/browserCDP automation, screenshots
Sandbox/api/sandboxContainer management, config
Hooks/api/hooks, /api/webhooksEvent hooks, webhooks
Channels/api/channelsPlatform config, bindings
Settings/api/settingsAll settings CRUD
Monitor/api/monitoring, /healthUsage, alerts, health, metrics
Files/api/filesUpload, download, delete
Providers/api/providersAI model provider keys