# Unlock a User from Account Lockout Policy

import DocButton from '~/components/webkit/DocButton.vue';
import Tag from '~/components/webkit/Tag.vue';

<Tag severity="info">Preview</Tag>

When a user is blocked by the account lockout policy, the *Account Owner* can manually unlock the access. Only recommended for exceptional or urgent cases.

This guide walks you through manually unlocking a user from the  Account Lockout Policy and guarantee access. 

<DocButton href="/en/documentation/products/accounts/account-lockout-policy/" label="Go to Account Lockout Policy reference" kind="secondary" target="_blank" size="medium" />

---

## Manually unlock a user

:::note
To manually unlock a user, you must have *Account Owner* privileges.

If you aren't an *Account Owner* or if the account doesn't have the policy activated, the system returns an *Error 403*.
:::

To manually unlock a user, you need to [get the logs](/en/documentation/products/guides/account-lockout-policy-logs/) and confirm the data about the user. Then, execute the unlocking. To do so:

1. Run the following `GET` request in your terminal to retrieve the data of blocked users.

```bash
curl --request GET \
  --url https://api.azion.com/v4/identity/users?locked=true \
  --header 'Accept: application/json' \
  --header 'Authorization: 123'
```

2. You'll receive a response similar to this:

```bash
{
  "count": 2,
  "results": [
    {
      "id": 1,
      ...
      "lockout": {
        "locked_at": "20240101T10:20:01",
        "unlock_at": "20240102T10:20:01",
      }
    }
  ]
}
```

Where:

| Key | Description |
| ----------- | ----------- |
| `count` | Represents the number of blocked user accounts. Example: `2` |
| `id` | Represents the unique identifier for a user |
| `lockout` | Integer | Represents the period during which the user account will be blocked, with `locked_at` being the timestamp for the start and `unlock_at` indicating when the lockout will end |

3. Save the ID of the user you want to unlock.
4. Run the following `DELETE` request in your terminal, replacing `{id}` with the user ID you retrieved in the previous steps, to unlock the specific user.

```bash
curl --request DELETE \
  --url https://api.azion.com/v4/identity/users/{id}/lockout \
  --header 'Accept: application/json' \
  --header 'Authorization: 123' \
  --header 'Content-Type: application/json'
```

5. You'll receive a response similar to this:

```bash
{
  "status": "executed"
}
```

Done. The user was unlocked and now is available to log in again. 

:::tip
Check the [Azion API documentation](https://api.azion.com/) to know more about all features available via API.
:::