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

# Get Task Messages

> Get all messages for a task.



## OpenAPI

````yaml /openapi.json get /api/tasks/{task_id}/messages
openapi: 3.1.0
info:
  description: >-
    Public CodeCobra API. Authenticate by sending a personal API key in the
    `Authorization: Bearer <key>` header. Generate keys from Settings → API keys
    in the CodeCobra dashboard.
  title: CodeCobra Public API
  version: 1.0.0
servers: []
security: []
paths:
  /api/tasks/{task_id}/messages:
    get:
      tags:
        - public
      summary: Get Task Messages
      description: Get all messages for a task.
      operationId: get_task_messages_api_tasks__task_id__messages_get
      parameters:
        - in: path
          name: task_id
          required: true
          schema:
            format: uuid
            title: Task Id
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/TaskMessageResponse'
                title: Response Get Task Messages Api Tasks  Task Id  Messages Get
                type: array
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - HTTPBearer: []
components:
  schemas:
    TaskMessageResponse:
      properties:
        attachments:
          default: []
          items:
            $ref: '#/components/schemas/TaskAttachmentResponse'
          title: Attachments
          type: array
        content:
          title: Content
          type: string
        created_at:
          format: date-time
          title: Created At
          type: string
        has_plan:
          default: false
          title: Has Plan
          type: boolean
        id:
          format: uuid
          title: Id
          type: string
        is_streaming:
          default: false
          title: Is Streaming
          type: boolean
        kind:
          default: chat
          title: Kind
          type: string
        last_event_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Event Id
        plan_version:
          anyOf:
            - type: integer
            - type: 'null'
          title: Plan Version
        role:
          title: Role
          type: string
        task_id:
          format: uuid
          title: Task Id
          type: string
        tool_calls:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Tool Calls
        user_email:
          anyOf:
            - type: string
            - type: 'null'
          title: User Email
        user_id:
          format: uuid
          title: User Id
          type: string
        user_name:
          anyOf:
            - type: string
            - type: 'null'
          title: User Name
      required:
        - id
        - task_id
        - user_id
        - role
        - content
        - created_at
      title: TaskMessageResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    TaskAttachmentResponse:
      properties:
        created_at:
          format: date-time
          title: Created At
          type: string
        filename:
          title: Filename
          type: string
        id:
          format: uuid
          title: Id
          type: string
        mime_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Mime Type
        size_bytes:
          title: Size Bytes
          type: integer
        task_id:
          format: uuid
          title: Task Id
          type: string
      required:
        - id
        - task_id
        - filename
        - size_bytes
        - created_at
      title: TaskAttachmentResponse
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    HTTPBearer:
      scheme: bearer
      type: http

````