---
title: Create / Update User
slug: create-update-user
docTags: 
createdAt: 2026-10-08T08:29:29.588Z
---

{
  "id": "bpsmxo2EAgKpK6V_dBqIK",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://dev1.frontu.com//client/api/v2/users",
    "servers": [
      {
        "url": "https://dev1.frontu.com//client/api/v2/users"
      }
    ],
    "name": "Create / Update User",
    "description": "This endpoint allows to create or update users\n\nIf you want to update User using POST method you need to fill information for guid field or systemId field in request body.",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "optional",
          "name": "body",
          "type": "object",
          "description": "",
          "schema": [
            {
              "name": "email",
              "kind": "required",
              "type": "string",
              "description": "Email of the user"
            },
            {
              "name": "name",
              "kind": "required",
              "type": "string",
              "description": "Name of the user"
            },
            {
              "name": "surname",
              "kind": "required",
              "type": "string",
              "description": "Surname of the user"
            },
            {
              "name": "phone",
              "kind": "optional",
              "type": "string",
              "description": "Phone of the user"
            },
            {
              "name": "locale",
              "kind": "optional",
              "type": "string",
              "description": "<p>Two lowercase symbol string. If not set, default locale will be used.</p>"
            },
            {
              "name": "roles",
              "kind": "required",
              "type": "array",
              "description": "<p>Only 1 is allowed. ROLE_BACKEND - web user, ROLE_DEVICE - mobile app user, ROLE_MATE - mobile app helper user</p>",
              "example": "",
              "itemType": "string",
              "customType": "string[]",
              "itemExample": "",
              "itemDefault": ""
            },
            {
              "name": "permissionsGroup",
              "kind": "optional",
              "type": "string",
              "description": "<p>GUID or systemId of a web user permissions group. Only required for ROLE_BACKEND users.</p>"
            },
            {
              "name": "office",
              "kind": "required",
              "type": "string",
              "description": "GUID or systemId of an office"
            },
            {
              "name": "emailAuthEnabled",
              "kind": "optional",
              "type": "boolean",
              "description": "<p>If true, 2-factor authentication will be enabled for the user.</p>"
            },
            {
              "name": "systemId",
              "kind": "optional",
              "type": "string",
              "description": "Identifier from an external system"
            },
            {
              "name": "guid",
              "kind": "optional",
              "type": "string",
              "description": "Identifier from Frontu"
            },
            {
              "name": "sendPassword",
              "kind": "optional",
              "type": "boolean",
              "description": "<p>If true, password creation link will be sent to user email</p>"
            },
            {
              "name": "driverId",
              "kind": "optional",
              "type": "string",
              "description": "Identifier from an external system for fleet drivers"
            },
            {
              "name": "jobTitle",
              "kind": "optional",
              "type": "string",
              "description": "Job title of the user"
            },
            {
              "name": "deleted",
              "kind": "optional",
              "type": "boolean",
              "description": "<p>Edit-only flag to soft-delete or restore an existing user. Ignored when creating a new user.\nSet <code>true</code> to soft-delete the user (mirrors the admin delete action, including UserVoter checks).\nSet <code>false</code> to restore a previously soft-deleted user (mirrors the admin restore action).\nWhen the requested state matches the current state, the flag is a no-op.\nToggling this flag also flips the user's <code>enabled</code> state accordingly.</p>"
            }
          ],
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "Bearer",
          "name": "Authorization",
          "kind": "optional",
          "type": "apiKey",
          "description": "<p>Value: Bearer {access_token}</p>",
          "in": "header"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "201",
        "description": "Returned when successful",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "400",
        "description": "<p>Data contains errors, or the <code>deleted</code> transition was rejected by UserVoter.\nVoter rejection responses include one of: <code>user_has_tasks_error_message</code>,\n<code>user_delete_admin_error_message</code>, <code>user_is_deleted_error_message</code>,\n<code>user_no_permission_error_message</code>, <code>base_cannot_restore_error_message</code>.</p>",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "wgmPl6FxI1xqT_vFHDgAt",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://dev1.frontu.com//client/api/v2/users \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '{\n     \"email\": \"\",\n     \"name\": \"\",\n     \"surname\": \"\",\n     \"roles\": [],\n     \"office\": \"\"\n     }'"
        },
        {
          "id": "rP1H6FygrUHgCTRxw6_mn",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar raw = JSON.stringify({\n   \"email\": \"\",\n   \"name\": \"\",\n   \"surname\": \"\",\n   \"roles\": [],\n   \"office\": \"\"\n});\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"https://dev1.frontu.com//client/api/v2/users\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "xDvp-aggRcsuZvLfEM17s",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://dev1.frontu.com//client/api/v2/users\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest.body = JSON.dump({\n   \"email\": \"\",\n   \"name\": \"\",\n   \"surname\": \"\",\n   \"roles\": [],\n   \"office\": \"\"\n})\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "oxgVdL6UOwKiRemEreiqp",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://dev1.frontu.com//client/api/v2/users\"\n\npayload = json.dumps({\n   \"email\": \"\",\n   \"name\": \"\",\n   \"surname\": \"\",\n   \"roles\": [],\n   \"office\": \"\"\n})\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "wgmPl6FxI1xqT_vFHDgAt"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-201",
          "language": "201",
          "code": "// Returned when successful\n"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// Data contains errors, or the deleted transition was rejected by UserVoter.\nVoter rejection responses include one of: user_has_tasks_error_message,\nuser_delete_admin_error_message, user_is_deleted_error_message,\nuser_no_permission_error_message, base_cannot_restore_error_message.\n"
        }
      ],
      "selectedLanguageId": "response-0-201"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}