Skip to main content

REST API Overview

Raworc provides a comprehensive REST API for accelerating agent development from prototype to production. The API enables programmatic control over containerized sessions, computer-use capabilities, multi-agent orchestration, and enterprise operations.

Base Information

  • Base URL: http://your-server:9000/api/v0
  • Protocol: HTTP/HTTPS
  • Format: JSON
  • Authentication: Bearer token (JWT)

Authentication

All API endpoints (except /health, /version, and /auth/login) require authentication using a JWT bearer token.

Workspaces

Raworc uses spaces to organize resources and provide isolation. Sessions and secrets belong to spaces, while users and roles are global. Access is controlled through role bindings that specify which users have which roles in which spaces.

Obtaining a Token

POST /api/v0/auth/login
Content-Type: application/json

{
"user": "admin",
"pass": "your-password"
}

Response:

{
"token": "eyJ0eXAiOiJKV1QiLCJhbGc...",
"token_type": "Bearer",
"expires_at": "2025-01-02T12:00:00Z"
}

Using the Token

Include the token in the Authorization header:

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGc...

API Endpoints

Core Endpoints

EndpointMethodDescription
/healthGETHealth check
/versionGETAPI version info
/auth/loginPOSTAuthenticate and get token
/auth/meGETGet current user info

Service Accounts

EndpointMethodDescription
/service-accountsGETList all service accounts
/service-accountsPOSTCreate new service account
/service-accounts/{id}GETGet specific service account
/service-accounts/{id}PUTUpdate service account
/service-accounts/{id}DELETEDelete service account
/service-accounts/{id}/passwordPUTUpdate service account password

Roles

EndpointMethodDescription
/rolesGETList all roles
/rolesPOSTCreate new role
/roles/{id}GETGet specific role
/roles/{id}DELETEDelete role

Role Bindings

EndpointMethodDescription
/role-bindingsGETList all role bindings
/role-bindingsPOSTCreate new role binding
/role-bindings/{id}GETGet specific role binding
/role-bindings/{id}DELETEDelete role binding

Spaces

EndpointMethodDescription
/spacesGETList all spaces
/spacesPOSTCreate new space
/spaces/{name}GETGet specific space
/spaces/{name}PUTUpdate space
/spaces/{name}DELETEDelete space

Space Secrets

EndpointMethodDescription
/spaces/{name}/secretsGETList space secrets
/spaces/{name}/secretsPOSTCreate new secret
/spaces/{name}/secrets/{key}GETGet specific secret
/spaces/{name}/secrets/{key}PUTUpdate secret
/spaces/{name}/secrets/{key}DELETEDelete secret

Space Agents

EndpointMethodDescription
/spaces/{name}/agentsGETList space agents
/spaces/{name}/agentsPOSTCreate new agent

Space Builds

EndpointMethodDescription
/spaces/{name}/buildPOSTTrigger space build
/spaces/{name}/build/latestGETGet latest build status
/spaces/{name}/build/{build_id}GETGet specific build status

Sessions

EndpointMethodDescription
/sessionsGETList sessions
/sessionsPOSTCreate new session
/sessions/{id}GETGet specific session
/sessions/{id}PUTUpdate session details
/sessions/{id}/statePUTUpdate session state
/sessions/{id}/pausePOSTPause session
/sessions/{id}/suspendPOSTSuspend session
/sessions/{id}/resumePOSTResume session
/sessions/{id}/remixPOSTFork session
/sessions/{id}DELETEDelete session

Session Messages

EndpointMethodDescription
/sessions/{id}/messagesGETList session messages
/sessions/{id}/messagesPOSTSend message to session
/sessions/{id}/messages/countGETGet message count
/sessions/{id}/messagesDELETEClear all messages

Agents

EndpointMethodDescription
/spaces/{name}/agents/{agent_name}GETGet specific agent
/spaces/{name}/agents/{agent_name}PUTUpdate agent
/spaces/{name}/agents/{agent_name}DELETEDelete agent
/spaces/{name}/agents/{agent_name}/statusPATCHUpdate agent status
/spaces/{name}/agents/{agent_name}/deployPOSTDeploy agent
/spaces/{name}/agents/{agent_name}/stopPOSTStop agent
/spaces/{name}/agents/runningGETList running agents
/spaces/{name}/agents/{agent_name}/logsGETGet agent logs

Request Format

Headers

Required headers for authenticated requests:

Authorization: Bearer <token>
Content-Type: application/json

Request Body

All POST and PUT requests accept JSON:

{
"field1": "value1",
"field2": "value2"
}

Response Format

Success Response

{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "example",
"created_at": "2025-01-01T00:00:00Z"
}

Error Response

{
"error": {
"code": "NOT_FOUND",
"message": "Resource not found"
}
}

Status Codes

CodeDescription
200Success
201Created
204No Content (successful deletion)
400Bad Request
401Unauthorized
403Forbidden
404Not Found
409Conflict
422Unprocessable Entity
500Internal Server Error

Rate Limiting

Currently, Raworc does not enforce rate limiting, but this may change in future versions. Best practices:

  • Cache responses when possible
  • Use pagination for list operations
  • Implement exponential backoff for retries

Pagination

List endpoints support pagination:

GET /sessions?limit=20&offset=0
GET /service-accounts?limit=50&offset=100
GET /spaces?limit=10&offset=0

Parameters:

  • limit - Maximum number of items to return (default: 100, max: 1000)
  • offset - Number of items to skip (default: 0)

Response Headers:

X-Total-Count: 250
X-Page-Offset: 100
X-Page-Limit: 50

Filtering

Some endpoints support filtering:

GET /sessions?workspace_name=my-project  # Sessions for workspace
GET /sessions?state=IDLE
GET /spaces?active=true
GET /spaces/{name}/secrets?show_values=true

SDK Support

Official SDKs are planned for:

  • Python
  • JavaScript/TypeScript
  • Go
  • Rust

Webhooks

Webhook support is planned for future releases to enable:

  • Real-time notifications
  • Event-driven workflows
  • Third-party integrations

API Versioning

The API uses URL versioning:

  • Current version: v0
  • Format: /api/v{version}/endpoint

Breaking changes will result in a new API version.

Best Practices

  1. Use Specific Fields: Only request/send needed fields
  2. Handle Errors: Implement proper error handling
  3. Validate Input: Validate data before sending
  4. Use HTTPS: Always use HTTPS in production
  5. Token Management: Refresh tokens before expiry
  6. Idempotency: Make requests idempotent where possible

Available API Documentation

Next Steps