Widgets API
Create, list, publish, and delete widgets via the Embeddable Developer API.
POST /v1/widgets
Create a new widget and start an AI build from a prompt. Returns immediately with a jobId you can poll.
Body
| Field | Type | Required | Description |
|---|---|---|---|
prompt | string | yes | Natural-language description of the widget to build |
name | string | no | Display name (defaults to "API Widget") |
Response — 202 Accepted
| Field | Description |
|---|---|
editorUrl | Direct link to open the widget in your Embeddable workspace editor |
previewUrl | Public live embed URL (only loads content after the widget is published) |
Token cost: 1
Example
GET /v1/widgets
List widgets in your organization with pagination.
Query parameters
| Param | Type | Default | Description |
|---|---|---|---|
page | number | 1 | Page number |
limit | number | 20 | Items per page (max 100) |
search | string | – | Filter by name |
Response
Each widget includes editorUrl (workspace editor link) and previewUrl (live public embed URL).
GET /v1/widgets/:widgetId
Fetch a single widget.
Response
Returns 404 not_found if the widget doesn't exist or doesn't belong to your organization.
POST /v1/widgets/:widgetId/publish
Publish the latest build to the widget's public URL. After publishing, isPublished becomes true and hasUnpublishedChanges becomes false.
Response
Make sure the build job for the widget has completed (
GET /v1/jobs/:jobIdreturnsstatus: "completed") before publishing.
DELETE /v1/widgets/:widgetId
Permanently delete a widget. This removes the widget record AND its compiled assets from S3.
Response
This action is irreversible and consumes 0 tokens.