---
title: "Filter users"
method: POST
path: "/users/filter"
tags: ["Users"]
---

# Filter users

`POST /users/filter`

Filter users using comprehensive query criteria with AND/OR logic and multiple operators.
Supports complex filtering similar to GraphQL capabilities.
Note: Soft-deleted users are excluded by default (deletedAt defaults to { isNull: true }).

## Request body

- UserFilterRequest — Request body for filtering users
  - `filter` UserFilter — Filter criteria for users with AND/OR logic support
    - `and` UserFilter[] — All conditions must match (recursive)
    - `or` UserFilter[] — At least one condition must match (recursive)
    - `not` UserFilter — recursive
    - `id` IDFilter — Filter options for ID fields (limited operations - exact match only)
      - `equalTo` string, uuid — Exact match
      - `in` string[] — Matches any UUID in the array
    - `email` StringFilter — Filter options for string fields
      - `equalTo` string — Exact match
      - `notEqualTo` string — Not equal to
      - `in` string[] — Matches any value in the array
      - `notIn` string[] — Does not match any value in the array
      - `includes` string — Contains substring (case-insensitive)
      - `notIncludes` string — Does not contain substring (case-insensitive)
      - `startsWith` string — Starts with prefix (case-insensitive)
      - `notStartsWith` string — Does not start with prefix (case-insensitive)
      - `endsWith` string — Ends with suffix (case-insensitive)
      - `notEndsWith` string — Does not end with suffix (case-insensitive)
      - `isNull` boolean — Field is null (true) or not null (false)
    - `name` StringFilter — Filter options for string fields
      - `equalTo` string — Exact match
      - `notEqualTo` string — Not equal to
      - `in` string[] — Matches any value in the array
      - `notIn` string[] — Does not match any value in the array
      - `includes` string — Contains substring (case-insensitive)
      - `notIncludes` string — Does not contain substring (case-insensitive)
      - `startsWith` string — Starts with prefix (case-insensitive)
      - `notStartsWith` string — Does not start with prefix (case-insensitive)
      - `endsWith` string — Ends with suffix (case-insensitive)
      - `notEndsWith` string — Does not end with suffix (case-insensitive)
      - `isNull` boolean — Field is null (true) or not null (false)
    - `phone` StringFilter — Filter options for string fields
      - `equalTo` string — Exact match
      - `notEqualTo` string — Not equal to
      - `in` string[] — Matches any value in the array
      - `notIn` string[] — Does not match any value in the array
      - `includes` string — Contains substring (case-insensitive)
      - `notIncludes` string — Does not contain substring (case-insensitive)
      - `startsWith` string — Starts with prefix (case-insensitive)
      - `notStartsWith` string — Does not start with prefix (case-insensitive)
      - `endsWith` string — Ends with suffix (case-insensitive)
      - `notEndsWith` string — Does not end with suffix (case-insensitive)
      - `isNull` boolean — Field is null (true) or not null (false)
    - `status` UserStatusFilter — Filter options for UserStatus enum
      - `equalTo` 'PENDING' | 'ACTIVE' | 'INACTIVE' — User account status: - `PENDING`: User invited but has not completed onboarding - `ACTIVE`: User account is active and can access the system - `INACTIVE`: User account is deactivated
      - `notEqualTo` 'PENDING' | 'ACTIVE' | 'INACTIVE' — User account status: - `PENDING`: User invited but has not completed onboarding - `ACTIVE`: User account is active and can access the system - `INACTIVE`: User account is deactivated
      - `in` UserStatus[] — Matches any value in the array
      - `notIn` UserStatus[] — Does not match any value in the array
      - `isNull` boolean — Field is null (true) or not null (false)
    - `roles` UserRoleFilter — Filter options for UserRole enum array
      - `contains` 'CUSTOMER_REP' | 'CARRIER_REP' | 'AR_AP' | 'COMPLIANCE' | 'MANAGER' | 'ADMIN' — User role within the organization: - `CUSTOMER_REP`: Customer service representative - `CARRIER_REP`: Carrier service representative - `AR_AP`: Accounts receivable/payable - `COMPLIANCE`: Compliance officer - `ADMIN`: System administrator
      - `containsAll` UserRole[] — Array contains all of these roles
      - `containsAny` UserRole[] — Array contains at least one of these roles
      - `isNull` boolean — Field is null (true) or not null (false)
    - `key` ClientKeyFilter — Filter options for client key fields (limited operations - exact match only)
      - `equalTo` string — Exact match
      - `in` string[] — Matches any value in the array
      - `isNull` boolean — Field is null (true) or not null (false)
    - `datUsername` StringFilter — Filter options for string fields
      - `equalTo` string — Exact match
      - `notEqualTo` string — Not equal to
      - `in` string[] — Matches any value in the array
      - `notIn` string[] — Does not match any value in the array
      - `includes` string — Contains substring (case-insensitive)
      - `notIncludes` string — Does not contain substring (case-insensitive)
      - `startsWith` string — Starts with prefix (case-insensitive)
      - `notStartsWith` string — Does not start with prefix (case-insensitive)
      - `endsWith` string — Ends with suffix (case-insensitive)
      - `notEndsWith` string — Does not end with suffix (case-insensitive)
      - `isNull` boolean — Field is null (true) or not null (false)
    - `mcpUsername` StringFilter — Filter options for string fields
      - `equalTo` string — Exact match
      - `notEqualTo` string — Not equal to
      - `in` string[] — Matches any value in the array
      - `notIn` string[] — Does not match any value in the array
      - `includes` string — Contains substring (case-insensitive)
      - `notIncludes` string — Does not contain substring (case-insensitive)
      - `startsWith` string — Starts with prefix (case-insensitive)
      - `notStartsWith` string — Does not start with prefix (case-insensitive)
      - `endsWith` string — Ends with suffix (case-insensitive)
      - `notEndsWith` string — Does not end with suffix (case-insensitive)
      - `isNull` boolean — Field is null (true) or not null (false)
    - `avatarId` UUIDFilter — Filter options for UUID fields (all operations)
      - `equalTo` string, uuid — Exact match
      - `notEqualTo` string, uuid — Not equal to
      - `in` string[] — Matches any UUID in the array
      - `notIn` string[] — Does not match any UUID in the array
      - `isNull` boolean — Field is null (true) or not null (false)
    - `createdAt` DatetimeFilter — Filter options for datetime fields
      - `equalTo` string, date-time — Exact match
      - `notEqualTo` string, date-time — Not equal to
      - `lessThan` string, date-time — Before this datetime
      - `lessThanOrEqualTo` string, date-time — On or before this datetime
      - `greaterThan` string, date-time — After this datetime
      - `greaterThanOrEqualTo` string, date-time — On or after this datetime
      - `isNull` boolean — Field is null (true) or not null (false)
    - `updatedAt` DatetimeFilter — Filter options for datetime fields
      - `equalTo` string, date-time — Exact match
      - `notEqualTo` string, date-time — Not equal to
      - `lessThan` string, date-time — Before this datetime
      - `lessThanOrEqualTo` string, date-time — On or before this datetime
      - `greaterThan` string, date-time — After this datetime
      - `greaterThanOrEqualTo` string, date-time — On or after this datetime
      - `isNull` boolean — Field is null (true) or not null (false)
    - `deletedAt` DatetimeFilter — Filter options for datetime fields
      - `equalTo` string, date-time — Exact match
      - `notEqualTo` string, date-time — Not equal to
      - `lessThan` string, date-time — Before this datetime
      - `lessThanOrEqualTo` string, date-time — On or before this datetime
      - `greaterThan` string, date-time — After this datetime
      - `greaterThanOrEqualTo` string, date-time — On or after this datetime
      - `isNull` boolean — Field is null (true) or not null (false)
  - `pageSize` integer — Number of results per page
  - `cursor` string — Pagination cursor for next page

