Skip to main content
POST
/
api
/
v1
/
reports
/
execute
Execute Superleap Object Query
curl --request POST \
  --url https://app.superleap.com/api/v1/reports/execute \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: <content-type>' \
  --data '
{
  "query": "<string>",
  "slug": "<string>"
}
'
Run a Superleap Object Query against a Superleap object and return the resulting records. This API is useful for analytics and reporting use cases such as field selection, counts, grouped summaries, and filtered datasets.
Replace <domain> with your Superleap workspace domain. For example, app.superleap.com, sandbox.superleap.dev, or your tenant-specific domain.

Headers

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

Body

query
string
required
Superleap Object Query to execute. The query can include supported clauses such as SELECT, field selection, aggregate functions like COUNT, WHERE filters, aliases, and LIMIT.
slug
string
required
Object slug to run the Superleap Object Query against (for example, account).

Superleap Object Query Language Support

The query field supports Superleap Object Query Language for the requested object. You can use both normal field-selection queries and aggregation queries.

Field Selection Query

Use a normal SELECT query to fetch fields from the object slug:
SELECT id, name, created_at
FROM account
LIMIT 100

Aggregation Query

Use aggregate functions such as COUNT for summary reports:
SELECT COUNT(id) as "Record count"
FROM account
WHERE ((created_at >= 1780425000000 AND created_at <= 1780511399999))
LIMIT 100

Example Request

curl --location 'https://<domain>.superleap.com/api/v1/reports/execute' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer SUPERSECRETREDACTEDKEY' \
--data-raw '{
  "query": "SELECT COUNT(id) as \"Record count\" FROM account WHERE ((created_at >= 1780425000000 AND created_at <= 1780511399999)) LIMIT 100",
  "slug": "account"
}'

Example Response

{
  "success": true,
  "data": {
    "records": [
      {
        "Record count": 3080
      }
    ]
  }
}