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

> Stop a running task.

The body is optional. Omit it, or send `"force": false`, for a graceful stop. `"force": true` cancels immediately.


## OpenAPI

````yaml api-reference/openapi.json POST /experimental/tasks/{task_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}/cancel:
    post:
      tags:
        - tasks
      summary: Cancel a task
      description: Stop a running task.
      operationId: cancel_task_experimental_tasks__task_id__cancel_post
      parameters:
        - name: task_id
          in: path
          required: true
          schema:
            type: string
            title: Task Id
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CancelTaskRequest'
              default:
                force: false
            examples:
              graceful:
                summary: Graceful — let the agent stop at a safe point (default)
                value: {}
              force:
                summary: Force — stop immediately
                value:
                  force: true
      responses:
        '200':
          description: Cancel accepted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskStatusAck'
              example:
                type: task_status
                id: tsk_014MUnN99MEVcklVXXfFbxXb
                status: cancelled
      security:
        - bearerAuth: []
components:
  schemas:
    CancelTaskRequest:
      properties:
        force:
          type: boolean
          title: Force
          default: false
      additionalProperties: false
      type: object
      title: CancelTaskRequest
      description: Omit the body for a graceful cancel.
    TaskStatusAck:
      properties:
        type:
          type: string
          const: task_status
          title: Type
          default: task_status
        id:
          type: string
          title: Id
        status:
          type: string
          const: cancelled
          title: Status
      type: object
      required:
        - id
        - status
      title: TaskStatusAck
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Requires an API key. See the Authentication guide.

````