Skip to main content
POST
/
queries
/
run
Run an ad-hoc OpalQuery
curl --request POST \
  --url https://api.opal.dev/v1/queries/run \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "type": "NODE",
  "query": {
    "nodeFilters": {
      "entityTypes": [
        "RESOURCE"
      ],
      "entityTag": {
        "key": "env",
        "value": "prod"
      }
    },
    "accessFilters": {
      "isAccessibleBy": {
        "entityTypes": [
          "USER"
        ],
        "entityTag": {
          "key": "contractor"
        }
      }
    }
  },
  "first": 50
}
'
{
  "edges": [
    {
      "node": {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "name": "<string>",
        "entityItemType": "OPAL_ROLE"
      },
      "cursor": "<string>"
    }
  ],
  "pageInfo": {
    "hasNextPage": true,
    "endCursor": "<string>",
    "hasPreviousPage": true,
    "startCursor": "<string>"
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.opal.dev/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Request body for running an ad-hoc OpalQuery. The type field determines which query schema applies.

type
enum<string>
required
Available options:
NODE
query
object

The filter body for a NODE-type OpalQuery.

first
integer

Maximum number of results to return. Defaults to 200.

Example:

200

after
string

Cursor from a previous response to fetch the next page of results.

Example:

"29827fb8-f2dd-4e80-9576-28e31e9934ac"

Response

200 - application/json

The results of the OpalQuery.

Paginated results of an OpalQuery. The type field discriminates which result schema applies and mirrors the type field on the request.

type
enum<string>
required
Available options:
NODE
edges
object[]
required

List of matched entities.

pageInfo
object
required
Last modified on May 20, 2026