# Filter companies Query companies using flexible filter criteria with AND/OR logic. By default, only non-deleted companies are returned (deletedAt: { isNull: true }). Override this by explicitly setting deletedAt filter criteria. Endpoint: POST /companies/filter Version: 1.0.0 Security: BearerAuth ## Request fields (application/json): - `filter` (object) Filter criteria (optional - omit to return all companies). Note: deletedAt automatically defaults to { isNull: true } unless explicitly overridden. Example: {"and":[{"invoiceOnly":{"equalTo":false}},{"name":{"includes":"Inc"}}]} - `filter.and` (array) All conditions must match (recursive) Example: [{"invoiceOnly":{"equalTo":false}},{"name":{"includes":"Inc"}}] - `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 - `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) - `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.addressLine1` (object) Filter options for string fields - `filter.addressLine2` (object) Filter options for string fields - `filter.city` (object) Filter options for string fields - `filter.country` (object) Filter options for string fields - `filter.fax` (object) Filter options for string fields - `filter.invoiceOnly` (object) Filter options for boolean fields - `filter.invoiceVerbiage` (object) Filter options for string fields - `filter.primaryContactName` (object) Filter options for string fields - `filter.primaryContactEmail` (object) Filter options for string fields - `filter.primaryContactPhone` (object) Filter options for string fields - `filter.createdById` (object) Filter options for UUID fields (all operations) - `filter.createdById.notIn` (array) Does not match any UUID in the array - `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, required) - `data.object` (string) Object type identifier Enum: "COMPANY" - `data.id` (string, required) Unique company identifier Example: "550e8400-e29b-41d4-a716-446655440000" - `data.name` (string, required) Company legal name Example: "Acme Logistics Inc" - `data.addressLine1` (string,null) Primary street address Example: "123 Main St" - `data.addressLine2` (string,null) Secondary address line (suite, floor, etc.) Example: "Suite 400" - `data.city` (string,null) City name Example: "Chicago" - `data.country` (string,null) Country code or name Example: "USA" - `data.fax` (string,null) Fax number Example: "+1-555-0123" - `data.invoiceOnly` (boolean,null) Whether this company is used only for invoicing purposes - `data.invoiceVerbiage` (string,null) Custom text to include on invoices for this company Example: "Please remit payment within 30 days" - `data.primaryContactName` (string,null) Name of primary contact person Example: "John Smith" - `data.primaryContactEmail` (string,null) Email address of primary contact Example: "john.smith@acmelogistics.com" - `data.primaryContactPhone` (string,null) Phone number of primary contact Example: "+1-555-0100" - `data.createdBy` (any) User who created this company (full user details) - `data.key` (string,null) Client-defined reference identifier Example: "ERP-COMPANY-ACME-001" - `data.createdAt` (string, required) When the company was created Example: "2025-01-15T10:00:00Z" - `data.updatedAt` (string, required) When the company was last updated Example: "2025-01-15T14:30:00Z" - `data.deletedAt` (string,null) When the company was soft deleted (null if active) - `pageInfo` (object, required) - `pageInfo.pageSize` (integer, required) Number of items per page Example: 50 - `pageInfo.hasNextPage` (boolean, required) Whether there are more pages Example: true - `pageInfo.hasPreviousPage` (boolean) Whether there are previous pages - `pageInfo.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