Reference
API Reference

API Reference

REST API for managing Hydra workflows and deployments.

Base URL

The API base URL depends on your environment:

EnvironmentBase URL
Devhttps://zl5lywlc5d.execute-api.us-west-2.amazonaws.com/v1
Betahttps://u3srgjr1uf.execute-api.us-west-2.amazonaws.com/v1
Productionhttps://1k2cc1sqa7.execute-api.us-west-2.amazonaws.com/v1

The web dashboard automatically uses the correct API URL based on the domain you're accessing.

Authentication

All API requests require a Bearer token (Cognito ID token):

curl -H "Authorization: Bearer YOUR_ID_TOKEN" \
  https://API_BASE_URL/workflows

Tokens are obtained through Cognito authentication. The web dashboard handles this automatically.


Workflows

List Workflows

GET /workflows

Query Parameters:

ParameterTypeDescription
limitnumberMax results (default: 20)
cursorstringPagination cursor
visibilitystringFilter: "public" or "private"

Response:

{
  "success": true,
  "data": [
    {
      "workflowId": "wf_abc123",
      "name": "Bug Fix Workflow",
      "description": "Find and fix bugs",
      "visibility": "public",
      "category": "development",
      "tags": ["bug-fix", "testing"],
      "currentVersion": "1.2.0",
      "stats": {
        "forks": 15,
        "subscribers": 42,
        "rating": 4.5,
        "ratingCount": 12
      },
      "createdAt": "2024-01-15T10:00:00Z",
      "updatedAt": "2024-01-20T14:30:00Z"
    }
  ],
  "pagination": {
    "nextCursor": "eyJsYXN0...",
    "hasMore": true,
    "count": 20
  }
}

Get Workflow

GET /workflows/{workflowId}

Response:

{
  "success": true,
  "data": {
    "workflowId": "wf_abc123",
    "name": "Bug Fix Workflow",
    "manifest": {
      "$schema": "https://hydra.opiusai.com/schemas/workflow/v1.0.json",
      "manifest_version": "1.0",
      "name": "Bug Fix Workflow",
      "steps": [...]
    },
    ...
  }
}

Create Workflow

POST /workflows

Request Body:

{
  "name": "My Workflow",
  "description": "Description of the workflow",
  "manifest": {
    "$schema": "https://hydra.opiusai.com/schemas/workflow/v1.0.json",
    "manifest_version": "1.0",
    "name": "My Workflow",
    "steps": [...]
  },
  "visibility": "private",
  "category": "development",
  "tags": ["custom", "automation"]
}

Response: 201 Created

{
  "success": true,
  "data": {
    "workflowId": "wf_xyz789",
    ...
  }
}

Update Workflow

PUT /workflows/{workflowId}

Request Body: Same as Create

Response: 200 OK

Delete Workflow

DELETE /workflows/{workflowId}

Response: 200 OK

{
  "success": true,
  "data": {
    "workflowId": "wf_abc123",
    "deleted": true
  }
}

Deployments

MCP Deployments bundle your workflows into a single endpoint that your IDE can connect to.

List Deployments

GET /deployments

Query Parameters:

ParameterTypeDescription
statusstringFilter by status: "active" or "inactive"
limitnumberMax results (default: 20, max: 100)
cursorstringPagination cursor

Response:

{
  "success": true,
  "data": [
    {
      "deploymentId": "dep_abc123",
      "name": "Production Deploy",
      "description": "Main production workflows",
      "workflows": [
        { "workflowId": "wf_xyz789", "name": "Bug Fix", "version": "1.0.0", "isOwned": true }
      ],
      "enabledAdapters": ["claude", "cursor", "codex"],
      "status": "active",
      "allowAnonymous": false,
      "mcpEndpoint": "https://API_BASE_URL/mcp/dep_abc123",
      "usage": {
        "connectionsThisMonth": 145,
        "lastConnectedAt": "2024-01-20T14:30:00Z"
      },
      "createdAt": "2024-01-15T10:00:00Z",
      "updatedAt": "2024-01-20T14:30:00Z"
    }
  ],
  "pagination": {
    "nextCursor": "eyJsYXN0...",
    "hasMore": true,
    "count": 20
  }
}

Get Deployment

GET /deployments/{deploymentId}

Response:

{
  "success": true,
  "data": {
    "deploymentId": "dep_abc123",
    "name": "Production Deploy",
    "description": "Main production workflows",
    "workflows": [
      {
        "workflowId": "wf_xyz789",
        "name": "Bug Fix Workflow",
        "version": "1.2.0",
        "isOwned": true
      }
    ],
    "enabledAdapters": ["claude", "cursor"],
    "status": "active",
    "allowAnonymous": false,
    "mcpEndpoint": "https://API_BASE_URL/mcp/dep_abc123",
    "createdAt": "2024-01-15T10:00:00Z",
    "updatedAt": "2024-01-20T14:30:00Z"
  }
}

