> ## 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.

# Cancel a reply

> Stop the agent while it is writing this reply.

Cancels the task the message belongs to, since the agent works on one reply at a time. Equivalent to `POST /tasks/{task_id}/cancel`.


## OpenAPI

````yaml api-reference/openapi.json POST /experimental/tasks/{task_id}/messages/{message_id}/cancel
openapi: 3.1.0
info:
  title: Phylo API — V1
  description: Public API for Phylo, the biomedical AI agent platform.
  version: 0.1.0
servers:
  - url: https://api.phylo.bio/v1
    description: >-
      Self-serve platform. Enterprise customers should contact the Phylo team to
      get their API base URL. Learn more at https://phylo.bio/enterprise.
security: []
paths:
  /experimental/tasks/{task_id}/messages/{message_id}/cancel:
    post:
      tags:
        - messages
      summary: Cancel a reply
      description: Stop the agent while it is writing this reply.
      operationId: >-
        cancel_message_experimental_tasks__task_id__messages__message_id__cancel_post
      parameters:
        - name: message_id
          in: path
          required: true
          schema:
            type: string
            title: Message Id
        - name: task_id
          in: path
          required: true
          schema:
            type: string
            title: Task Id
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CancelMessageRequest'
              default:
                force: false
            examples:
              graceful:
                summary: Graceful — settles at `cancelling` then `cancelled` (default)
                value: {}
              force:
                summary: Force — settles at `cancelled` immediately
                value:
                  force: true
      responses:
        '200':
          description: Cancel accepted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageStatusAck'
              examples:
                graceful:
                  summary: Graceful cancel — settles at `cancelling` then `cancelled`
                  value:
                    type: message_status
                    id: msg_1a0ef0fa8e26
                    status: cancelling
                force:
                  summary: Force cancel — settles immediately
                  value:
                    type: message_status
                    id: msg_1a0ef0fa8e26
                    status: cancelled
      security:
        - bearerAuth: []
components:
  schemas:
    CancelMessageRequest:
      properties:
        force:
          type: boolean
          title: Force
          default: false
      additionalProperties: false
      type: object
      title: CancelMessageRequest
      description: Omit the body for a graceful cancel.
    MessageStatusAck:
      properties:
        type:
          type: string
          const: message_status
          title: Type
          default: message_status
        id:
          type: string
          title: Id
        status:
          type: string
          enum:
            - cancelling
            - cancelled
            - backgrounded
          title: Status
      type: object
      required:
        - id
        - status
      title: MessageStatusAck
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Requires an API key. See the Authentication guide.

````