<!-- Generated by scripts/build-docs.js. Edit docs/swagger.yaml or docs/guides/, then run `npm run docs:build`. -->

# List users

`GET https://marketplace-api.sequifi.com/v1/users`

Module: Users · operationId: `listUsers` · Auth: `Authorization: Bearer <token>`
Web page: https://apidocs.sequifi.com/#/api/list-users

Returns your company's employees (reps, managers and admins), newest first, with their office, position, manager, recruiter, onboarding state and home address. Use it for roster syncs and to find the user `id` every other user endpoint needs. Users of every status are returned unless you pass `status`, and the list includes one system user named "Marketplace API" that you should skip.

**Filtering and paging:**

- All filters are optional and combine with AND. Any other query parameter returns `400`.
- `first_name`, `last_name`, `full_name`, `email` and `employee_id` are case-insensitive "contains" matches, not exact lookups: `employee_id=12` also matches `EMP120`. `%` and `_` in a value act as wildcards. To find one person, filter by `email`, then compare the address exactly on your side.
- `full_name` matches "first last" with one space. Middle names are not part of it.
- `status=active` returns users whose `status_id` is `1`; `status=inactive` returns every other status. Users with no status at all appear only when you leave `status` out.
- `is_manager` takes `0` or `1`. Any other value is ignored and the list comes back unfiltered.
- `status` and `onboarding_complete` sent with an empty value count as not sent.
- `per_page` is 1 to 200 (default 20). `page` starts at 1. A page past the end returns an empty `users` array, and `last_page` is `0` when nothing matches.
- Results are ordered by `id`, newest first, with offset paging. Users added while you page can shift later pages by a row, so de-duplicate by `id`.

**Optional fields:**

- Add `include=additional_offices` to return current Additional Office assignments. The field is omitted by default.

**Formats:**

- `created_at` and `updated_at` are ISO 8601 UTC strings, for example `2024-01-15T10:00:00.000Z`. `dob` is `YYYY-MM-DD` or `null`.
- Home address fields are `null` until the rep completes the profile step of onboarding. `home_address` is the formatted single line; the other `home_address_*` fields are its parts and use the same names `POST /v1/users` accepts.
- `position_id` is the primary position. `sub_position_id` is the position in effect today in your company's time zone. They can differ.
- `hiring_status_id` and `hiring_status_name` come from the rep's latest hiring record (`7` = still completing self-onboarding, `14` = finished). They are `null` for users added without going through hiring, for example by import. Your company can rename statuses, so branch on the id.
- `onboarding_complete` is `1` once the rep has finished every required self-onboarding step (documents, banking details and profile), otherwise `0`.
- `wages_status` is `1` when the rep's position pays wages (hourly or salary). It is a position setting, not a per-person flag.
- `requestedBy` is the name of the API credential your token belongs to, not necessarily your company name.

**Errors:**

- `400` `Invalid query parameter(s)`, with `invalid_params` and `allowed_params` in `data`.
- `400` for a bad `page`, `per_page`, `status` or `onboarding_complete` value (see the examples).
- `400` for an unsupported or empty `include` value.
- `401` when the token is missing, malformed, expired or revoked. It is rejected before the request is processed, so the body is only `{"message":"Unauthorized"}`, with no `status` or `data`.
- `500` if requested Additional Offices cannot be looked up; retry according to Errors and retries. A missing assignments table returns `[]`.

**Common mistakes:**

- Treating a name, email or `employee_id` filter as an exact match.
- Forgetting that terminated and dismissed users are included unless you pass `status=active`.
- Importing the "Marketplace API" system user (email `marketplace-api@system.sequifi.com`). Skip it by email.

**Related:**

- `GET /v1/users/{id}` returns one user.
- `GET /v1/locations` and `GET /v1/positions` resolve `office_id`, `position_id` and `sub_position_id`.

## Query parameters

- `include` (string): Request optional Additional Office assignments. Omit to leave additional_offices out of the response. One of: `additional_offices`. Example: `additional_offices`.
- `page` (integer): Page number, starting at 1. Must be a positive whole number. Default: `1`. Minimum: 1. Example: `1`.
- `per_page` (integer): Users per page, 1 to 200. Default: `20`. Minimum: 1. Maximum: 200. Example: `20`.
- `first_name` (string): Case-insensitive "contains" match on first name. Example: `Alex`.
- `last_name` (string): Case-insensitive "contains" match on last name. Example: `Morgan`.
- `full_name` (string): Case-insensitive "contains" match on "first last" (one space, no middle name). Example: `Alex Morgan`.
- `email` (string): Case-insensitive "contains" match on email. Compare the result exactly on your side before treating it as the same person. Example: `alex.morgan@example.com`.
- `employee_id` (string): Case-insensitive "contains" match on your company's employee number. Example: `EMP-1042`.
- `is_manager` (integer): `1` for managers only, `0` for non-managers only. Any other value is ignored (no filter). One of: `0`, `1`. Example: `1`.
- `status` (string): `active` (`status_id` is 1) or `inactive` (any other status). Not case-sensitive. Leave it out for every status. One of: `active`, `inactive`. Example: `active`.
- `onboarding_complete` (integer): `1` for reps who finished every required self-onboarding step, `0` for reps still onboarding. Leave it out for both. One of: `0`, `1`. Example: `1`.

