# List users

`GET https://api.mothership.com/beta/users`

Sandbox: `https://sandbox.api.mothership.com/beta/users`

Lists the active users in your organization, sorted by first name, one page at a time. Suspended users are left out. Requires the `organization:user.read` permission.

## Authorization

Send your API token as a Bearer token: `Authorization: Bearer <token>`.

## Query parameters

- `page` (integer, optional, default 1, min 1): Page to return, starting at 1.
- `perPage` (integer, optional, default 25, min 1, max 100): Maximum number of users returned for each page.

## Responses

### 200

The page of users is wrapped inside an object named "data"

- `data` (object, required)
  - `results` (array of objects, required)
    - `id` (string, required): ID of the user.
    - `email` (string, required): Email address the user signs in with.
    - `firstName` (string, required)
    - `lastName` (string, required)
    - `role` (string, required, nullable): The highest role the user holds in the organization. `owner` can't be granted through the API. One of: `owner`, `manager`, `accountant`, `shipper`, `viewer`.
    - `status` (string, required): `active` users can sign in. Suspending a user through this API sets `inactive`. `suspended` means Mothership suspended the account, and it can't be changed through the API. One of: `active`, `inactive`, `suspended`.
  - `page` (integer, required, min 1): Current page of users.
  - `perPage` (integer, required, min 1): Maximum number of users returned for each page.
  - `total` (integer, required, min 0): Number of users across every page.
  - `hasMore` (boolean, required): True if more users can be fetched from a subsequent page.

## Example request

```bash
curl --request GET \
  --url 'https://sandbox.api.mothership.com/beta/users' \
  --header "Authorization: Bearer $MOTHERSHIP_API_TOKEN" \
  --header 'Accept: application/json'
```

## Example response (200)

```json
{
  "data": {
    "results": [
      {
        "id": "3f1c2a9e-5b7d-4e8a-9c61-2d4f8b0e7a15",
        "email": "logistics@example.com",
        "firstName": "Dana",
        "lastName": "Reyes",
        "role": "owner",
        "status": "active"
      }
    ],
    "page": 1,
    "perPage": 25,
    "total": 1,
    "hasMore": true
  }
}
```