API Reference

Programmatic access to Webui's component engine, design tokens, and deployment pipeline. All endpoints return JSON and require authentication.

BASE URL https://api.webui.io/v1

Overview

The Webui REST API allows you to manage projects, generate components, sync design tokens, and trigger deployments. Requests must include a valid API key and use HTTPS. Rate limits are enforced at 120 requests per minute.

Authentication

Authenticate your requests by including your API key in the Authorization header as a Bearer token.

Authorization: Bearer wk_live_8f7a2b3c4d5e6f1a9b8c7d6e5f4a3b2c

Generate keys in your Dashboard → Settings → API Keys. Never expose secret keys in client-side code.

Endpoints

GET /components

Retrieve a paginated list of all UI components in your workspace. Supports filtering by type, tags, and creation date.

ParameterTypeDescription
pageintegerPage number (default: 1)
limitintegerItems per page (default: 20, max: 100)
typestringFilter by component type (e.g., button, card, form)
statusstringFilter by status: draft, published, archived
Example Request
GET /v1/components?limit=10&type=card&status=published
Authorization: Bearer wk_live_...
Content-Type: application/json
Example Response (200 OK)
{
  "data": [
    {
      "id": "cmp_8x9y2z3a4b5c",
      "name": "Hero Section",
      "type": "card",
      "status": "published",
      "created_at": "2024-11-15T08:30:00Z"
    }
  ],
  "meta": {
    "total": 42,
    "page": 1,
    "limit": 10
  }
}
POST /components

Create a new UI component from a design token set or raw configuration JSON.

ParameterTypeDescription
nameRequiredstringComponent display name
configRequiredobjectLayout, styling, and behavior configuration
tokensstring[]Array of design token IDs to apply
tagsstring[]Categorization labels
Example Request Body
{
  "name": "Pricing Card Pro",
  "config": {
    "layout": "flex-column",
    "padding": "24px",
    "rounded": true
  },
  "tokens": ["tok_primary_500", "tok_radius_md"],
  "tags": ["pricing", "marketing"]
}
Example Response (201 Created)
{
  "id": "cmp_9a8b7c6d5e4f",
  "name": "Pricing Card Pro",
  "status": "draft",
  "preview_url": "https://webui.io/preview/cmp_9a8b7c6d5e4f",
  "created_at": "2024-12-01T14:22:00Z"
}
DELETE /components/:id

Permanently remove a component. This action cannot be undone. Associated tokens remain unaffected.

ParameterTypeDescription
idRequiredstringThe unique component identifier (path parameter)
Example Response (204 No Content)
// Empty body
// Status: 204 No Content
GET /tokens

Fetch global design tokens (colors, spacing, typography, radii) currently active in your workspace.

Example Response (200 OK)
{
  "colors": {
    "primary_500": "#6C3CE1",
    "accent_500": "#00D4AA",
    "surface": "#FFFFFF"
  },
  "typography": {
    "font_family": "system-ui, sans-serif",
    "base_size": "16px"
  },
  "spacing": { "md": "24px", "lg": "32px" }
}

Error Handling

Webui uses standard HTTP status codes and returns detailed error objects in the response body.

CodeDescription
400Bad Request — Invalid parameters or malformed JSON
401Unauthorized — Missing or invalid API key
403Forbidden — Insufficient permissions for the requested resource
404Not Found — Resource does not exist
429Too Many Requests — Rate limit exceeded
500Internal Server Error — Something went wrong on our end