Agent Studio

API Reference

Complete REST API reference for Agent Studio

API Reference

Agent Studio provides a RESTful API for managing tenants, agents, workflows, tools, and calls.

Base URL

https://api.agentstudio.dev/api/v1

For local development:

http://localhost:8000/api/v1

API Sections

SectionDescription
AuthenticationJWT tokens, API keys, and auth endpoints
HealthHealth check endpoints for monitoring
AgentsAgent CRUD operations
WorkflowsWorkflow management
ToolsTool definitions and actions
CallsCall initiation and monitoring (VoIP & SIP)
AnalyticsMetrics, statistics, and error logs
WebSocketReal-time event streaming (bidirectional)
SSEServer-Sent Events for dashboard real-time updates

Authentication

All API endpoints (except health checks) require authentication via one of two methods:

JWT Bearer Token

For user sessions and dashboard access:

Authorization: Bearer <access_token>

API Key

For server-to-server communication:

X-API-Key: as_live_xxxxxxxxxxxxxxxxxxxxx

API keys are prefixed:

  • as_live_* - Production keys
  • as_test_* - Testing/staging keys

Error Responses

All errors follow a consistent format:

{
  "error": {
    "code": "validation_error",
    "message": "Invalid request body",
    "details": [
      {
        "field": "config.prompt.system",
        "message": "Field is required"
      }
    ]
  }
}

Error Codes

CodeHTTP StatusDescription
authentication_error401Invalid or missing credentials
authorization_error403Insufficient permissions
not_found404Resource not found
validation_error422Invalid request body
rate_limit_exceeded429Too many requests
internal_error500Server error

Rate Limiting

Note: Rate limiting is planned but not yet implemented. The headers and limits described below represent the intended behavior for a future release.

API requests will be rate limited per API key:

  • Default: 100 requests/minute
  • Custom limits can be set per API key

Rate limit headers will be included in responses:

X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1705488600

Pagination

List endpoints support pagination:

GET /api/v1/agents?limit=20&offset=40

Response includes pagination metadata:

{
  "items": [...],
  "total": 100,
  "limit": 20,
  "offset": 40
}

OpenAPI Specification

The full OpenAPI 3.0 specification is available at:

GET /openapi.json

Interactive documentation (Swagger UI):

GET /docs

ReDoc documentation:

GET /redoc

On this page