Skip to main content

Query

Use the Warrant Query Language (WQL) to list the set of subjects that have access to a particular object or to list of objects a particular subject has access to.

Endpoint

GET /v1/query

Request

Query Params

ParameterTypeDescriptionRequired
qstringA query written in the Warrant Query Language (WQL).yes
lastIdstringA cursor representing your place in a paginated query result. Requests containing lastId will return the results following the cursor.no
GET /v1/query
curl "https://api.warrant.dev/v1/query?q=select+pricing-tier,feature+where+user:12+is+member" \
-H "Authorization: ApiKey YOUR_KEY"

Response

200 OK
{
"results": [
{
"objectType": "pricing-tier",
"objectId": "enterprise",
"warrant": {
"objectType": "pricing-tier",
"objectId": "enterprise",
"relation": "member",
"subject": {
"objectType": "user",
"objectId": "12"
}
},
"isImplicit": false,
"meta": {
"name": "Enterprise",
"description": "Grants customers access to the features in our Enterprise tier."
}
},
{
"objectType": "pricing-tier",
"objectId": "basic",
"warrant": {
"objectType": "pricing-tier",
"objectId": "enterprise",
"relation": "member",
"subject": {
"objectType": "user",
"objectId": "12"
}
},
"isImplicit": true,
"meta": {
"name": "Basic",
"description": "Grants customers access to the features in our Free tier."
}
},
{
"objectType": "feature",
"objectId": "analytics",
"warrant": {
"objectType": "pricing-tier",
"objectId": "enterprise",
"relation": "member",
"subject": {
"objectType": "user",
"objectId": "12"
}
},
"isImplicit": true,
"meta": {
"name": "Analytics",
"description": "Grants customers access to the Custom Analytics value-add feature."
}
}
],
"lastId": "MTc4MDI5ODc="
}