On this page
Getting started
Follow the query flow from API key to saved results.
Query flow: submit once, wait for completion, read sources and contacts, then save your results.
1. Get an API key#
- Sign in to Brickroad and select your organization.
- Open Settings → API keys and create a key.
- Copy the full key. It is shown once; store it securely.
The key selects your organization. Keep it in your server or local environment, never in browser code or a public repository.
Base URL: https://brickroad.network/api/v1
Set these variables before using the examples:
export BASE_URL="https://brickroad.network/api/v1"
export BRICKROAD_API_TOKEN="br_live_your_token"Every authenticated request uses Authorization: Bearer $BRICKROAD_API_TOKEN. Do not add an orgId; the key already selects it.
2. Check the queue (optional)#
Before sending a batch, check your org's run queue:
curl -sS "$BASE_URL/ifa/queue" \
-H "Authorization: Bearer $BRICKROAD_API_TOKEN"runningandqueuedcount runs across your org, including teammates' queries.availableshows free slots. Other work in your organization can use these slots too.- When
statusisready, submit your query. Forbusy, check again after 30 seconds or submit now and let it queue. - For
unavailable, checkreason. See Query Queue for the full response.
This check does not reserve a slot. Your submission can still queue.
3. Submit a query#
In query, describe:
- The subject and geography.
- Minimum history and data update frequency.
- Delivery format and anything to exclude.
These instructions guide the model. Use task profiles and prompt rules for reusable settings and fields. Use strategyId to select structured rules already saved in the app.
curl -sS $BASE_URL/ifa/queries \
-H "Authorization: Bearer $BRICKROAD_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"query":"Find alternative data suppliers that measure North American EV battery supply chains. Prefer weekly updates, at least three years of history, and API or CSV delivery. Exclude generic market reports."}'The response is HTTP 202. Save response.queryId; use it for each later call. A queued query is accepted work. Submit once and poll it.
4. Wait for completion#
Set QUERY_ID to the returned queryId:
export QUERY_ID="your_query_id"
curl -sS $BASE_URL/ifa/queries/$QUERY_ID \
-H "Authorization: Bearer $BRICKROAD_API_TOKEN"- While status is
queuedorrunning, waitnextPollAfterSecondsbefore polling again. - When status is
completed, read the results. - For
failedorcancelled, see Errors.
A run can take 30 minutes or more. Let your script wait outside an LLM call.
5. Read final sources#
curl -sS "$BASE_URL/ifa/queries/$QUERY_ID/sources?final=true" \
-H "Authorization: Bearer $BRICKROAD_API_TOKEN"Each result carries the run's own findings and the supplier's shared catalog facts.
- Save
response.sources[].idassourceIdfor detail and contact calls. - The result ID is different from
catalog.id. - Use
sourceKeyto match the same source across runs.
6. Read evidence and contacts#
Set SOURCE_ID to one result's id. Repeat for each source you need:
export SOURCE_ID="your_source_id"
curl -sS $BASE_URL/ifa/queries/$QUERY_ID/sources/$SOURCE_ID \
-H "Authorization: Bearer $BRICKROAD_API_TOKEN"
curl -sS $BASE_URL/ifa/queries/$QUERY_ID/sources/$SOURCE_ID/contacts \
-H "Authorization: Bearer $BRICKROAD_API_TOKEN"Detail includes full evidence and custom task-profile fields. Contacts returns normalized and raw contact data. Both calls need the queryId and sourceId; one does not replace the other.
7. Save results#
Save the query, sources, evidence, and contacts in your own system.
For ZDR, run DELETE only after saving everything you need:
- It removes the query and its linked operational data.
- Later reads of that query return 404.
- It keeps your account.
curl -sS -X DELETE $BASE_URL/ifa/queries/$QUERY_ID \
-H "Authorization: Bearer $BRICKROAD_API_TOKEN"Other workflows
- List Queries: find existing runs.
- Delivered Sources Feed: read delivered sources across your org.
- Scouts and Streams: keep a question running on a schedule. Recurrence is unavailable for ZDR organizations.