---
title: Unlock Users
slug: single-connect-api-3-2-0/unlock-users
description: Learn how to unlock user accounts by making a seamless POST request using cURL command. This document contains a code example featuring the essential headers and data payload to effortlessly carry out the process.
docTags: 
createdAt: 2022-11-10T14:24:52.000Z
---

{
  "id": "d9DEkk2TZGE5F_QmpL8Xc",
  "data": {
    "url": "{{url}}/aioc-rest-web/rest/user/unlockUsers/reasonToLockThem",
    "method": "POST",
    "request": {
      "pathParameters": [],
      "queryParameters": [],
      "headerParameters": [
        {
          "name": "Content-Type",
          "type": "string",
          "example": "application/json",
          "description": ""
        },
        {
          "name": "X-XSRF-TOKEN",
          "type": "string",
          "example": "{{csrftoken}}",
          "description": ""
        }
      ],
      "bodyDataParameters": [
        {
          "name": "body",
          "type": "string",
          "example": "[\"a177be61-8850-4f03-be1c-3ce275f02c1f\"]",
          "description": ""
        }
      ],
      "formDataParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Unlock Users",
        "jsonExample": "[\n    {\n        \"id\": \"a177be61-8850-4f03-be1c-3ce275f02c1f\",\n        \"eid\": \"testuser\",\n        \"personelId\": \"123123\",\n        \"name\": \"test\",\n        \"passwordAlgorithm\": \"MD5\",\n        \"password\": \"202cb962ac59075b964b07152d234b70\",\n        \"email\": \"test@test.com\",\n        \"surname\": \"user\",\n        \"internal\": true,\n        \"properties\": {\n            \"phoneNumber\": \"5550000000\",\n            \"ubaThreshold\": \"50\",\n            \"forcePasswordChangeOnNextLogin\": \"true\"\n        },\n        \"groups\": [\n            \"DEFAULT_GROUP_SYSYEM_ADMINS\",\n            \"DEFAULT_GROUP_SYSYEM_USERS\"\n        ],\n        \"managerGroups\": [],\n        \"lastLogin\": null,\n        \"lastLoginIp\": \"10.20.50.66\",\n        \"recordLimit4Search\": null,\n        \"passwordDirty\": false,\n        \"passwordAutoGenerated\": false,\n        \"phoneNumber\": \"5550000000\",\n        \"forceChangePasswordOnNextLogin\": true,\n        \"lockReason\": null,\n        \"unlockOnPasswordChanged\": false,\n        \"unlockTime\": null,\n        \"tempUserEndTime\": null,\n        \"tempUserStartTime\": null,\n        \"tempUser\": false,\n        \"externalDirectorySource\": null,\n        \"userPropertyKey4Search\": null,\n        \"userPropertyValue4Search\": null,\n        \"locked\": false\n    }\n]"
      }
    ],
    "contentType": "application/json",
    "description": "<p>This method activates a locked user in Single Connect.</p>\n<p>Enter the user id in \"Body\" field.</p>\n<p>Mutliple users can be unlocked at the same time. For this option, use comma separator for id of users.\nEx: [\"user1id\", \"user2id\", \"user3id\"]</p>",
    "examples": {
      "languages": [
        {
          "id": "lWH6vqUscV9_FzktTnkL2",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url {{url}}/aioc-rest-web/rest/user/unlockUsers/reasonToLockThem \\\n     --header 'accept: application/json'"
        },
        {
          "id": "iiPrxZRc5lbZbFBJMTWOL",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"{{url}}/aioc-rest-web/rest/user/unlockUsers/reasonToLockThem\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "eBkQsxsygr0qodSN8NEBF",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"net/http\"\n\nurl = URI(\"{{url}}/aioc-rest-web/rest/user/unlockUsers/reasonToLockThem\")\n\nhttp = Net::HTTP.new(url.host, url.port);\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "vJa7YKPanL807tknsKIgy",
          "language": "python",
          "label": "Python",
          "code": "import requests\n\nurl = \"{{url}}/aioc-rest-web/rest/user/unlockUsers/reasonToLockThem\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "lWH6vqUscV9_FzktTnkL2"
    },
    "results": {
      "languages": [
        {
          "id": "NGT15AIvxaCApl0dRZL5M",
          "language": "200",
          "code": "[\n    {\n        \"id\": \"a177be61-8850-4f03-be1c-3ce275f02c1f\",\n        \"eid\": \"testuser\",\n        \"personelId\": \"123123\",\n        \"name\": \"test\",\n        \"passwordAlgorithm\": \"MD5\",\n        \"password\": \"202cb962ac59075b964b07152d234b70\",\n        \"email\": \"test@test.com\",\n        \"surname\": \"user\",\n        \"internal\": true,\n        \"properties\": {\n            \"phoneNumber\": \"5550000000\",\n            \"ubaThreshold\": \"50\",\n            \"forcePasswordChangeOnNextLogin\": \"true\"\n        },\n        \"groups\": [\n            \"DEFAULT_GROUP_SYSYEM_ADMINS\",\n            \"DEFAULT_GROUP_SYSYEM_USERS\"\n        ],\n        \"managerGroups\": [],\n        \"lastLogin\": null,\n        \"lastLoginIp\": \"10.20.50.66\",\n        \"recordLimit4Search\": null,\n        \"passwordDirty\": false,\n        \"passwordAutoGenerated\": false,\n        \"phoneNumber\": \"5550000000\",\n        \"forceChangePasswordOnNextLogin\": true,\n        \"lockReason\": null,\n        \"unlockOnPasswordChanged\": false,\n        \"unlockTime\": null,\n        \"tempUserEndTime\": null,\n        \"tempUserStartTime\": null,\n        \"tempUser\": false,\n        \"externalDirectorySource\": null,\n        \"userPropertyKey4Search\": null,\n        \"userPropertyValue4Search\": null,\n        \"locked\": false\n    }\n]"
        }
      ],
      "selectedLanguageId": "NGT15AIvxaCApl0dRZL5M"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}