REST API
Overview

REST API Overview

The DevTeam Orchestrator exposes a RESTful HTTP API for managing tasks, plans, templates, and HITL approvals. All endpoints are available at https://devteam.marsala.dev/api/.

Base URL

https://devteam.marsala.dev/api

All endpoints are prefixed with /api. For self-hosted instances, replace the domain with your server address.

Authentication

All requests must include either an API key or a JWT token:

# API Key (header)
curl -H "Authorization: Bearer dtk_live_abc123" \
  https://devteam.marsala.dev/api/tasks
 
# API Key (query parameter)
curl "https://devteam.marsala.dev/api/tasks?api_key=dtk_live_abc123"

See Authentication for full details.

Content Type

All request and response bodies use JSON:

Content-Type: application/json
Accept: application/json

Endpoint Summary

Tasks

MethodEndpointDescription
POST/api/tasksCreate a new task
GET/api/tasksList tasks
GET/api/tasks/:idGet task details
DELETE/api/tasks/:idCancel a task
POST/api/tasks/batchCreate multiple tasks

Plans

MethodEndpointDescription
POST/api/plansCreate a plan
GET/api/plansList plans
GET/api/plans/:idGet plan details
POST/api/plans/:id/executeExecute a plan
GET/api/plans/executions/:idGet execution status
DELETE/api/plans/executions/:idCancel execution

Templates

MethodEndpointDescription
GET/api/templatesList templates
GET/api/templates/:idGet template details
POST/api/templatesCreate a template
POST/api/templates/:id/deployDeploy a template

HITL

MethodEndpointDescription
GET/api/hitl/pendingList pending approvals
POST/api/hitl/:taskId/approveApprove a task
POST/api/hitl/:taskId/rejectReject a task
GET/api/hitl/:taskId/historyGet approval history

System

MethodEndpointDescription
GET/api/healthHealth check
GET/api/workersList workers
GET/api/metricsPrometheus metrics

Request Format

curl -X POST https://devteam.marsala.dev/api/tasks \
  -H "Authorization: Bearer dtk_live_abc123" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Summarize this document",
    "model": "sonnet",
    "queue": "default"
  }'

Response Format

All responses follow a consistent envelope format:

{
  "success": true,
  "data": { ... },
  "meta": {
    "requestId": "req_abc123",
    "timestamp": "2026-02-20T10:00:00Z",
    "duration": 42
  }
}

Error responses:

{
  "success": false,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Field 'prompt' is required",
    "details": {
      "field": "prompt",
      "rule": "required"
    }
  },
  "meta": {
    "requestId": "req_def456",
    "timestamp": "2026-02-20T10:00:01Z"
  }
}

Pagination

List endpoints support cursor-based pagination:

# First page
curl "https://devteam.marsala.dev/api/tasks?limit=20"
 
# Next page
curl "https://devteam.marsala.dev/api/tasks?limit=20&offset=20"

Response includes pagination metadata:

{
  "data": [...],
  "pagination": {
    "total": 150,
    "limit": 20,
    "offset": 0,
    "hasMore": true
  }
}

Rate Limiting

PlanRequests/minConcurrent Tasks
Free605
Pro30050
Enterprise1000Unlimited

Rate limit headers are included in every response:

X-RateLimit-Limit: 300
X-RateLimit-Remaining: 297
X-RateLimit-Reset: 1708420860

When rate limited, the API returns HTTP 429 with a Retry-After header. The SDK handles this automatically with exponential backoff.

Next Steps