Skip to content

Execute a SbQL query

POST/v1/insights/execute

US Region: https://public-api.sessionboard.com · EU Region: https://public-api-eu.sessionboard.com

Execute a SbQL query against event data and return results. Requires the read:insights scope.

Request example

Terminal window
curl --request POST \
--url 'https://public-api.sessionboard.com/v1/insights/execute' \
--header 'x-access-token: <api-token>' \
--header 'Content-Type: application/json' \
--data '{
"query": "SELECT sessions.title, sessions.status FROM sessions",
"eventId": 123,
"eventIds": [
123
],
"obfuscatePii": false,
"format": "<string>",
"page": 123,
"limit": 123,
"search": "<string>",
"sortBy": "<string>",
"sortDirection": "asc",
"groupBy": "<string>",
"pivot": "<string>"
}'

Try it

Authorization

Your token stays in this page. It is sent only to the region above and is never saved; it is gone when you leave or reload the page.

Body application/json
POST

Authorizations

  • x-access-tokenstringheaderrequired

    Organization API token. Generate from Organization Settings → API Tokens.

Request body

application/jsonrequired

  • querystringrequired

    The SbQL query string to execute.

  • eventIdinteger

    Scope query to a single event.

  • eventIdsinteger[]

    Scope query to multiple events.

  • obfuscatePiiboolean

    Set to true to mask personal-data fields (such as emails and phone numbers) in the results. Results are not masked unless you send true.

    Default
    false
  • formatstring

    Output format for results.

  • pageinteger

    Page number for paginated results.

  • limitinteger

    Maximum number of rows to return.

  • searchstring

    Full-text search within results.

  • sortBystring

    Column name to sort results by.

  • sortDirectionstring

    Sort direction.

    Allowed values
    "asc", "desc"
  • groupBystring

    Column name to group results by.

  • pivotstring

    Column name to pivot results on.

{
"query": "SELECT sessions.title, sessions.status FROM sessions",
"eventId": 123,
"eventIds": [
123
],
"obfuscatePii": false,
"format": "<string>",
"page": 123,
"limit": 123,
"search": "<string>",
"sortBy": "<string>",
"sortDirection": "asc",
"groupBy": "<string>",
"pivot": "<string>"
}

Responses

200application/json

OK

  • resultsobject[]
  • paginationPagination

    Pagination metadata returned with POST search responses. The event-settings GET lists return the same numbers under snake_case keys — see ListPagination.

    Show child attributes
    • currentPageinteger
    • pageSizeinteger
    • totalPagesinteger
    • totalResultsinteger

400

Invalid query

401

Unauthorized

403

Insufficient scope

Response examples

{
"results": [
{}
],
"pagination": {
"currentPage": 1,
"pageSize": 25,
"totalPages": 4,
"totalResults": 97
}
}

Get release notes by email

A short digest on the days something new goes live — each change with a link to its note in the release notes. No marketing, and one click to stop.

Company email addresses only. We’ll send one email to confirm it’s you. Already use Sessionboard? You can also turn this on under Community → What’s new.