v56

latestOpenAPI 3.1.0raw.githubusercontent.com2026-08-01142337440.5 KB
WidgetService
Widgets

Create a new widget

Creates a widget bound to an agent. The widget's DNS label and hostname are generated by the server and returned in info. The hostname may take up to a minute to become reachable while the edge propagates.

post/v1/workspaces/{workspaceId}/widgets

Path parameters

workspaceIdstring required
Example:workspace_01HXKD2E5NQM3T9AYWCF133E3Q

Workspace ID.

Request body

workspaceIdstring

Workspace ID.

Example request

{
  "workspaceId": "workspace_01HXKD2E5NQM3T9AYWCF133E3Q",
  "spec": {
    "agentId": "agent_01HXKD2E5NQM3T9AYWCFMGWT9Y",
    "variationId": "agentvar_01HXKD2E5NQM3T9AYWCF32BSPP"
  }
}

Response

OK

state'STATE_UNSPECIFIED' | 'STATE_ACTIVE' | 'STATE_ARCHIVED' enum required

The current lifecycle state of the widget. Output only. Widgets are created STATE_ACTIVE; use the :archive and :unarchive actions to transition between states.

Example response

{
  "metadata": {
    "accountId": "account_01HXKD2E5NQM3T9AYWCFTJHJVF",
    "workspaceId": "workspace_01HXKD2E5NQM3T9AYWCF133E3Q",
    "profileId": "profile_01HXKD2E5NQM3T9AYWCFS0AP08"
  },
  "spec": {
    "agentId": "agent_01HXKD2E5NQM3T9AYWCFMGWT9Y",
    "variationId": "agentvar_01HXKD2E5NQM3T9AYWCF32BSPP"
  },
  "info": {
    "dnsLabel": "k7m2xq9fp4wn",
    "host": "k7m2xq9fp4wn.widgets.cadenya.com",
    "createdBy": {
      "metadata": {
        "accountId": "account_01HXKD2E5NQM3T9AYWCFTJHJVF",
        "profileId": "profile_01HXKD2E5NQM3T9AYWCFS0AP08"
      }
    }
  }
}