## Response `200`

Successful response

- object
  - `data` User[]
    - `object` 'USER' — Object type identifier
    - `id` string, uuid, required — Unique user identifier
    - `email` string, email, required — User's email address
    - `name` string, nullable — User's full name
    - `phone` string, nullable — User's phone number
    - `phoneExt` string, nullable — Phone extension
    - `status` 'PENDING' | 'ACTIVE' | 'INACTIVE', required — User account status: - `PENDING`: User invited but has not completed onboarding - `ACTIVE`: User account is active and can access the system - `INACTIVE`: User account is deactivated
    - `roles` UserRole[], required — User's roles within the organization
    - `key` string, nullable — Client-defined reference identifier for this user
    - `datUsername` string, nullable — DAT (Load Board) integration username
    - `mcpUsername` string, nullable — MyCarrierPortal integration username
    - `avatarId` string, uuid, nullable — Profile avatar document ID
    - `teams` TeamReference[] — Teams this user belongs to
      - `object` 'TEAM' — Object type identifier
      - `id` string, uuid, required — Unique team identifier
      - `name` string, required — Team name
      - `key` string, nullable — Client-defined reference identifier for this team
      - `createdAt` string, date-time, required — Timestamp when team was created
      - `updatedAt` string, date-time, required — Timestamp when team was last updated
      - `deletedAt` string, date-time, nullable — Timestamp when team was soft-deleted (null if active)
    - `createdAt` string, date-time, required — Timestamp when user was created
    - `updatedAt` string, date-time, required — Timestamp when user was last updated
    - `deletedAt` string, date-time, nullable — Timestamp when user was soft-deleted (null if active)
  - `pagination` PaginationInfo
    - `pageSize` integer, required — Number of items per page
    - `hasNextPage` boolean, required — Whether there are more pages
    - `hasPreviousPage` boolean — Whether there are previous pages
    - `endCursor` string, nullable — Cursor for the next page (null if no next page)

## Other responses

- `400` — Bad request - invalid input
- `401` — Unauthorized - invalid or missing access token
- `422` — Validation error - invalid field values
- `429` — Rate limit exceeded

---

[API](https://skmtc.dev/mvmnt/apis/mvmnt-api.md) · [All operations](https://skmtc.dev/mvmnt/apis/mvmnt-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/mvmnt/mvmnt-api/revisions/7af4e91459ca/schema)
