Filter for Open and Assigned Tickets
This article provides an example demonstrating how to query for open tickets using the BQL API. While this example focuses on a specific set of attributes, you can tailor the query to include the attributes that fit your needs. For more details on the BQL API, see the BQL API documentation.
Start the query
Send a POST request to start the query. This example retrieves open tickets with selected fields and a nested relationship projection for the assigned user.
curl -X POST 'https://<your-brinqa-instance>/v1/api/bql' \
-H 'Content-Type: application/json' \
-H 'Authorization: ApiKey <your-api-token>' \
-d '{
"query": "FIND Ticket WHERE status = \"Open\"",
"returningFields": ["uid", "buid", "name", "complianceStatus", "dueDate", "riskRating", "assigned(fullName)"],
"limit": 10
}'
Replace <your-brinqa-instance> with the URL of your Brinqa Platform and <your-api-token> with your API token.
The API returns a 202 Accepted response with a Location header:
HTTP/2 202
Location: /v1/api/bql/eyJqb2JI...
Retry-After: 2
Fetch results
Use the Location value from the previous response to poll for results:
curl 'https://<your-brinqa-instance>/v1/api/bql/eyJqb2JI...' \
-H 'Authorization: ApiKey <your-api-token>'
If the query is still processing, the response has status "processing". Poll again after the number of seconds indicated in the Retry-After header. When the query completes, the response contains the matching tickets. Note how the assigned relationship is returned as a nested object:
{
"status": "completed",
"state": "success",
"message": "Query completed successfully.",
"results": [
{
"uid": "e843191c-ced7-4f84-9a64-695de360917a",
"buid": "BRINQA-1686488211321389058",
"name": "Cisco IOS Software DHCPv6 Relay Denial of Service Vulnerability (cisco-sa-20160323-dhcpv6)",
"complianceStatus": "Within SLA",
"dueDate": "2025-08-31T21:25:04.284Z",
"riskRating": "High",
"assigned": { "fullName": "John Doe" }
}
],
"totalRows": 1,
"pageRows": 1,
"cursor": null
}