--- title: Querying | micro description: How to filter, sort, select, and paginate with the Micro API --- All data in Micro is queried through a single endpoint: ``` POST /v2/prism/query/{teamId}/{objectType} ``` The request body contains a `query` object that describes what to fetch. ## Select `select` is required. Pass an array of property slugs to return. ``` { "query": { "select": ["full_name", "email", "title"] } } ``` Use dot notation to traverse relationships: ``` { "query": { "select": ["full_name", "company.name", "company.primary_domain"] } } ``` ## Filter `filter` is an array of conditions. Each condition is `{ slug: { operator: value } }`. ``` { "query": { "select": ["full_name", "email"], "filter": [ { "labels": { "in": ["investor"] } }, { "last_interaction_date": { ">=": "2024-01-01" } } ] } } ``` ### Operators | Operator | Types | Description | | ----------------- | -------------- | ------------------------- | | `=` | all | Exact match | | `!=` | all | Not equal | | `<` `>` `<=` `>=` | number, date | Comparison | | `in` | string, select | Value is in the array | | `not_in` | string, select | Value is not in the array | | `begins_with` | string | Starts with value | | `ends_with` | string | Ends with value | | `like_regex` | string | Matches regex pattern | | `not_contains` | string | Does not contain value | | `exists` | any | Field has a value | | `not_exists` | any | Field has no value | ### Combining filters By default filters are combined with `AND`. Use `combinator` to switch to `OR`: ``` { "query": { "select": ["full_name"], "filter": [ { "labels": { "in": ["investor"] } }, { "labels": { "in": ["founder"] } } ], "combinator": "OR" } } ``` ## Sort `sort` is an array of `{ slug: direction }` objects. Earlier items in the array take priority. ``` { "query": { "select": ["full_name", "last_interaction_date"], "sort": [ { "last_interaction_date": "desc" }, { "full_name": "asc" } ] } } ``` ## Pagination Use `limit` to set page size (default: 25, max: 250) and `page` to paginate. ``` { "query": { "select": ["full_name"], "limit": 100, "page": 2 } } ``` The response is an array. Use `page` to fetch the next set of results: ``` [ { "id": "c1a2b3c4-...", "properties": { "full_name": "Sarah Chen", "email": "sarah@example.com" } } ] ``` ## App context Pass `crm_id` to scope results to a specific CRM app (e.g. your fundraising pipeline vs. your investor network): ``` { "query": { "select": ["full_name", "stage"], "crm_id": "your-crm-uuid" } } ```