application/json

Body Required

Widget to create

  • name string Required
  • description string Required

Responses

  • 201 application/json

    Created

    Hide response attributes Show response attributes object
    • data array | object Required

      The response data. This can be an array or an object, depending on the endpoint.

    • data object

      This is a widget. It has a name and a description. It can be used to demonstrate the use of components.

      Additional properties are NOT allowed.

      Hide data attributes Show data attributes object
      • id string(uuid)
      • created_at string(date-time)
      • updated_at string(date-time)
  • 400 application/problem+json

    Bad Request

    Hide response attributes Show response attributes object
    • title string
    • detail string
    • code string
    • errors object
      Hide errors attribute Show errors attribute object
      • * string Additional properties
POST /api/widgets
curl \
 --request POST 'http://localhost/api/widgets' \
 --header "Content-Type: application/json" \
 --data '{"name":"Goblin Staff of Sparks","description":"This staff is made of wood and has a small gemstone at the top. It crackles with electricity.\n"}'
Request examples
{
  "name": "Goblin Staff of Sparks",
  "description": "This staff is made of wood and has a small gemstone at the top. It crackles with electricity.\n"
}
Response examples (201)
{
  "data": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "created_at": "2026-05-04T09:42:00Z",
    "updated_at": "2026-05-04T09:42:00Z"
  },
  "links": {}
}
Response examples (400)
{
  "title": "string",
  "detail": "string",
  "code": "string",
  "errors": {
    "additionalProperty1": "string",
    "additionalProperty2": "string"
  }
}