Common Conventions

Base URL

{scheme}://{host}/api/v1

Default local development: http://localhost:8000/api/v1

Authentication

Protected endpoints require a Bearer token in the Authorization header:

Authorization: Bearer <access_token>

Protected Routes

The following route prefixes require authentication:

  • /api/v1/catalog/
  • /api/v1/check/
  • /api/v1/access
  • /api/v1/group
  • /api/v1/task
  • /api/v1/action
  • /api/v1/cron/
  • /api/v1/user
  • /api/v1/marketplace

Public Routes

  • /api/v1/auth/* (signup, login, token, logout, etc.)
  • /api/v1/ai/*
  • /api/v1/logs/*
  • /api/v1/health
  • /

Unauthorized Response

// 401 Unauthorized
{"detail": "Unauthorized"}

ObjectId (LAUI)

Items are identified by a LAUI (Least Action Universal Identifier), which is a MongoDB ObjectId — a 24-character hexadecimal string.

Example: "507f1f77bcf86cd799439011"

Error Response Format

All errors follow a consistent structure:

{
  "detail": "<string or object>"
}

The detail field can be either a plain string message or a structured object depending on the error type.

Exception Hierarchy

ExceptionHTTP StatusWhen
InvalidArgumentError400Invalid request parameters
AuthorizationError403Insufficient permissions
NotFoundError404Resource not found
ConflictError409Duplicate resource or state conflict
UnprocessableEntityError422Business logic validation failure
SchemaError422Schema validation failure
InvalidOperatorError422Operator is invalid or missing required methods
PartialGenerationError206AI generation partially completed
AIError500AI provider failure
CeleryExecutionError500Task execution failure
OperationFailure (code 112)503MongoDB write conflict

Error Examples

400 Bad Request

{"detail": "either one of item_laui or is_root must be passed"}

400 Bad Request (structured)

{
  "detail": {
    "issue": "invalid pagination params passed",
    "expected pagination params": {
      "per_page": {"min": 0, "max": 1000},
      "page": {"min": 1}
    }
  }
}

403 Forbidden

{"detail": "Access denied"}

404 Not Found

{"detail": "Item not found"}

409 Conflict

{"detail": "User already exists"}

422 Unprocessable Entity (schema validation)

{
  "detail": {
    "summary": "errors found in operator.json",
    "validation_context": {
      "name": "regex pattern ^[a-zA-Z0-9_\\-]+\\.operator$ not matched"
    }
  }
}

422 Unprocessable Entity (hierarchy)

{
  "detail": {
    "message": "invalid item_type for the passed parent_laui",
    "item_type_passed": "task",
    "allowed_item_types": ["folder.workflow", "config"]
  }
}

503 Write Conflict

{"detail": "write_conflict"}

Pagination

Request Parameters

ParameterTypeDefaultConstraintsDescription
pageint1min: 1Page number
per_pageint10min: 0, max: 1000Items per page
sort_orderstring"asc" or "desc"Sort direction
page_tokenstringToken for cursor-based pagination

Response

{
  "items": [...],
  "pagination": {
    "current_page": 1,
    "per_page": 10,
    "has_next": true,
    "next_page_token": "eyJ..."
  }
}

Server-Sent Events (SSE)

The /api/v1/logs/* endpoints return SSE streams with Content-Type: text/event-stream.

SSE Format

event: <event_type>
data: <JSON>

Common SSE Events

EventDescription
statusProcessing state indicator
dataMain data payload
metadataFile/resource metadata
chunkPartial content chunk
logSingle log entry
doneStream completion signal
errorError occurred

SSE Headers

Content-Type: text/event-stream
Cache-Control: no-cache
X-Accel-Buffering: no

Access Control

The system uses Keto for permission management.

Relations

RelationDescription
ownersFull control over the resource
editorsCan modify the resource
viewersCan view the resource
true_parentPrimary parent relationship
false_parentsSecondary parent relationships

Permissions

PermissionDescription
viewRead access
editWrite access
ownFull control
deleteCan delete the resource
true_parent_editCan edit as true parent
is_true_parentCheck if true parent