🔐 Authentication

All API requests require authentication via Bearer token. Include your API key in the Authorization header:

Authorization: Bearer sk_live_51HzQ8kLp9xN2vM7wR4tY6

Generate keys in your Dashboard → API Keys. We recommend rotating keys every 90 days and restricting IP access when possible.

GET /v1/components Retrieve all published components
ParameterTypeDescription
limitintegerMax results (default: 20, max: 100)
offsetintegerPagination offset
statusstringFilter: published, draft, archived
{
  "data": [
    {
      "id": "cmp_8xK9m2Lp",
      "name": "PrimaryButton",
      "version": "2.1.0",
      "status": "published",
      "created_at": "2024-11-12T08:30:00Z"
    }
  ],
  "meta": { "total": 142, "limit": 20, "offset": 0 }
}
GET /v1/components/:id Fetch a single component by ID
ParameterTypeDescription
idstringRequired. Component identifier
{
  "id": "cmp_8xK9m2Lp",
  "name": "PrimaryButton",
  "props": { "variant": "solid", "size": "md" },
  "html": "<button class=\"btn btn-primary\">...</button>",
  "styles": { "css": "..." },
  "frameworks": ["react", "vue", "vanilla"]
}
POST /v1/components Create a new UI component
FieldTypeDescription
namestringRequired. Unique component name
frameworkstringRequired. react, vue, html
sourceobjectComponent markup & styles
props_schemaobjectOptional. JSON schema for props
{
  "id": "cmp_9yR2n5Mq",
  "status": "draft",
  "created_at": "2025-01-15T14:22:00Z",
  "message": "Component created successfully."
}
POST /v1/render Hydrate & render a UI tree
FieldTypeDescription
component_idstringRequired. Base component
treearrayNested component structure
outputstringhtml, json, framework
{
  "html": "<section class=\"hero\">...</section>",
  "css": "...",
  "js": "...",
  "metadata": {
    "components_used": 14,
    "render_time_ms": 42
  }
}

⚠️ Error Handling

Webui uses standard HTTP status codes. Errors are returned as JSON with a consistent structure:

{
  "error": {
    "code": "VALIDATION_FAILED",
    "message": "Missing required field: name",
    "details": { "field": "name", "expected": "string" },
    "request_id": "req_7xP9m2Kl"
  }
}
StatusMeaning
400Bad Request - Invalid payload or parameters
401Unauthorized - Invalid or missing API key
403Forbidden - Insufficient permissions
404Not Found - Resource doesn't exist
429Rate Limited - Too many requests
500Internal Server Error - Contact support