Create Deployment

POST /deployments

Request Body:

{
  "name": "My Deployment",
  "description": "Optional description",
  "workflowIds": ["wf_abc123", "wf_xyz789"],
  "enabledAdapters": ["claude", "cursor", "codex"],
  "allowAnonymous": false
}
FieldTypeRequiredDescription
namestringYesDeployment name (max 100 chars)
descriptionstringNoOptional description
workflowIdsstring[]YesArray of workflow IDs to include (owned or subscribed)
enabledAdaptersstring[]NoAdapters to enable: "claude", "cursor", "codex" (default: all)
allowAnonymousbooleanNoAllow unauthenticated MCP access (default: false)

Response: 201 Created

{
  "success": true,
  "data": {
    "deploymentId": "dep_xyz789",
    "name": "My Deployment",
    "mcpEndpoint": "https://API_BASE_URL/mcp/dep_xyz789",
    "status": "active",
    "enabledAdapters": ["claude", "cursor", "codex"],
    "allowAnonymous": false,
    "workflows": [
      { "workflowId": "wf_abc123", "name": "Workflow A", "version": "1.0.0", "isOwned": true }
    ],
    "createdAt": "2024-01-15T10:00:00Z",
    "updatedAt": "2024-01-15T10:00:00Z"
  }
}

Update Deployment

PUT /deployments/{deploymentId}

Request Body:

{
  "name": "Updated Name",
  "description": "Updated description",
  "workflowIds": ["wf_abc123", "wf_new456"],
  "enabledAdapters": ["claude"],
  "allowAnonymous": true
}
FieldTypeDescription
namestringNew deployment name
descriptionstringNew description (null to remove)
workflowIdsstring[]Update included workflows (must own or be subscribed)
enabledAdaptersstring[]Update enabled adapters
allowAnonymousbooleanToggle anonymous MCP access

Response: 200 OK

Enable/Disable Adapter

POST /deployments/{deploymentId}/adapters

Request Body:

{
  "adapter": "cursor",
  "enabled": true
}
FieldTypeDescription
adapterstringAdapter name: "claude", "cursor", or "codex"
enabledbooleantrue to enable, false to disable

Response: 200 OK

{
  "success": true,
  "data": {
    "deploymentId": "dep_abc123",
    "enabledAdapters": ["claude", "cursor"]
  }
}

Deactivate Deployment

Temporarily disable a deployment without deleting it:

POST /deployments/{deploymentId}/deactivate

Response: 200 OK

Activate Deployment

Re-enable a deactivated deployment:

POST /deployments/{deploymentId}/activate

Response: 200 OK

Delete Deployment

Permanently delete a deployment. This immediately disconnects all IDEs using the endpoint.

DELETE /deployments/{deploymentId}

Response: 200 OK

{
  "success": true,
  "data": {
    "deploymentId": "dep_abc123",
    "deleted": true
  }
}
⚠️

This action cannot be undone. All connected IDEs will immediately lose access.

Get Deployment Usage

Get detailed usage statistics for a deployment:

GET /deployments/{deploymentId}/usage

Query Parameters:

ParameterTypeDescription
periodstring"day", "week", "month" (default: "month")

Response:

{
  "success": true,
  "data": {
    "deploymentId": "dep_abc123",
    "period": "month",
    "connections": {
      "total": 145,
      "limit": 500,
      "remaining": 355
    },
    "byAdapter": {
      "claude": 89,
      "cursor": 45,
      "codex": 11
    },
    "byDay": [
      { "date": "2024-01-15", "count": 12 },
      { "date": "2024-01-16", "count": 18 }
    ]
  }
}

Marketplace

Browse Marketplace

GET /marketplace

Query Parameters:

ParameterTypeDescription
categorystringFilter by category
sortstring"popular", "recent", "rating"
limitnumberMax results
cursorstringPagination cursor

Search Marketplace

GET /marketplace/search?q={query}

Get Featured Workflows

GET /marketplace/featured

Subscriptions

List Subscriptions

GET /subscriptions

Query Parameters:

ParameterTypeDescription
limitnumberMax results (default: 20)
cursorstringPagination cursor

Response:

{
  "success": true,
  "data": [
    {
      "subscriptionId": "sub_abc123",
      "userId": "user-id",
      "sourceWorkflowId": "wf_xyz789",
      "sourceUserId": "owner-id",
      "versionPin": "^1.0",
      "resolvedVersion": "1.2.0",
      "subscribedAt": "2024-01-15T10:00:00Z",
      "updatedAt": "2024-01-20T14:30:00Z"
    }
  ],
  "pagination": {
    "nextCursor": "eyJsYXN0...",
    "hasMore": true,
    "count": 20
  }
}

Subscribe to Workflow

POST /workflows/{workflowId}/subscribe

Request Body:

