---
title: "Filter teams"
method: POST
path: "/teams/filter"
tags: ["Teams"]
---

# Filter teams

`POST /teams/filter`

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

## Request body

- TeamFilterRequest — Request body for filtering teams
  - `filter` TeamFilter — Filter criteria for teams with AND/OR logic support
    - `and` TeamFilter[] — All conditions must match (recursive)
    - `or` TeamFilter[] — At least one condition must match (recursive)
    - `not` TeamFilter — 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
    - `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)
    - `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)
    - `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` Team[]
    - `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
    - `users` UsersUserReference[] — Users who are members of this team
      - `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
      - `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)
    - `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)
  - `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)
