For the complete documentation index, see llms.txt. This page is also available as Markdown.

Create a widget

Creates a new widget.

  • slug is normalized (lower case, underscores replaced by hyphens) before it is stored. A slug that exactly matches an existing one is rejected with 400; one that matches only after normalization is rejected with 406 (cms_widget_100).

  • attributes is optional and must be a JSON object; keys not defined in the widget type's schema are dropped. Every remaining value is validated against the schema; an invalid value is rejected with 406 (attribute_input_type_100).

  • Localizable attribute values are stored for the language of the request — see IGNORE_ACCEPT_LANGUAGE_HEADER under Dynamic Settings & Environment Variables.

post
/widgets/
Authorizations
AuthorizationstringRequired

Token credential sent in the Authorization header, in the form: Token <your-token>. Requires a staff (admin) account.

Body

The body of a widget create request.

namestring · max: 255Required

The display name of the widget.

slugstring · max: 255Required

The unique key of the widget. Letters, digits, underscores, and hyphens only; converted to lower case, with underscores replaced by hyphens, before it is stored.

Pattern: ^[-a-zA-Z0-9_]+$
widget_typeintegerRequired

The identifier of an existing widget type.

templatestring · max: 512Required

The path of the template used to render the widget.

Responses
201

The widget was created.

application/json

A CMS widget.

pkintegerRead-onlyOptional

The unique identifier of the widget.

created_datestring · date-timeRead-onlyOptional

When the widget was created.

modified_datestring · date-timeRead-onlyOptional

When the widget was last changed.

namestring · max: 255Optional

The display name of the widget. Not unique.

slugstring · max: 255Optional

The unique, normalized (lower-case, hyphenated) key the storefront uses to look the widget up.

widget_typeintegerOptional

The identifier of the widget type.

templatestring · max: 512Optional

The path of the template used to render the widget.

post/widgets/
POST /api/v1/remote/1/widgets/ HTTP/1.1
Host: sandbox.akinon.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 171

{
  "name": "Home Hero Banner",
  "slug": "home-hero-banner",
  "widget_type": 3,
  "template": "widgets/hero-banner.html",
  "attributes": {
    "title": "Summer Sale",
    "subtitle": "Up to 50% off"
  }
}
{
  "pk": 12,
  "created_date": "2026-09-29T09:08:29.608203Z",
  "modified_date": "2026-09-29T09:08:29.608215Z",
  "name": "Home Hero Banner",
  "slug": "home-hero-banner",
  "widget_type": 3,
  "template": "widgets/hero-banner.html",
  "attributes": {
    "title": "Summer Sale",
    "subtitle": "Up to 50% off"
  },
  "attributes_kwargs": {}
}

Last updated

Was this helpful?