{
  "versionPin": "^1.0"
}
FieldTypeRequiredDescription
versionPinstringNoVersion constraint: "latest", "^1.0", "~1.2", or exact "1.2.3" (default: "latest")

Response: 201 Created

{
  "success": true,
  "data": {
    "subscriptionId": "sub_abc123",
    "userId": "user-id",
    "sourceWorkflowId": "wf_xyz789",
    "sourceUserId": "owner-id",
    "versionPin": "^1.0",
    "resolvedVersion": "1.2.0",
    "subscribedAt": "2024-01-15T10:00:00Z",
    "updatedAt": "2024-01-15T10:00:00Z"
  }
}

Get Subscription

GET /subscriptions/{subscriptionId}

Response: 200 OK

Update Subscription

PUT /subscriptions/{subscriptionId}

Request Body:

{
  "versionPin": "latest"
}

Response: 200 OK

Unsubscribe

DELETE /subscriptions/{subscriptionId}

Response: 200 OK

{
  "success": true,
  "data": {
    "subscriptionId": "sub_abc123",
    "deleted": true
  }
}

Forks

Fork Workflow

POST /workflows/{workflowId}/fork

Request Body:

{
  "name": "My Forked Workflow"
}

Response: 201 Created

{
  "success": true,
  "data": {
    "workflowId": "wf_forked123",
    "forkedFrom": {
      "workflowId": "wf_abc123",
      "version": "1.2.0"
    },
    ...
  }
}

Users

Get Current User

GET /users/me

Response:

{
  "success": true,
  "data": {
    "userId": "abc123-def456-...",
    "email": "user@example.com",
    "workflowCount": 12,
    "deploymentCount": 3,
    "subscriptionCount": 5,
    "createdAt": "2024-01-15T10:00:00Z",
    "updatedAt": "2024-01-20T14:30:00Z"
  }
}

Delete User Account

Permanently delete your account and all associated data. This performs a cascade deletion of:

  • All workflows (and their versions)
  • All deployments (and their prompts)
  • All subscriptions
  • Billing records
  • User profile
DELETE /users/me

Response: 200 OK

{
  "success": true,
  "data": {
    "userId": "abc123-def456-...",
    "deleted": true,
    "deletedAt": "2024-01-20T14:30:00Z",
    "stats": {
      "workflows": 5,
      "workflowVersions": 12,
      "deployments": 2,
      "deploymentPrompts": 6,
      "deploymentLookups": 2,
      "subscriptions": 3,
      "subscriberEntries": 3,
      "billingRecords": 1
    }
  }
}
🚫

This action cannot be undone. All your data will be permanently deleted.


Billing

Get Subscription

Get current user's billing subscription status.

GET /billing/subscription

Response:

{
  "success": true,
  "data": {
    "plan": "pro",
    "status": "active",
    "customerId": "cus_xxx",
    "subscriptionId": "sub_xxx",
    "currentPeriodStart": "2024-01-01T00:00:00Z",
    "currentPeriodEnd": "2024-02-01T00:00:00Z",
    "cancelAtPeriodEnd": false
  }
}

Create Checkout Session

Create a Stripe checkout session to upgrade your plan.

POST /billing/checkout

Request Body:

{
  "priceId": "pro_monthly",
  "successUrl": "https://hydra.opiusai.com/dashboard?upgraded=true",
  "cancelUrl": "https://hydra.opiusai.com/pricing"
}
FieldTypeRequiredDescription
priceIdstringYesPlan ID: "pro_monthly", "pro_annual", "team_monthly", "team_annual"
successUrlstringYesRedirect URL after successful payment
cancelUrlstringYesRedirect URL if user cancels

Response: 200 OK

{
  "success": true,
  "data": {
    "checkoutUrl": "https://checkout.stripe.com/..."
  }
}

Create Portal Session

Create a Stripe billing portal session to manage your subscription.

POST /billing/portal

Request Body:

{
  "returnUrl": "https://hydra.opiusai.com/dashboard"
}

Response: 200 OK

{
  "success": true,
  "data": {
    "portalUrl": "https://billing.stripe.com/..."
  }
}

Error Responses

All errors follow this format:

{
  "success": false,
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable message",
    "details": {}
  }
}

Error Codes

CodeHTTP StatusDescription
VALIDATION_ERROR400Invalid request body
UNAUTHORIZED401Missing or invalid token
FORBIDDEN403Insufficient permissions
NOT_FOUND404Resource not found
CONFLICT409Resource conflict
PLAN_LIMIT_EXCEEDED402Plan limit reached
RATE_LIMITED429Too many requests
INTERNAL_ERROR500Server error

Rate Limits

PlanRequests/MinuteRequests/Hour
Free30500
Pro1005,000
Team30020,000
Enterprise1,000100,000

Rate limit headers are included in all responses:

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

SDKs

Official SDKs coming soon:

  • JavaScript/TypeScript
  • Python
  • Go

Related