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

# Generate Subtasks

> Decompose a parent task into subtasks.

The SDK's :class:`GenerateSubtasksRequest` enforces that exactly
one of (``title``, ``parent_context``) is supplied, treating
whitespace-only strings as not-supplied. Pydantic runs that
validator when FastAPI parses the request body, so the handler
does not need to duplicate the check — a request that violates
the rule surfaces as 422 Unprocessable Entity.

Returns:
    Ordered list of proposed subtasks.



## OpenAPI

````yaml https://api.pragmatiks.io/openapi.json post /agents/assists/generate-subtasks
openapi: 3.1.0
info:
  title: Pragma API
  version: 0.1.0
servers: []
security: []
paths:
  /agents/assists/generate-subtasks:
    post:
      tags:
        - assists
      summary: Generate Subtasks
      description: |-
        Decompose a parent task into subtasks.

        The SDK's :class:`GenerateSubtasksRequest` enforces that exactly
        one of (``title``, ``parent_context``) is supplied, treating
        whitespace-only strings as not-supplied. Pydantic runs that
        validator when FastAPI parses the request body, so the handler
        does not need to duplicate the check — a request that violates
        the rule surfaces as 422 Unprocessable Entity.

        Returns:
            Ordered list of proposed subtasks.
      operationId: assists-generate_subtasks
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenerateSubtasksRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenerateSubtasksResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    GenerateSubtasksRequest:
      properties:
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        parent_context:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent Context
      type: object
      title: GenerateSubtasksRequest
      description: |-
        Request body for the ``generate-subtasks`` assist.

        Two mutually exclusive modes are supported:

        * **New task mode** — supply ``title`` (with optional ``description``)
          to generate subtasks for a proposed work item that does not yet
          exist on the board.
        * **Existing task mode** — supply ``parent_context`` (the body of
          an already-created parent task) to generate subtasks beneath it.

        Exactly one mode must be used per request: omit both fields and
        there is nothing to seed the assist with; provide both and the
        intended parent is ambiguous.

        Attributes:
            title: Title of the proposed work item, for new-task mode.
            description: Detailed description of the proposed work item,
                paired with ``title`` in new-task mode.
            parent_context: Body of an already-created parent task, for
                existing-task mode.
    GenerateSubtasksResponse:
      properties:
        subtasks:
          items:
            $ref: '#/components/schemas/ProposedSubtask'
          type: array
          title: Subtasks
      type: object
      required:
        - subtasks
      title: GenerateSubtasksResponse
      description: |-
        Response body for the ``generate-subtasks`` assist.

        Attributes:
            subtasks: Ordered list of proposed subtasks for the caller
                to review before persisting.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ProposedSubtask:
      properties:
        title:
          type: string
          title: Title
        description:
          type: string
          title: Description
        priority:
          type: integer
          maximum: 4
          minimum: 1
          title: Priority
      type: object
      required:
        - title
        - description
        - priority
      title: ProposedSubtask
      description: |-
        A single subtask proposed by the ``generate-subtasks`` assist.

        Attributes:
            title: Suggested subtask title.
            description: Suggested subtask description.
            priority: Priority level (1=urgent, 2=high, 3=normal, 4=low).
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````