---
title: Update task
slug: api-guide/update-task
docTags: 
createdAt: 2025-01-21T17:10:09.351Z
---

{
  "id": "sPkr8GJdk70RhUQgB4BOA",
  "type": "api-oas-v2",
  "data": {
    "method": "PATCH",
    "url": "https://api.app.kognic.com/v1/tasks/{taskId}",
    "servers": [
      {
        "url": "https://api.app.kognic.com/v1/tasks/{taskId}"
      }
    ],
    "name": "Update task",
    "description": "<p>Update a task: (re)assign or unassign it, and/or pause or resume its active assignment.</p>\n<p>Error responses:</p>\n<ul>\n<li>400 Bad Request: the task cannot be updated in its current state (e.g. already ongoing or completed, not pausable/resumable, too many paused tasks, or the acting user is in idle/retention training mode).</li>\n<li>403 Forbidden: the caller is not allowed to assign/unassign this task.</li>\n<li>404 Not Found: the task, or the target user in the request, does not exist.</li>\n</ul>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "taskId",
          "type": "string<uuid>",
          "description": "",
          "format": "uuid"
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "",
          "customType": "UpdateTask",
          "schema": [
            {
              "name": "assignedUserId",
              "kind": "optional",
              "type": "integer<int64>",
              "description": "",
              "format": "int64"
            },
            {
              "name": "pause",
              "kind": "optional",
              "type": "object",
              "description": "",
              "modelRef": "#/components/schemas/PauseTask",
              "customType": "PauseTask",
              "schema": [
                {
                  "name": "issueDescription",
                  "kind": "required",
                  "type": "string",
                  "description": ""
                }
              ]
            }
          ],
          "modelRef": "#/components/schemas/UpdateTask",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "400",
        "description": "Bad request",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "BadRequest",
            "schema": [
              {
                "name": "errorCode",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "message",
                "kind": "required",
                "type": "string",
                "description": ""
              }
            ],
            "modelRef": "#/components/schemas/BadRequest",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "403",
        "description": "Forbidden",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "Forbidden",
            "schema": [
              {
                "name": "message",
                "kind": "required",
                "type": "string",
                "description": ""
              }
            ],
            "modelRef": "#/components/schemas/Forbidden",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "404",
        "description": "Not found",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "NotFound",
            "schema": [
              {
                "name": "message",
                "kind": "required",
                "type": "string",
                "description": ""
              }
            ],
            "modelRef": "#/components/schemas/NotFound",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "-OKFl9H5TUaT2cfXVU5Q7",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.app.kognic.com/v1/tasks/{taskId}\"\n\npayload = json.dumps({\n   \"pause\": {\n      \"issueDescription\": \"\"\n   }\n})\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"PATCH\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "-OKFl9H5TUaT2cfXVU5Q7"
    },
    "results": {
      "languages": [
        {
          "id": "HyBfHEpy5Lx6sTa6tYlTw",
          "language": "200",
          "code": ""
        },
        {
          "id": "PfYgeVVjDBXYwK1bqwFGF",
          "language": "400",
          "code": "// Bad request\n{\n  \"errorCode\": \"\",\n  \"message\": \"\"\n}"
        },
        {
          "id": "6AOgf7PhggUwubmCPMDHI",
          "language": "403",
          "code": "// Forbidden\n{\n  \"message\": \"\"\n}"
        },
        {
          "id": "7i8TPPafuXeK8Z26B8JhA",
          "language": "404",
          "code": "// Not found\n{\n  \"message\": \"\"\n}"
        }
      ],
      "selectedLanguageId": "HyBfHEpy5Lx6sTa6tYlTw"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}