Combine record filters with the Inbound API

Group AND and OR conditions to read records that match a precise set of criteria.

Use a table stored in Mainbase to combine multiple conditions in one record list request. An AND group requires every condition to match. An OR group requires at least one match. Nest the groups to control which conditions are evaluated together.

Filter by category and either of two statuses

This example returns records in the Hardware category whose status is Open or In progress. Read GET /entities/{entityId} to find the dataKey for each field. Replace 123, category, status, and the example values with those from your table. For a select field, check its option values in the schema.

Use the base URL from API Access and load the API key from your secret manager. Put the entire expression in one URL-encoded filters parameter.

curl --silent --show-error --fail-with-body --get \
  "${NIXA_API_BASE_URL}/entities/123/records" \
  -H "X-API-Key: ${NIXA_API_KEY}" \
  --data-urlencode 'filters={
    "logicalOperator":"AND",
    "conditions":[
      {"field":"category","operator":"equals","value":"Hardware"},
      {"logicalOperator":"OR","conditions":[
        {"field":"status","operator":"equals","value":"Open"},
        {"field":"status","operator":"equals","value":"In progress"}
      ]}
    ]
  }' \
  --data-urlencode 'sortBy=id' \
  --data-urlencode 'sortOrder=asc' \
  --data-urlencode 'limit=25' \
  --data-urlencode 'page=1'

Verify the matches

Check data for records you expect to match. A Hardware record with either status matches, while a Software record with either status fails the category condition. To read more matches, increase page while meta.hasMore is true and keep the filter and sort the same.

If the request fails, check the JSON and the field keys, then try each condition on its own. The key’s acting user must be able to read the filter fields and the matching records.

Search one table’s records with the Inbound API

Filter records by a Date field’s range with the Inbound API

Ask Mainbase AI

Ask about any feature in Mainbase. Find a setting, get step-by-step guidance, or troubleshoot a problem.

Open the AI assistant

Copy a question to get started

  • How do I create a Kanban view?
  • How do I invite a teammate?
  • Why is a record missing from this view?