---
title: "User"
description: "<p>Manage user accounts, roles, and passwords.</p>"
url: "https://www.contentstack.com/docs/developers/apis/lytics-api/user"
product: "Contentstack"
doc_type: "guide"
audience:
  - developers
  - admins
version: "current"
last_updated: "2026-11-05"
---

# User

Manage user accounts, roles, and passwords.

## Get users

### Get users

**GET** `/v2/user`

Get a list of all users for the account

#### Query Parameters

- **account_id** (optional)
  The account ID. Defaults to the user's default account.

#### Headers

- **Authorization** (optional)

#### Sample Response

```json
{
  "_meta": {},
  "data": [
    {
      "accounts": [
        {
          "account_id": "string",
          "aid": 0,
          "auth0_connections": [
            "string"
          ],
          "created": "2019-08-24T14:15:22Z",
          "expiration": "2019-08-24T14:15:22Z",
          "granted_by": "string",
          "login_method_allowed": true,
          "name": "string",
          "reason": "string",
          "roles": [
            "string"
          ],
          "updated": "2019-08-24T14:15:22Z"
        }
      ],
      "aid": 0,
      "auth_type": "password",
      "authtoken": "string",
      "authy_id": "string",
      "cellphone": "string",
      "cookie": "string",
      "country_code": "string",
      "created": "2019-08-24T14:15:22Z",
      "email": "string",
      "email_verified": "2019-08-24T14:15:22Z",
      "has_2fa_session": true,
      "id": "string",
      "last_logon": "2019-08-24T14:15:22Z",
      "last_pwd_change": "2019-08-24T14:15:22Z",
      "name": "string",
      "needs_2fa": true,
      "organization_id": "string",
      "updated": "2019-08-24T14:15:22Z"
    }
  ],
  "request_id": "string",
  "status": 0
}
```

## Reset password

### Reset password

**POST** `/v2/user/me/passwordreset`

Update a user's password

#### Query Parameters

- **account_id** (optional)
  The account ID. Defaults to the user's default account.

#### Headers

- **Authorization** (optional)

#### Sample Response

```json
{
  "_meta": {},
  "data": {
    "accounts": [
      {
        "account_id": "string",
        "aid": 0,
        "auth0_connections": [
          "string"
        ],
        "created": "2019-08-24T14:15:22Z",
        "expiration": "2019-08-24T14:15:22Z",
        "granted_by": "string",
        "login_method_allowed": true,
        "name": "string",
        "reason": "string",
        "roles": [
          "string"
        ],
        "updated": "2019-08-24T14:15:22Z"
      }
    ],
    "aid": 0,
    "auth_type": "password",
    "authtoken": "string",
    "authy_id": "string",
    "cellphone": "string",
    "cookie": "string",
    "country_code": "string",
    "created": "2019-08-24T14:15:22Z",
    "email": "string",
    "email_verified": "2019-08-24T14:15:22Z",
    "has_2fa_session": true,
    "id": "string",
    "last_logon": "2019-08-24T14:15:22Z",
    "last_pwd_change": "2019-08-24T14:15:22Z",
    "name": "string",
    "needs_2fa": true,
    "organization_id": "string",
    "updated": "2019-08-24T14:15:22Z"
  },
  "request_id": "string",
  "status": 0
}
```

## Get user

### Get user

**GET** `/v2/user/{id}`

Get a user by ID, email address, or the special value me (returns the authenticated user).

#### URL Parameters

- **id** (required)
  User ID, email address, or 'me'

#### Query Parameters

- **account_id** (optional)
  The account ID. Defaults to the user's default account.
- **include_expired_accounts** (optional)
  Include accounts whose access has expired. Defaults to false.

#### Headers

- **Authorization** (optional)

#### Sample Response

```json
{
  "_meta": {},
  "data": {
    "accounts": [
      {
        "account_id": "string",
        "aid": 0,
        "auth0_connections": [
          "string"
        ],
        "created": "2019-08-24T14:15:22Z",
        "expiration": "2019-08-24T14:15:22Z",
        "granted_by": "string",
        "login_method_allowed": true,
        "name": "string",
        "reason": "string",
        "roles": [
          "string"
        ],
        "updated": "2019-08-24T14:15:22Z"
      }
    ],
    "aid": 0,
    "auth_type": "password",
    "authtoken": "string",
    "authy_id": "string",
    "cellphone": "string",
    "cookie": "string",
    "country_code": "string",
    "created": "2019-08-24T14:15:22Z",
    "email": "string",
    "email_verified": "2019-08-24T14:15:22Z",
    "has_2fa_session": true,
    "id": "string",
    "last_logon": "2019-08-24T14:15:22Z",
    "last_pwd_change": "2019-08-24T14:15:22Z",
    "name": "string",
    "needs_2fa": true,
    "organization_id": "string",
    "updated": "2019-08-24T14:15:22Z"
  },
  "request_id": "string",
  "status": 0
}
```

## Delete user

### Delete user

**DELETE** `/v2/user/{id}`

Remove a user's access to the account. If the user has no remaining account roles after removal, the user record is deleted entirely.

#### URL Parameters

- **id** (required)
  User ID or email address

#### Query Parameters

- **account_id** (optional)
  The account ID. Defaults to the user's default account.

#### Headers

- **Authorization** (optional)

#### Sample Response

```json
No Content
```

## Update user roles

### Update user roles

**POST** `/v2/user/{id}/roles`

Replace all account roles for a user with the provided list. The body is a bare JSON array of role names, not an object, and it replaces every role the user has on the account, e.g. \["admin","auth\_alerts"\].

#### URL Parameters

- **id** (required)
  User ID or email address

#### Query Parameters

- **account_id** (optional)
  The account ID. Defaults to the user's default account.

#### Headers

- **Authorization** (optional)

#### Sample Response

```json
{
  "_meta": {},
  "data": {
    "accounts": [
      {
        "account_id": "string",
        "aid": 0,
        "auth0_connections": [
          "string"
        ],
        "created": "2019-08-24T14:15:22Z",
        "expiration": "2019-08-24T14:15:22Z",
        "granted_by": "string",
        "login_method_allowed": true,
        "name": "string",
        "reason": "string",
        "roles": [
          "string"
        ],
        "updated": "2019-08-24T14:15:22Z"
      }
    ],
    "aid": 0,
    "auth_type": "password",
    "authtoken": "string",
    "authy_id": "string",
    "cellphone": "string",
    "cookie": "string",
    "country_code": "string",
    "created": "2019-08-24T14:15:22Z",
    "email": "string",
    "email_verified": "2019-08-24T14:15:22Z",
    "has_2fa_session": true,
    "id": "string",
    "last_logon": "2019-08-24T14:15:22Z",
    "last_pwd_change": "2019-08-24T14:15:22Z",
    "name": "string",
    "needs_2fa": true,
    "organization_id": "string",
    "updated": "2019-08-24T14:15:22Z"
  },
  "request_id": "string",
  "status": 0
}
```