Skip to main content
Erna exposes a scheduling API with these parts:
  • Playbooks and connectors for API discovery
  • Connections for service authorization
  • Pipelines for reusable scheduling definitions
  • Runs for asynchronous pipeline execution
  • Billing for credits and checkout
  • MCP for interactive scheduling in Claude and ChatGPT

Base URLs

REST and billing use:
https://api.erna.ai
MCP uses:
https://mcp.erna.ai

REST API

Create a pipeline

Use POST /v1/workspaces/{workspaceId}/pipelines to create a reusable pipeline.
curl -X POST https://api.erna.ai/v1/workspaces/ws_123/pipelines \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Weekly rota",
    "playbook": "scheduling",
    "instructions": "Keep 2 servers on lunch and 1 bartender on dinner every day.",
    "services": {
      "planday": { "connection": "conn_123" }
    }
  }'

Run a pipeline

Use POST /v1/workspaces/{workspaceId}/pipelines/{pipelineId}/runs to invoke the latest ready revision.
curl -X POST https://api.erna.ai/v1/workspaces/ws_123/pipelines/pln_123/runs \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "input": {
      "dateRange": {
        "start": "2026-04-21",
        "end": "2026-04-27"
      }
    }
  }'
Typical response:
{
  "id": "run_123",
  "status": "running",
  "pipeline": "pln_123",
  "revision": "rev_123",
  "links": {
    "self": "/v1/runs/run_123",
    "events": "/v1/runs/run_123/events",
    "artifacts": "/v1/runs/run_123/artifacts"
  }
}
Runs can also return actionable states such as auth_required, input_required, or unsupported.

Check run status

Use GET /v1/runs/{runId} to poll the current run state.
curl https://api.erna.ai/v1/runs/run_123 \
  -H "Authorization: Bearer $TOKEN"

Billing

Billing endpoints:
  • GET /v1/billing/balance
  • GET /v1/billing/transactions
  • POST /v1/billing/checkout
  • POST /v1/billing/webhook
Example:
curl https://api.erna.ai/v1/billing/balance \
  -H "Authorization: Bearer $TOKEN"

MCP API

Erna also exposes an MCP server for interactive scheduling:
  • Base URL: https://mcp.erna.ai
  • POST /mcp
  • GET /sse
  • POST /sse/message
  • GET /.well-known/oauth-protected-resource
The MCP tools are:
  • search
  • execute

Errors

All error responses follow a consistent format:
{
  "error": "Human-readable error message",
  "details": [{ "path": "input.dateRange.start", "message": "Required" }]
}
StatusMeaning
400Invalid request body
401Missing or invalid authentication
402Insufficient credits
403Missing required scope
404Resource not found
409Conflicting or not-ready resource
422Invalid run input
500Internal error