> ## Documentation Index
> Fetch the complete documentation index at: https://widgetic.com/llms.txt
> Use this file to discover all available pages before exploring further.

# widgetic api widgets

> 4 commands for the Widgets operations of the REST API, generated from its OpenAPI description.

`widgetic api widgets <command>` runs the Widgets operations of the REST API. It has 4 commands. Every command also takes [the flags every command takes](https://widgetic.com/docs/cli/commands/index.md).

## `widgetic api widgets create-composition-from-widget`

Create a composition for a widget in one call

* Request: `POST /widgets/{id}/composition`
* Operation: `createCompositionFromWidget` (`widgetic api call createCompositionFromWidget` runs it by that name)
* Works with any API key.

| Flag | Takes | Required | What it does |
| - | - | - | - |
| `--id <uuid>` | uuid | yes | The widget id |
| `--idempotency-key <text>` | text | | Names this one request, so a repeat of it is carried out once. The CLI makes a key when this is left out and sends the same one on every try; give your own (a UUID is ideal) to repeat the call by hand later. |
| `--name <text>` | text | | |
| `--locale <text>` | text | | |
| `--managed-user-id <uuid>` | uuid | | |
| `--data <json\|@file\|->` | JSON, `@path` or `-` | | The whole request document as JSON, `@path` to a file that holds it, or `-` for standard input. The flags above override its keys. |

The whole description and the schemas: `widgetic schema api widgets create-composition-from-widget`.

## `widgetic api widgets create-widget`

Create Widget

* Request: `POST /widgets`
* Operation: `createWidget` (`widgetic api call createWidget` runs it by that name)
* Also written: `widgetic api widgets create`
* Works with any API key.

| Flag | Takes | Required | What it does |
| - | - | - | - |
| `--idempotency-key <text>` | text | | Names this one request, so a repeat of it is carried out once. The CLI makes a key when this is left out and sends the same one on every try; give your own (a UUID is ideal) to repeat the call by hand later. |
| `--name <text>` | text | | Name of the widget. |
| `--type <text>` | text | | What kind of widget this is, as a label of your choosing (for example chart, form, gallery). |
| `--is-public` | switch | | Whether the widget is public. (default: false) |
| `--is-draft` | switch | | Whether the widget starts as a draft. A widget created without this is a draft. (default: true) --no-is-draft turns it off. |
| `--canvas-id <uuid>` | uuid | | Put the widget on this existing canvas instead of a new one. You must own the canvas. |
| `--project-id <uuid>` | uuid | | Project to file the widget in. You must be able to edit the project. |
| `--organization-id <uuid>` | uuid | | Organization the widget belongs to. You must be a member who may create widgets there. |
| `--workspace-type <text>` | one of `personal`, `organization` | | Whether the widget lives in your personal workspace or in an organization's. |
| `--managed-user-id <uuid>` | uuid | | Make the widget for one of your managed users, by Widgetic's id for the user. Send this or `managedUserExternalId`, not both. The managed user must be yours and active. |
| `--managed-user-external-id <text>` | text | | The same, by your own identifier for the user, the `externalId` you gave when you created the managed user (answers show it as `externalId`). Send this or `managedUserId`, not both. |
| `--data <json\|@file\|->` | JSON, `@path` or `-` | | The whole request document as JSON, `@path` to a file that holds it, or `-` for standard input. The flags above override its keys. |

The whole description and the schemas: `widgetic schema api widgets create-widget`.

## `widgetic api widgets get-widgets`

List Widgets

* Request: `GET /widgets`
* Operation: `getWidgets` (`widgetic api call getWidgets` runs it by that name)
* Also written: `widgetic api widgets list`
* Works with any API key.

| Flag | Takes | Required | What it does |
| - | - | - | - |
| `--page <int>` | integer | | Page to return, counting from 1. Giving `page` or `size` turns paging on. |
| `--size <int>` | integer | | How many widgets a page holds (20 when `page` is given without it). Giving `page` or `size` turns paging on. |
| `--canvas-id <uuid>` | uuid | | List only the widgets on this canvas. The list is returned whole. |
| `--managed-user-id <uuid>` | uuid | | List only the widgets made for this managed user (Widgetic's id for the user). Send this or `managedUserExternalId`, not both. |
| `--managed-user-external-id <text>` | text | | List only the widgets made for the managed user you registered with this `externalId` (your own identifier for the user). Send this or `managedUserId`, not both. |

The whole description and the schemas: `widgetic schema api widgets get-widgets`.

## `widgetic api widgets get-widgets-batch`

Get Widgets Batch

* Request: `POST /widgets/batch`
* Operation: `getWidgetsBatch` (`widgetic api call getWidgetsBatch` runs it by that name)
* Works with any API key.

| Flag | Takes | Required | What it does |
| - | - | - | - |
| `--widget-ids <values...>` | list (repeat the flag) | | |
| `--data <json\|@file\|->` | JSON, `@path` or `-` | | The whole request document as JSON, `@path` to a file that holds it, or `-` for standard input. The flags above override its keys. |

The whole description and the schemas: `widgetic schema api widgets get-widgets-batch`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.