> ## Documentation Index
> Fetch the complete documentation index at: https://direct-api.reap.global/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a widget



## OpenAPI

````yaml /openapi.example.json post /v1/widgets
openapi: 3.0.0
info:
  title: Reap Direct API (Example)
  version: 1.0.0
  description: >-
    EXAMPLE ONLY — placeholder CRUD endpoints so the docs pipeline can be
    previewed before the first real public endpoints ship. Delete this file and
    point docs.json at the live /openapi.json once real endpoints exist.
servers:
  - url: https://api.direct.reap.global
security:
  - apiKey: []
tags:
  - name: Widgets (example)
    description: A fake resource demonstrating how generated endpoint pages will look.
paths:
  /v1/widgets:
    post:
      tags:
        - Widgets (example)
      summary: Create a widget
      operationId: createWidget
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWidgetRequest'
      responses:
        '201':
          description: The created widget.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Widget'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    CreateWidgetRequest:
      type: object
      required:
        - name
      properties:
        name:
          type: string
          maxLength: 100
          description: Display name.
          example: My first widget
        metadata:
          type: object
          additionalProperties:
            type: string
          description: Free-form key/value metadata.
    Widget:
      type: object
      required:
        - id
        - name
        - status
        - createdAt
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier.
          example: 3f6f4d1e-8a2b-4c1d-9e5f-0a1b2c3d4e5f
        name:
          type: string
          description: Display name.
          example: My first widget
        status:
          type: string
          enum:
            - active
            - archived
          description: Lifecycle status.
          example: active
        metadata:
          type: object
          additionalProperties:
            type: string
          description: Free-form key/value metadata.
        createdAt:
          type: string
          format: date-time
          description: Creation timestamp (ISO 8601).
          example: '2026-07-09T03:00:00Z'
    ErrorResponse:
      type: object
      required:
        - statusCode
        - type
        - message
      properties:
        statusCode:
          type: integer
          description: HTTP status code.
        type:
          type: string
          enum:
            - INVALID_REQUEST_ERROR
            - AUTHENTICATION_ERROR
            - PERMISSION_ERROR
            - RATE_LIMIT_ERROR
            - API_ERROR
            - UPSTREAM_ERROR
          description: Coarse error category; always present.
        code:
          type: string
          description: Stable machine code; present for actionable errors.
        message:
          type: string
          description: Human-readable explanation.
        param:
          type: string
          description: Offending field for validation errors.
        details:
          description: Structured extra context (e.g. validation issues).
          anyOf:
            - type: array
              items:
                type: object
                additionalProperties: {}
            - type: object
              additionalProperties: {}
        requestId:
          type: string
          description: Correlation id for support.
  responses:
    BadRequest:
      description: The request is malformed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Forbidden:
      description: The API key lacks the required scope.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    UnprocessableEntity:
      description: The request is well-formed but semantically invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalError:
      description: Unexpected server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: Enter your API key

````