Widgets

Create widget

Create a new widget.

POST /api/v2/widgets Try It

Create widget

cURL
curl -X POST "https://api.example.com/v2/widgets" \
     -H "Authorization: Bearer your-api-token" \
     -H "Accept: application/json" \
     -H "Content-Type: application/json" \
     -d '{"name":"My first widget","quantity":12}'
201 application/json
{
  "id": "wdg_abc123",
  "name": "My first widget",
  "quantity": 12,
  "created_at": "2026-05-11T09:30:00Z"
}

Create a new widget.

Heads up: v2 does not support the colour field. Use v3 if you need to set widget colours.

Headers

  • Authorization string required header

    Bearer your-api-token

  • Accept string required header

    application/json

  • Content-Type string required header

    application/json

Body parameters

  • name string required body

    Human-readable name for the widget.

  • quantity integer body

    Number of units. Defaults to 1.

Response codes

HTTP status
  • 201

    Widget created.

  • 400

    Bad Request — missing required fields.

  • 401

    Unauthorized — invalid or missing API token.