Core API Documentation
Programmatic access to Webui's component engine, rendering pipeline, and template library. RESTful, JSON-based, and optimized for developer velocity.
https://api.webui.io/v1
🔐 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
| Parameter | Type | Description |
|---|---|---|
limit | integer | Max results (default: 20, max: 100) |
offset | integer | Pagination offset |
status | string | Filter: 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
| Parameter | Type | Description |
|---|---|---|
id | string | Required. 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
| Field | Type | Description |
|---|---|---|
name | string | Required. Unique component name |
framework | string | Required. react, vue, html |
source | object | Component markup & styles |
props_schema | object | Optional. 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
| Field | Type | Description |
|---|---|---|
component_id | string | Required. Base component |
tree | array | Nested component structure |
output | string | html, 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"
}
}
| Status | Meaning |
|---|---|
| 400 | Bad Request - Invalid payload or parameters |
| 401 | Unauthorized - Invalid or missing API key |
| 403 | Forbidden - Insufficient permissions |
| 404 | Not Found - Resource doesn't exist |
| 429 | Rate Limited - Too many requests |
| 500 | Internal Server Error - Contact support |