## Example request

```bash
curl -X GET "https://marketplace-api.sequifi.com/v1/users" \
  -H "Authorization: Bearer $SEQUIFI_TOKEN"
```

## Responses

### 200: A page of users

- `status` (integer): The HTTP status code, repeated. Example: `200`.
- `message` (string): Short text. Wording varies by endpoint; branch on the HTTP status, not on this text. Example: `success`.
- `data` (object)
  - `requestedBy` (string): Name of the API credential your token belongs to.
  - `current_page` (integer): The page returned.
  - `per_page` (integer): Page size used.
  - `total` (integer): Users matching the filters, across all pages.
  - `last_page` (integer): Number of the last page. 0 when nothing matches.
  - `filters` (object, nullable): The filters applied (trimmed), or null when none were sent.
  - `users` (array of object): Users on this page, newest first.
    - `id` (integer): User id. Every other user endpoint takes this id.
    - `employee_id` (string, nullable): Your company's own employee number.
    - `first_name` (string): First name.
    - `last_name` (string): Last name.
    - `email` (string): Email address.
    - `mobile_no` (string, nullable): Mobile number as stored. The format is not normalized.
    - `dob` (string (date), nullable): Date of birth, YYYY-MM-DD.
    - `home_address` (string, nullable): Formatted single-line home address. Null until the rep completes the profile step of onboarding.
    - `home_address_line_1` (string, nullable): Street line.
    - `home_address_line_2` (string, nullable): Apartment or suite line. Usually null.
    - `home_address_city` (string, nullable): City.
    - `home_address_state` (string, nullable): State, normally a 2-letter code.
    - `home_address_zip` (string, nullable): ZIP code.
    - `is_manager` (integer): 1 if the user is a manager. One of: `0`, `1`.
    - `status_id` (integer, nullable): Employment status. 1 is active; any other value is inactive (a dismissal through `POST /v1/users/termination` sets 2).
    - `worker_type` (string, nullable): Worker type, such as `1099` or `w2`. Compare case-insensitively.
    - `office_id` (integer, nullable): Current office. See `GET /v1/locations`.
    - `office_name` (string, nullable): Name of the current office.
    - `state_id` (integer, nullable): Work state id (not the home state).
    - `state_code` (string, nullable): Work state code, for example `TX`.
    - `city_id` (integer, nullable): Work city id.
    - `position_id` (integer, nullable): Primary position. See `GET /v1/positions`.
    - `position_name` (string, nullable): Name of the primary position.
    - `sub_position_id` (integer, nullable): Position in effect today in your company's time zone. Can differ from `position_id`.
    - `sub_position_name` (string, nullable): Name of the position in effect today in your company's time zone.
    - `wages_status` (integer): 1 when the rep's position pays wages (hourly or salary). A position setting, not a per-person flag. One of: `0`, `1`.
    - `onboarding_complete` (integer): 1 once every required self-onboarding step (documents, banking details, profile) is done. One of: `0`, `1`.
    - `hiring_status_id` (integer, nullable): Status of the rep's latest hiring record (7 = still completing self-onboarding, 14 = finished). Null when the user was not hired through hiring.
    - `hiring_status_name` (string, nullable): Label for `hiring_status_id`. Your company can rename it; use it for display only.
    - `onboarding_step_name` (string, nullable): The self-onboarding step the rep is on, using the names on the Onboarding page: `Not Started` (never logged in), `Personal Details`, `Tax + Banking Info`, `Tax Info`, `Banking Info` or `Documents`. The steps a rep sees depend on your payroll setup and their worker type. Set only while `hiring_status_id` is `7`, otherwise `null`. Refreshed every 15 minutes, so it can lag the Onboarding page by up to 15 minutes.
    - `onboarding_step_updated_at` (string, nullable): When `onboarding_step_name` last changed (company database time). `null` when `onboarding_step_name` is `null`.
    - `employee_personal_detail` (array of object): Your company's custom personal fields for this user. Null when none are stored.
      - `id` (integer): Custom field id from `GET /v1/custom-fields?type=employee`.
      - `field_name` (string, nullable): Field label.
      - `field_type` (string, nullable): Field type, for example `text`, `date` or `dropdown`.
      - `value` (any, nullable): Stored value, usually a string.
    - `employee_admin_only_fields` (array of object): Custom fields only admins can edit. Same item shape as `employee_personal_detail`. Write with `POST /v1/users`.
      - `id` (integer): Custom field id.
      - `field_name` (string, nullable): Field label.
      - `field_type` (string, nullable): Field type.
      - `value` (any, nullable): Stored value, usually a string.
    - `manager` (object, nullable): The user's manager, or null.
      - `id` (integer): Manager's user id.
      - `first_name` (string): First name.
      - `last_name` (string): Last name.
      - `email` (string): Email address.
    - `recruiter` (object, nullable): The user's recruiter, or null. Same fields as `manager`.
      - `id` (integer): Recruiter's user id.
      - `first_name` (string): First name.
      - `last_name` (string): Last name.
      - `email` (string): Email address.
    - `additional_offices` (array of object): Only returned with `include=additional_offices`. The user's current Additional Office assignments, the same set the user's profile page shows under Employment Package, except that assignments to archived offices are left out. Current means started on or before today and not ended before today; when an office has more than one current assignment, only the newest is returned. One entry per office, ordered by office name. `[]` when the user has none or the tenant has no assignments table. Other lookup failures return 500. Override pay for these offices is not included. "Today" means today in your company's time zone.
      - `office_id` (integer): Office id. See `GET /v1/locations`.
      - `office_name` (string, nullable): Office name.
      - `state_id` (integer, nullable): State id of the assignment.
      - `state_code` (string, nullable): State code, for example `TX`.
      - `effective_date` (string (date), nullable): Date the assignment started, YYYY-MM-DD. Null only for legacy records stored with a zero date.
      - `effective_end_date` (string (date), nullable): Last day of the assignment, YYYY-MM-DD, or null when it has no end date.
    - `created_at` (string (date-time)): When the user was created, ISO 8601 UTC.
    - `updated_at` (string (date-time)): When the user was last changed, ISO 8601 UTC.

