Skip to main content
POST
/
api
/
v1
/
org
/
objects
/
{object_slug}
/
filter
Filter Object Data
curl --request POST \
  --url https://app.superleap.com/api/v1/org/objects/{object_slug}/filter \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: <content-type>' \
  --data '
{
  "query": {
    "fields": [
      "<string>"
    ],
    "filters": {
      "and": [
        {
          "field": "<string>",
          "operator": "<string>",
          "value": "<any>",
          "and": [
            {}
          ],
          "or": [
            {}
          ]
        }
      ],
      "or": [
        {
          "field": "<string>",
          "operator": "<string>",
          "value": "<any>",
          "and": [
            {}
          ],
          "or": [
            {}
          ]
        }
      ]
    },
    "sort": [
      {
        "field": "<string>",
        "direction": "<string>"
      }
    ],
    "pagination": {
      "page": 123,
      "page_size": 123
    }
  }
}
'
Get filtered list of records for a requested object. This API is useful when you want to fetch a subset of records based on certain criteria.

Headers

Authorization
string
required
Bearer token for authentication, click here to generate one
Content-Type
string
default:"application/json"
required
application/json

Path Parameters

object_slug
string
required
The slug identifier for the object type you want to filter (e.g., “lead”, “user”, “opportunity”)

Body

query
object
required
Query object containing filter parameters

Example Request

curl --location 'https://app.superleap.com/api/v1/org/objects/lead/filter' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer SUPERSECRETREDACTEDKEY' \
--data-raw '{
  "query": {
    "fields": ["created_at", "email", "external_id", "id", "name", "phone"],
    "filters": {
      "or": [
        {
          "and": [
            {
              "field": "email",
              "operator": "contains",
              "value": "ad"
            }
          ]
        },
        {
          "or": [
            {
              "field": "name",
              "operator": "contains",
              "value": "P"
            },
            {
              "field": "name",
              "operator": "starts_with",
              "value": "C"
            }
          ]
        }
      ]
    },
    "sort": [
      {
        "field": "name",
        "direction": "desc"
      }
    ],
    "pagination": {
      "page": 1,
      "page_size": 150
    }
  }
}'

Example Response

{
  "success": true,
  "data": {
    "records": [
      {
        "created_at": 1741267307472,
        "email": "[email protected]",
        "external_id": "I am external",
        "id": "cK2p5W_pL8b6BEh",
        "name": "Cariappa 2",
        "phone": "+91-9999999999"
      },
      {
        "created_at": 1741614402286,
        "email": null,
        "external_id": null,
        "id": "cK2p5W_mWCp7EHz",
        "name": "Cariappa",
        "phone": null
      },
      {
        "created_at": 1741348841428,
        "email": "[email protected]",
        "external_id": "we",
        "id": "cK2p5W_rcZAmD55",
        "name": "Cariappa",
        "phone": null
      },
      {
        "created_at": 1741266340544,
        "email": "[email protected]",
        "external_id": "asdf",
        "id": "cK2p5W_zz3t4dBH",
        "name": "Cariappa",
        "phone": "+91-9999999999"
      },
      {
        "created_at": 1741616420041,
        "email": null,
        "external_id": "Sdfasdf",
        "id": "cK2p5W_UssVtMdf",
        "name": "Car",
        "phone": null
      }
    ]
  }
}

Filter Operators

OperatorDescriptionExample
eqEqual to{"field": "status", "operator": "eq", "value": "active"}
neqNot equal to{"field": "status", "operator": "neq", "value": "deleted"}
gtGreater than{"field": "amount", "operator": "gt", "value": 1000}
ltLess than{"field": "amount", "operator": "lt", "value": 5000}
gteGreater than or equal to{"field": "amount", "operator": "gte", "value": 1000}
lteLess than or equal to{"field": "amount", "operator": "lte", "value": 5000}
inValue is in array{"field": "status", "operator": "in", "value": ["active", "pending"]}
ninValue is not in array{"field": "status", "operator": "nin", "value": ["deleted", "archived"]}
likePattern matching (case sensitive){"field": "name", "operator": "like", "value": "%Smith%"}
ilikePattern matching (case insensitive){"field": "name", "operator": "ilike", "value": "%smith%"}
starts_withString starts with{"field": "name", "operator": "starts_with", "value": "Car"}
ends_withString ends with{"field": "email", "operator": "ends_with", "value": "@gmail.com"}
containsString contains{"field": "name", "operator": "contains", "value": "John"}
not_containsString does not contain{"field": "name", "operator": "not_contains", "value": "Deleted"}
betweenValue is between (inclusive){"field": "amount", "operator": "between", "value": [1000, 5000]}
is_emptyField is null or empty{"field": "notes", "operator": "is_empty"}
not_emptyField is not null and not empty{"field": "email", "operator": "not_empty"}
existsField exists{"field": "custom_field", "operator": "exists"}
not_existsField does not exist{"field": "custom_field", "operator": "not_exists"}
global_searchSearch across multiple fields{"field": "", "operator": "global_search", "value": "search term"}
leqLower or equal (legacy){"field": "priority", "operator": "leq", "value": 3}
nleqNot lower or equal (legacy){"field": "priority", "operator": "nleq", "value": 3}