---
title: Update user
slug: api-guide/update-user
docTags: 
createdAt: 2025-01-16T08:06:24.215Z
---

{
  "id": "qzJgLnOHYq3kY1lR2eEYs",
  "type": "api-oas-v2",
  "data": {
    "method": "PATCH",
    "url": "https://api.app.kognic.com/v2/users/{userId}",
    "servers": [
      {
        "url": "https://api.app.kognic.com/v2/users/{userId}"
      }
    ],
    "name": "Update user",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "userId",
          "type": "integer<int64>",
          "description": "",
          "format": "int64"
        }
      ],
      "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": "UpdateUser",
          "schema": [
            {
              "name": "firstName",
              "kind": "optional",
              "type": "string",
              "description": ""
            },
            {
              "name": "lastName",
              "kind": "optional",
              "type": "string",
              "description": ""
            },
            {
              "name": "roleIds",
              "kind": "optional",
              "type": "array",
              "description": "",
              "example": "",
              "itemType": "string",
              "customType": "string[]",
              "itemExample": "",
              "itemDefault": ""
            }
          ],
          "modelRef": "#/components/schemas/UpdateUser",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "204",
        "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": "401",
        "description": "Unauthorized",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "Unauthorized",
            "schema": [
              {
                "name": "message",
                "kind": "required",
                "type": "string",
                "description": ""
              }
            ],
            "modelRef": "#/components/schemas/Unauthorized",
            "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": "AQ-qUCpvK_Cadt74aXAhn",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.app.kognic.com/v2/users/{userId}\"\n\npayload = {}\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": "AQ-qUCpvK_Cadt74aXAhn"
    },
    "results": {
      "languages": [
        {
          "id": "akpGZmLU9hIaXnIbJR1-R",
          "language": "204",
          "code": ""
        },
        {
          "id": "PJXWmurnJxmsaHgWJUH8F",
          "language": "400",
          "code": "// Bad request\n{\n  \"errorCode\": \"\",\n  \"message\": \"\"\n}"
        },
        {
          "id": "pyUvvvM4AAe6XfCjjzbM6",
          "language": "401",
          "code": "// Unauthorized\n{\n  \"message\": \"\"\n}"
        },
        {
          "id": "kznmjOr-Jj64ECGbvIdM-",
          "language": "403",
          "code": "// Forbidden\n{\n  \"message\": \"\"\n}"
        },
        {
          "id": "N7Mcn6-BQ5TM6kdz_KpSk",
          "language": "404",
          "code": "// Not found\n{\n  \"message\": \"\"\n}"
        }
      ],
      "selectedLanguageId": "akpGZmLU9hIaXnIbJR1-R"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}