Example (active_users): Active users (status=active, include=additional_offices)

```json
{
  "status": 200,
  "message": "success",
  "data": {
    "requestedBy": "acme",
    "current_page": 1,
    "per_page": 20,
    "total": 23,
    "last_page": 2,
    "filters": {
      "status": "active"
    },
    "users": [
      {
        "id": 4821,
        "employee_id": "EMP-1042",
        "first_name": "Alex",
        "last_name": "Morgan",
        "email": "alex.morgan@example.com",
        "dob": "1990-01-15",
        "mobile_no": "5125550142",
        "is_manager": 0,
        "status_id": 1,
        "worker_type": "1099",
        "office_id": 31,
        "home_address": "1200 Congress Ave, Austin, TX 78701, USA",
        "home_address_line_1": "1200 Congress Ave",
        "home_address_line_2": null,
        "home_address_city": "Austin",
        "home_address_state": "TX",
        "home_address_zip": "78701",
        "state_id": 44,
        "city_id": 1207,
        "created_at": "2024-01-15T10:00:00.000Z",
        "updated_at": "2026-06-01T08:30:00.000Z",
        "employee_personal_detail": [
          {
            "id": 2,
            "field_name": "Preferred first name",
            "field_type": "text",
            "value": "Alex"
          }
        ],
        "employee_admin_only_fields": null,
        "state_code": "TX",
        "office_name": "Austin",
        "wages_status": 0,
        "onboarding_complete": 1,
        "hiring_status_id": 14,
        "hiring_status_name": "Active",
        "onboarding_step_name": null,
        "onboarding_step_updated_at": null,
        "position_id": 4,
        "position_name": "Sales Rep",
        "sub_position_id": 12,
        "sub_position_name": "Senior Sales Rep",
        "manager": {
          "id": 87,
          "first_name": "Jordan",
          "last_name": "Lee",
          "email": "jordan.lee@example.com"
        },
        "recruiter": {
          "id": 55,
          "first_name": "Taylor",
          "last_name": "Brooks",
          "email": "taylor.brooks@example.com"
        },
        "additional_offices": [
          {
            "office_id": 12,
            "office_name": "Dallas",
            "state_id": 44,
            "state_code": "TX",
            "effective_date": "2026-03-01",
            "effective_end_date": null
          }
        ]
      }
    ]
  }
}
```

### 400: Unknown query parameter or invalid filter value

Example (unknown_param): Unknown query parameter

```json
{
  "status": 400,
  "message": "Invalid query parameter(s)",
  "data": {
    "invalid_params": [
      "first"
    ],
    "allowed_params": [
      "first_name",
      "last_name",
      "full_name",
      "email",
      "employee_id",
      "is_manager",
      "status",
      "onboarding_complete",
      "page",
      "per_page"
    ]
  }
}
```

### 401: Missing, malformed, expired or revoked token. Rejected before processing, so the body has only `message`.

```json
{
  "message": "Unauthorized"
}
```

### 500: Internal server error

```json
{
  "status": 500,
  "message": "Internal Server Error",
  "data": {}
}
```
