# Filter teams 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 }). Endpoint: POST /teams/filter Version: 1.0.0 Security: BearerAuth ## Request fields (application/json): - `filter` (object) Filter criteria (optional - omit to return all teams). Note: deletedAt automatically defaults to { isNull: true } unless explicitly overridden. Example: {"name":{"includes":"Sales"}} - `filter.and` (array) All conditions must match (recursive) - `filter.or` (array) At least one condition must match (recursive) - `filter.not` (object) Negates the filter - `filter.id` (object) Filter options for ID fields (limited operations - exact match only) - `filter.id.equalTo` (string) Exact match - `filter.id.in` (array) Matches any UUID in the array - `filter.name` (object) Filter options for string fields Example: {"includes":"Sales"} - `filter.name.notEqualTo` (string) Not equal to - `filter.name.in` (array) Matches any value in the array - `filter.name.notIn` (array) Does not match any value in the array - `filter.name.includes` (string) Contains substring (case-insensitive) Example: "Sales" - `filter.name.notIncludes` (string) Does not contain substring (case-insensitive) - `filter.name.startsWith` (string) Starts with prefix (case-insensitive) - `filter.name.notStartsWith` (string) Does not start with prefix (case-insensitive) - `filter.name.endsWith` (string) Ends with suffix (case-insensitive) - `filter.name.notEndsWith` (string) Does not end with suffix (case-insensitive) - `filter.name.isNull` (boolean) Field is null (true) or not null (false) - `filter.key` (object) Filter options for client key fields (limited operations - exact match only) - `filter.createdAt` (object) Filter options for datetime fields - `filter.createdAt.lessThan` (string) Before this datetime - `filter.createdAt.lessThanOrEqualTo` (string) On or before this datetime - `filter.createdAt.greaterThan` (string) After this datetime - `filter.createdAt.greaterThanOrEqualTo` (string) On or after this datetime - `filter.updatedAt` (object) Filter options for datetime fields - `filter.deletedAt` (object) Filter options for datetime fields - `pageSize` (integer) Number of results per page Example: 50 - `cursor` (string) Pagination cursor for next page ## Response 200 fields (application/json): - `data` (array) - `data.object` (string) Object type identifier Enum: "TEAM" - `data.id` (string, required) Unique team identifier Example: "123e4567-e89b-12d3-a456-426614174000" - `data.name` (string, required) Team name Example: "Sales Team - West Coast" - `data.key` (string,null) Client-defined reference identifier for this team Example: "ERP-TEAM-WEST" - `data.users` (array) Users who are members of this team - `data.users.id` (string, required) Unique user identifier Example: "550e8400-e29b-41d4-a716-446655440000" - `data.users.email` (string, required) User's email address Example: "john.doe@example.com" - `data.users.name` (string,null) User's full name Example: "John Doe" - `data.users.phone` (string,null) User's phone number Example: "+1-555-123-4567" - `data.users.phoneExt` (string,null) Phone extension Example: "123" - `data.users.status` (string, 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 Enum: "PENDING", "ACTIVE", "INACTIVE" - `data.users.roles` (array, required) User's roles within the organization Enum: "CUSTOMER_REP", "CARRIER_REP", "AR_AP", "COMPLIANCE", "ADMIN" - `data.users.key` (string,null) Client-defined reference identifier for this user Example: "ERP-USER-12345" - `data.users.datUsername` (string,null) DAT (Load Board) integration username Example: "johndoe_dat" - `data.users.mcpUsername` (string,null) MyCarrierPortal integration username Example: "johndoe_mcp" - `data.users.avatarId` (string,null) Profile avatar document ID Example: "7c9e6679-7425-40de-944b-e07fc1f90ae7" - `data.users.createdAt` (string, required) Timestamp when user was created Example: "2025-01-15T10:00:00Z" - `data.users.updatedAt` (string, required) Timestamp when user was last updated Example: "2025-01-15T14:30:00Z" - `data.users.deletedAt` (string,null) Timestamp when user was soft-deleted (null if active) - `data.createdAt` (string, required) Timestamp when team was created Example: "2025-01-15T10:00:00Z" - `data.updatedAt` (string, required) Timestamp when team was last updated Example: "2025-01-15T14:30:00Z" - `data.deletedAt` (string,null) Timestamp when team was soft-deleted (null if active) - `pagination` (object) - `pagination.pageSize` (integer, required) Number of items per page Example: 50 - `pagination.hasNextPage` (boolean, required) Whether there are more pages Example: true - `pagination.hasPreviousPage` (boolean) Whether there are previous pages - `pagination.endCursor` (string,null) Cursor for the next page (null if no next page) Example: "eyJpZCI6IjU1MGU4NDAwLWUyOWItNDFkNC1hNzE2LTQ0NjY1NTQ0MDAwMCJ9" ## Response 400 fields (application/json): - `error` (string, required) Error code - `message` (string, required) Human-readable error message ## Response 401 fields (application/json): - `error` (string, required) Error code - `message` (string, required) Human-readable error message ## Response 422 fields (application/json): - `error` (string, required) Error code Example: "validation_error" - `message` (string, required) Human-readable error message - `details` (array, required) Validation error details - `details.field` (string, required) Field name that failed validation - `details.message` (string, required) Validation error message ## Response 429 fields (application/json): - `error` (string, required) Error code - `message` (string, required) Human-readable error message