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

# List messages

> See the full back-and-forth of a Task — everything you asked and everything the agent replied, in order.

Your messages come back as `role: "user"` and the agent's as `role: "assistant"`.
Each agent reply is a single message whose `content[]` holds the whole reply
(text, tool calls, results); a reply still in progress shows `status: "streaming"`
with the content so far.

**Paging.** `limit` (default 200, max 500) caps how much underlying detail is
pulled — one agent reply is assembled from many small rows, so you get back far
fewer messages than `limit`. When `has_more` is `true`, older detail was
omitted: request the same `limit` with `offset` set to the returned `next_offset`
to walk back through the history.


## OpenAPI

````yaml api-reference/openapi.json GET /messages
openapi: 3.1.0
info:
  title: Biomni Public API — V0
  description: >-
    The public API for **Biomni** — the AI agent platform for clinical genomics
    (variant annotation, ClinVar lookups, PMID-cited literature, and project
    file drives). Create projects and Tasks, send messages to the agent, stream
    its replies, manage files, and check your usage — all from your own code.


    **Authentication**: send `Authorization: Bearer <your-api-key>`. The adapter
    forwards your key straight to Biomni; it never stores it.


    **Safe retries**: send `Idempotency-Key: <token>` on POST endpoints
    (`/projects`, `/tasks`, `/messages`, `/files/uploads`) so a retried request
    won't create a duplicate.
  version: 0.1.0
servers:
  - url: https://api.phylo.bio/api/v1
security: []
paths:
  /messages:
    get:
      tags:
        - messages
      summary: List messages
      description: >-
        See the full back-and-forth of a Task — everything you asked and
        everything the agent replied, in order.
      operationId: list_messages_messages_get
      parameters:
        - name: task_id
          in: query
          required: true
          schema:
            type: string
            title: Task Id
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 500
            minimum: 1
            default: 200
            title: Limit
        - name: offset
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            default: 0
            title: Offset
      responses:
        '200':
          description: Aggregated message list. Alternates user/assistant.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageList'
              example:
                object: list
                data:
                  - id: msg_a4f9b5cc30d8
                    object: message
                    task_id: sess_d9711ec9b477
                    created: 1779132780
                    role: user
                    content:
                      - type: text
                        text: >-
                          I'm a clinical genomics analyst working up Patient001.
                          There are 3 BRCA1 pathogenic-flagged variants in the
                          attached VCF. For each variant: describe ClinVar
                          significance, flag PARP inhibitor eligibility, note
                          any conflicts in the literature. Cite ClinVar VCV/RCV
                          IDs and PMIDs.
                    metadata: {}
                    platform: api
                  - id: msg_1a0ef0fa8e26
                    object: message
                    task_id: sess_d9711ec9b477
                    created: 1779132785
                    role: assistant
                    status: completed
                    completed_at: 1779133414
                    content:
                      - type: text
                        text: >-
                          Loaded the genetic-variant-annotation skill. For these
                          3 BRCA1 variants I'll (1) query ClinVar's REST API
                          directly for each rsID to get current assertions,
                          review status, star ratings, and conditions, and (2)
                          cross-reference NCBI's ClinVar records for conflicting
                          submissions and literature PMIDs.
                      - type: tool_use
                        id: toolu_01RkjLRcNtbVHBBwWDDk7gmF
                        name: Skill
                        input:
                          action: load
                          name: genetic-variant-annotation
                      - type: tool_result
                        tool_use_id: toolu_01RkjLRcNtbVHBBwWDDk7gmF
                        content: >-
                          # Skill: genetic-variant-annotation


                          **Category**: genomics_genetics


                          **Description**: Annotate genomic variants in VCF
                          files with functional effects, clinical significance,
                          and pathogenicity predictions. … (truncated)
                      - type: text
                        text: >-
                          Here is the full structured report. Two deliverables
                          are saved: `report_Patient001_BRCA1_variants.md` and
                          `Patient001_BRCA1_variant_report.json`. All three
                          variants are confirmed pathogenic by ClinVar (3-star
                          review); PARP inhibitor eligibility applies for HBOC
                          and ovarian indications. … (truncated; real response
                          has 61 content blocks)
                    metadata: {}
                    platform: api
                    input:
                      user_message_id: msg_a4f9b5cc30d8
                      file_ids: []
                has_more: false
                total: 2
      security:
        - bearerAuth: []
components:
  schemas:
    MessageList:
      properties:
        object:
          type: string
          const: list
          title: Object
          default: list
        data:
          items:
            $ref: '#/components/schemas/Message'
          type: array
          title: Data
        has_more:
          type: boolean
          title: Has More
          default: false
        total:
          type: integer
          title: Total
      type: object
      required:
        - data
        - total
      title: MessageList
    Message:
      properties:
        id:
          type: string
          title: Id
        object:
          type: string
          const: message
          title: Object
          default: message
        task_id:
          type: string
          title: Task Id
        created:
          type: integer
          title: Created
        role:
          type: string
          enum:
            - user
            - assistant
            - system
          title: Role
        content:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Content
        finish_reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Finish Reason
        status:
          anyOf:
            - type: string
              enum:
                - pending
                - streaming
                - completed
                - cancelling
                - cancelled
                - failed
            - type: 'null'
          title: Status
        stop_reason:
          anyOf:
            - type: string
              enum:
                - stop
                - length
                - cancelled
                - error
            - type: 'null'
          title: Stop Reason
        started_at:
          anyOf:
            - type: integer
            - type: 'null'
          title: Started At
        completed_at:
          anyOf:
            - type: integer
            - type: 'null'
          title: Completed At
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
        metadata:
          additionalProperties: true
          type: object
          title: Metadata
        platform:
          type: string
          enum:
            - api
            - mcp
            - web
            - desktop
            - mobile
          title: Platform
          default: api
        input:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Input
        output:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Output
        _links:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Links
      type: object
      required:
        - id
        - task_id
        - created
        - role
        - content
      title: Message
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Requires an API key. See the Authentication guide.

````