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

# Apply Command Editor Draft Route

> Apply an approved command editor draft.



## OpenAPI

````yaml https://analyst.heyhumm.ai/api/openapi.json post /commands/{command_id}/editor/draft/{draft_id}/apply
openapi: 3.1.0
info:
  title: Analyst API
  description: API for the Analyst service with proper organization-scoped permissions
  version: 1.0.0
servers:
  - url: https://analyst.heyhumm.ai
security: []
paths:
  /commands/{command_id}/editor/draft/{draft_id}/apply:
    post:
      tags:
        - commands
      summary: Apply Command Editor Draft Route
      description: Apply an approved command editor draft.
      operationId: >-
        apply_command_editor_draft_route_commands__command_id__editor_draft__draft_id__apply_post
      parameters:
        - name: draft_id
          in: path
          required: true
          schema:
            type: string
            title: Draft Id
        - name: command_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            description: Command ID
            title: Command Id
          description: Command ID
        - name: organization_id
          in: query
          required: true
          schema:
            type: string
            title: Organization Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommandEditorDraft'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    CommandEditorDraft:
      properties:
        schema_version:
          type: string
          title: Schema Version
          default: v1
        draft_id:
          type: string
          title: Draft Id
        organization_id:
          type: string
          title: Organization Id
        command_id:
          type: string
          title: Command Id
        status:
          type: string
          enum:
            - draft
            - applied
          title: Status
          default: draft
        messages:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Messages
        base_command:
          $ref: '#/components/schemas/CommandEditorSnapshot'
        proposed_command:
          anyOf:
            - $ref: '#/components/schemas/CommandEditorSnapshot'
            - type: 'null'
        change_summary:
          anyOf:
            - type: string
            - type: 'null'
          title: Change Summary
        diff_message_index:
          anyOf:
            - type: integer
            - type: 'null'
          title: Diff Message Index
        diff_history:
          items:
            $ref: '#/components/schemas/CommandEditorDiffSnapshot'
          type: array
          title: Diff History
        warnings:
          items:
            type: string
          type: array
          title: Warnings
        approvable:
          type: boolean
          title: Approvable
          default: false
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        applied_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Applied At
      type: object
      required:
        - draft_id
        - organization_id
        - command_id
        - base_command
      title: CommandEditorDraft
      description: Persisted state for one command editor chat thread.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CommandEditorSnapshot:
      properties:
        name:
          type: string
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        content:
          type: string
          title: Content
        current_version:
          type: integer
          title: Current Version
        updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updated At
      type: object
      required:
        - name
        - content
        - current_version
      title: CommandEditorSnapshot
      description: Command fields captured for diffing and stale-version checks.
    CommandEditorDiffSnapshot:
      properties:
        message_index:
          type: integer
          title: Message Index
        summary:
          anyOf:
            - type: string
            - type: 'null'
          title: Summary
        fields:
          items:
            $ref: '#/components/schemas/CommandEditorDiffField'
          type: array
          title: Fields
      type: object
      required:
        - message_index
      title: CommandEditorDiffSnapshot
      description: A persisted diff attached to a specific assistant message.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    CommandEditorDiffField:
      properties:
        field:
          type: string
          enum:
            - name
            - description
            - content
          title: Field
        before:
          type: string
          title: Before
        after:
          type: string
          title: After
      type: object
      required:
        - field
        - before
        - after
      title: CommandEditorDiffField
      description: One changed command field captured for persisted diff rendering.
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````