HTTP endpoints for interacting with Arawn.
http://localhost:8080
When authentication is enabled, include a bearer token:
curl -H "Authorization: Bearer YOUR_TOKEN" http://localhost:8080/api/v1/chatAll /api/v1/* endpoints require authentication. Health and OpenAPI endpoints do not.
All list endpoints support pagination via query parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
limit |
integer | 50 | Maximum items to return |
offset |
integer | 0 | Number of items to skip |
GET /health
Response:
{
"status": "ok",
"version": "0.1.0"
}GET /health/detailed
Returns extended status including component health.
GET /swagger-ui # Interactive Swagger UI
GET /swagger.json # OpenAPI spec (JSON)
POST /api/v1/chat
Request:
{
"message": "Hello, how are you?",
"session_id": "optional-session-id",
"workstream_id": "optional-workstream-id"
}Response:
{
"session_id": "abc123",
"response": "I'm doing well! How can I help you today?",
"tool_calls": [],
"usage": {
"input_tokens": 42,
"output_tokens": 18
}
}POST /api/v1/chat/stream
Request: Same as synchronous.
Response: Server-Sent Events (SSE)
event: text
data: {"text": "I'm "}
event: text
data: {"text": "doing well!"}
event: tool_start
data: {"id": "t1", "name": "shell"}
event: tool_end
data: {"id": "t1", "result": "..."}
event: done
data: {"usage": {"input_tokens": 42, "output_tokens": 18}}
POST /api/v1/sessions
GET /api/v1/sessions?limit=50&offset=0
GET /api/v1/sessions/{id}
PATCH /api/v1/sessions/{id}
DELETE /api/v1/sessions/{id}
Response: 204 No Content
Triggers background indexing.
GET /api/v1/sessions/{id}/messages
POST /api/v1/memory
GET /api/v1/memory/search?q=rust+project&limit=5
Response:
{
"results": [
{
"id": "mem123",
"content": "Arawn is written in Rust",
"confidence": 0.95,
"source": "stated",
"created_at": "2024-01-10T08:00:00Z"
}
]
}DELETE /api/v1/memory/{id}
POST /api/v1/notes
Request:
{
"title": "Research Notes",
"content": "Key findings...",
"session_id": "abc123"
}Response: 201 Created with Note object.
GET /api/v1/notes?limit=50&offset=0
GET /api/v1/notes/{id}
PUT /api/v1/notes/{id}
DELETE /api/v1/notes/{id}
POST /api/v1/workstreams
Request:
{
"name": "New Project"
}GET /api/v1/workstreams?limit=50&offset=0
GET /api/v1/workstreams/{id}
PATCH /api/v1/workstreams/{id}
DELETE /api/v1/workstreams/{id}
POST /api/v1/workstreams/{id}/messages
GET /api/v1/workstreams/{id}/messages
GET /api/v1/workstreams/{id}/sessions
POST /api/v1/workstreams/{id}/promote
POST /api/v1/workstreams/{id}/files/promote
POST /api/v1/workstreams/{id}/files/export
POST /api/v1/workstreams/{id}/clone
GET /api/v1/workstreams/{id}/usage
POST /api/v1/workstreams/{id}/cleanup
GET /api/v1/agents
GET /api/v1/agents/{id}
GET /api/v1/tasks
GET /api/v1/tasks/{id}
DELETE /api/v1/tasks/{id}
POST /api/v1/mcp/servers
GET /api/v1/mcp/servers
DELETE /api/v1/mcp/servers/{name}
GET /api/v1/mcp/servers/{name}/tools
POST /api/v1/mcp/servers/{name}/connect
POST /api/v1/mcp/servers/{name}/disconnect
GET /api/v1/commands
POST /api/v1/commands/compact
POST /api/v1/commands/compact/stream
GET /api/v1/config
ws://localhost:8080/ws
With workstream:
ws://localhost:8080/ws?workstream=ws_abc123
Authentication happens via the first message, not HTTP headers.
Client → Server:
{
"type": "message",
"content": "Hello"
}Server → Client:
{
"type": "text",
"content": "Hi there!"
}
{
"type": "tool_start",
"id": "t1",
"name": "shell"
}
{
"type": "tool_end",
"id": "t1",
"result": "..."
}
{
"type": "done",
"usage": {...}
}{
"error": {
"code": "invalid_request",
"message": "Session not found",
"details": {}
}
}| Code | HTTP Status | Description |
|---|---|---|
invalid_request |
400 | Malformed request |
unauthorized |
401 | Missing/invalid auth |
not_found |
404 | Resource not found |
rate_limited |
429 | Too many requests |
internal_error |
500 | Server error |
When rate limited:
HTTP/1.1 429 Too Many Requests
Retry-After: 60
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1705323600