> For the complete documentation index, see [llms.txt](https://apidocs.akinon.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://apidocs.akinon.com/commerce-openapis/cms/widgets.md).

# Widgets

Widget data and schema retrieval

## Retrieve widget data

> Returns widget template context data including attributes, name, slug, and template.

```json
{"openapi":"3.1.0","info":{"title":"CMS API - Content Management & Pages","version":"1.0.0"},"tags":[{"name":"Widgets","description":"Widget data and schema retrieval"}],"servers":[{"description":"Default commerce site","url":"https://{commerce_url}","variables":{"commerce_url":{"default":"sandbox.akinon.com","description":"Commerce storefront hostname"}}}],"paths":{"/widgets/{slug}/":{"get":{"tags":["Widgets"],"operationId":"retrieveWidget","summary":"Retrieve widget data","description":"Returns widget template context data including attributes, name, slug, and template.","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"},"description":"Widget slug identifier"}],"responses":{"200":{"description":"Widget data retrieved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WidgetData"}}}},"404":{"description":"Widget not found"}}}}},"components":{"schemas":{"WidgetData":{"type":"object","description":"Widget template context data returned by the widget endpoint. Contains widget name, slug, template path,\nand attributes. The attributes structure depends on the widget type schema. Used for rendering widgets\nin pages and templates.","required":["name","slug","template","attributes"],"properties":{"name":{"type":"string"},"slug":{"type":"string"},"template":{"type":"string"},"attributes":{"type":"object","description":"Widget attributes (structure depends on widget type)","additionalProperties":true}}}}}}
```

## Retrieve widget schema

> Returns the widget type schema for the specified widget slug.

```json
{"openapi":"3.1.0","info":{"title":"CMS API - Content Management & Pages","version":"1.0.0"},"tags":[{"name":"Widgets","description":"Widget data and schema retrieval"}],"servers":[{"description":"Default commerce site","url":"https://{commerce_url}","variables":{"commerce_url":{"default":"sandbox.akinon.com","description":"Commerce storefront hostname"}}}],"paths":{"/widgets/{slug}/schema/":{"get":{"tags":["Widgets"],"operationId":"retrieveWidgetSchema","summary":"Retrieve widget schema","description":"Returns the widget type schema for the specified widget slug.","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"},"description":"Widget slug identifier"}],"responses":{"200":{"description":"Widget schema retrieved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WidgetType"}}}},"404":{"description":"Widget not found or has no widget type"}}}}},"components":{"schemas":{"WidgetType":{"type":"object","description":"Defines a widget type with its JSON schema for validating and configuring widget attributes.\nUsed to retrieve widget type information and understand what attributes a widget supports.\nThe schema defines the structure and validation rules for widget attributes.","required":["pk","name","schema"],"properties":{"pk":{"type":"integer"},"name":{"type":"string"},"schema":{"type":"object","description":"JSON schema defining widget attributes","additionalProperties":true}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://apidocs.akinon.com/commerce-openapis/cms/widgets.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
