Skip to content

API Overview

Uranus provides a comprehensive REST API for all agent operations.

Base URL

https://your-domain.com/api

For local development:

http://localhost:8787/api

Authentication

Cloudflare Access

When Cloudflare Access is enabled, include the JWT:

bash
curl https://your-domain.com/api/agents \
  -H "CF-Access-JWT-Assertion: <jwt-token>"

No Authentication

For public access or development:

bash
curl https://your-domain.com/api/agents

Response Format

Success Response

json
{
  "data": { ... },
  "meta": {
    "total": 100,
    "limit": 50,
    "offset": 0
  }
}

Error Response

json
{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid input",
    "details": {
      "field": "email",
      "issue": "Invalid email format"
    }
  }
}

HTTP Status Codes

CodeDescription
200Success
201Created
204No Content
400Bad Request
401Unauthorized
403Forbidden
404Not Found
429Rate Limited
500Server Error

Common Patterns

List Resources

bash
GET /api/agents/{id}/workflows?limit=50&offset=0

Query parameters:

  • limit - Maximum results (default: 50)
  • offset - Skip results (default: 0)
  • search - Text search
  • sort - Sort field
  • order - asc/desc

Get Resource

bash
GET /api/agents/{id}/workflows/{workflowId}

Create Resource

bash
POST /api/agents/{id}/workflows
Content-Type: application/json

{
  "name": "New Workflow",
  "description": "..."
}

Update Resource

bash
PUT /api/agents/{id}/workflows/{workflowId}
Content-Type: application/json

{
  "name": "Updated Name"
}

Delete Resource

bash
DELETE /api/agents/{id}/workflows/{workflowId}

Rate Limiting

Rate limits apply per IP:

EndpointLimit
General100/min
AI Chat20/min
Browser50/min
Bulk Operations10/min

Rate limit headers:

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

Pagination

Offset-Based

bash
GET /api/agents/{id}/contacts?limit=50&offset=100

Response includes meta:

json
{
  "data": [...],
  "meta": {
    "total": 500,
    "limit": 50,
    "offset": 100
  }
}

Cursor-Based

bash
GET /api/agents/{id}/messages?cursor=abc123&limit=50

Response includes cursor:

json
{
  "data": [...],
  "meta": {
    "next_cursor": "def456",
    "has_more": true
  }
}

Filtering

Simple Filter

bash
GET /api/agents/{id}/schedules?status=active

Multiple Values

bash
GET /api/agents/{id}/contacts?tag=vip&tag=customer

Date Range

bash
GET /api/agents/{id}/logs?from=2024-12-01&to=2024-12-31

Sorting

bash
GET /api/agents/{id}/workflows?sort=created_at&order=desc

Multiple sorts:

bash
GET /api/agents/{id}/contacts?sort=name,created_at&order=asc,desc
bash
GET /api/agents/{id}/contacts?search=john

Searches across relevant fields.

CORS

CORS is enabled for all origins:

Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
Access-Control-Allow-Headers: Content-Type, Authorization

Webhooks

Register webhooks for events:

bash
POST /api/agents/{id}/webhooks
{
  "url": "https://your-server.com/webhook",
  "events": ["workflow.complete", "message.received"]
}

SDK

JavaScript/TypeScript

typescript
import { UranusClient } from '@uranus/sdk'

const client = new UranusClient({
  baseUrl: 'https://your-domain.com',
  apiKey: 'your-api-key'
})

const workflows = await client.workflows.list('agent-id')

Python

python
from uranus import UranusClient

client = UranusClient(
    base_url='https://your-domain.com',
    api_key='your-api-key'
)

workflows = client.workflows.list('agent-id')

API Reference

CategoryEndpoints
AgentsAgent management
WorkflowsWorkflow CRUD and execution
SchedulesTask scheduling
CalendarCalendar tasks
ChatAI conversation
BrowserBrowser automation
ContactsContact management
SourcesData sources and RAG
MCPMCP server integration
GatewaysCommunication channels
ToolsAgent tools
SettingsAgent configuration
SQLDatabase queries
WebSocketReal-time communication

Released under the MIT License.