# User

## Get a list of users.

<mark style="color:blue;">`GET`</mark> `https://api.halosecurity.com/api/v1/user/list.json`

Returns a paginated list of users. Requires `account_user` permission.

Learn about permissions: [Permissions](/api/readme/permissions.md)

<https://app.halosecurity.com/user/account/users>

#### Query Parameters

| Name       | Type    | Description                                                     |
| ---------- | ------- | --------------------------------------------------------------- |
| sort       | Integer | <p><code>0</code></p><p>= email (default)</p>                   |
| sort\_desc | Integer | <p><code>0</code> = No (default)</p><p><code>1</code> = Yes</p> |
| email      | String  | Filter by email                                                 |
| name       | String  | Filter by name                                                  |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    "list": [
        {
            "role": 3,
            "user_id": 1,
            "phone": "1-000-000-0000",
            "last_name": "Doe",
            "title": "CEO",
            "first_name": "Jon",
            "email": "jon@example.com"
        }
    ]
}
```

{% endtab %}
{% endtabs %}

## Get the details of a user.

<mark style="color:blue;">`GET`</mark> `https://api.halosecurity.com/api/v1/user/get.json`

Returns the details of a user. If not `me`, requires `account_user` permission.

Learn about permissions: [Permissions](/api/readme/permissions.md)

<https://app.halosecurity.com/user/account/users>

#### Query Parameters

| Name                                       | Type    | Description |
| ------------------------------------------ | ------- | ----------- |
| user\_id<mark style="color:red;">\*</mark> | Integer |             |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    "user": {
        "role": 3,
        "user_id": 1,
        "phone": "1-000-000-0000",
        "last_name": "Smith",
        "title": "CEO",
        "first_name": "Jon",
        "email": "jon@example.com"
    }
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```javascript
{
    "code": 0,
    "message": "user_id required"
}
```

{% endtab %}

{% tab title="404: Not Found " %}

```javascript
{
    "code": 0,
    "message": "user not found"
}
```

{% endtab %}
{% endtabs %}

## Get the details of me.

<mark style="color:blue;">`GET`</mark> `https://api.halosecurity.com/api/v1/user/me.json`

Returns the details of me.

<https://app.halosecurity.com/user/account/users>

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    "user": {
        "role": 1,
        "user_id": 1,
        "phone": "1-000-000-0000",
        "last_name": "Smith",
        "title": "CEO",
        "first_name": "Jon",
        "email": "jon@example.com"
    }
}
```

{% endtab %}
{% endtabs %}

## Update the details of a user.

<mark style="color:blue;">`GET`</mark> `https://api.halosecurity.com/api/v1/user/update.json`

If not `me`, requires `account_user` permission.

Learn about permissions: [Permissions](/api/readme/permissions.md)

<https://app.halosecurity.com/user/account/users>

#### Query Parameters

| Name                                       | Type    | Description |
| ------------------------------------------ | ------- | ----------- |
| user\_id<mark style="color:red;">\*</mark> | Integer |             |
| first\_name                                | String  |             |
| last\_name                                 | String  |             |
| title                                      | String  |             |
| phone                                      | String  |             |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    "success": 1
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```javascript
{
    "code": 0,
    "message": "user_id required"
}
```

{% endtab %}

{% tab title="404: Not Found " %}

```javascript
{
    "code": 0,
    "message": "user not found"
}
```

{% endtab %}
{% endtabs %}

## Invite a new user.

<mark style="color:blue;">`GET`</mark> `https://api.halosecurity.com/api/v1/user/invite.json`

Requires `account_user` permission.

Learn about permissions: [Permissions](/api/readme/permissions.md)

<https://app.halosecurity.com/user/account/add-user>

#### Query Parameters

| Name                                    | Type    | Description |
| --------------------------------------- | ------- | ----------- |
| email<mark style="color:red;">\*</mark> | String  |             |
| role<mark style="color:red;">\*</mark>  | Integer |             |
| first\_name                             | String  |             |
| last\_name                              | String  |             |
| phone                                   | Integer |             |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    "success": 1
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```javascript
{
    "code": 0,
    "message": "email required"
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```javascript
{
    "code": 0,
    "message": "role required"
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```javascript
{
    "code": 0,
    "message": "email not valid"
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.halosecurity.com/api/endpoints/user.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
