---
agentTools:
  projectIndex: https://docs.cancergenomicscloud.org/llms.txt
---

# Abort a task

/tasks/{task_id}/actions/abort

This call aborts the specified task. Only tasks whose status is `"RUNNING"` or `"QUEUED"` may be aborted.

[block:code]
{
  "codes": [
    {
      "code": "https://cgc-api.sbgenomics.com/v2/tasks/{task_id}/actions/abort",
      "language": "text",
      "name": "Path"
    }
  ]
}
[/block]

\##Request

\###Example request

[block:code]
{
  "codes": [
    {
      "code": "POST /v2/tasks/dec3eda6-152b-4601-22ec-82bc9d58bdb6/actions/abort\" HTTP/1.1\nHost: cgc-api.sbgenomics.com\nX-SBG-Auth-Token: 3210a98c1db9318fa9d9273156740f74",
      "language": "http",
      "name": null
    },
    {
      "code": "curl  -s -H \"X-SBG-Auth-Token: 3210a98c1db9318fa9d9273156740f74\" -H \"content-type: application/json\" -X POST \"https://cgc-api.sbgenomics.com/v2/tasks/dec3eda6-152b-4601-22ec-82bc9d58bdb6/actions/abort\"",
      "language": "curl",
      "name": "cURL"
    }
  ],
  "sidebar": true
}
[/block]

\###Header Fields

[block:parameters]
{
  "data": {
    "h-0": "Name",
    "h-1": "Description",
    "0-0": "`X-SBG-Auth-Token`\n_required_",
    "0-1": "Your Seven Bridges Platform [authentication token](https://docs.cancergenomicscloud.org/docs/get-your-authentication-token).",
    "h-2": ""
  },
  "cols": 2,
  "rows": 1
}
[/block]

\###Path parameters

[block:parameters]
{
  "data": {
    "0-0": "`task_id`",
    "h-0": "Name",
    "h-1": "Description",
    "0-1": "The ID of the task you are acting on."
  },
  "cols": 2,
  "rows": 1
}
[/block]

\###Query parameters

[block:parameters]
{
  "data": {
    "h-0": "Name",
    "h-1": "Data type",
    "h-2": "Description",
    "0-0": "`fields`",
    "0-1": "string",
    "0-2": "Selector specifying a subset of fields to include in the response."
  },
  "cols": 3,
  "rows": 1
}
[/block]

\##Response

[See a list of Seven Bridges Platform-specific response codes that may be contained in the body of the response.](https://docs.cancergenomicscloud.org/docs/api-status-codes)

\###Example response body

[block:code]
{
  "codes": [
    {
      "code": "{\n  \"href\": \"https://cgc-api.sbgenomics.com/v2/tasks/dec3eda6-152b-4601-22ec-82bc9d58bdb6\",\n  \"id\": \"dec3eda6-152b-4601-22ec-82bc9d58bdb6\",\n  \"name\": \"Workflow run - 11-15-15 15:56:11\",\n  \"status\": \"Active\",\n  \"project\": \"RFranklin/my-project\",\n  \"app\": \"RFranklin/my-project/workflow/1\",\n  \"created_by\": \"RFranklin\",\n  \"executed_by\": \"Kate\",\n  \"start_time\": \"2015-11-15T15:56:11Z\",\n  \"inputs\": {\n    \"my_hardcoded_string\": {\n      \"schema\": [\n        \"null\",\n        \"string\"\n      ],\n      \"value\": null,\n      \"errors\": null,\n      \"files\": null,\n      \"missing_files\": null\n    }\n  }\n}",
      "language": "json"
    }
  ],
  "sidebar": true
}
[/block]