Queues and polling
Track a queue with list and status, and poll until it completes.
Endpoints that enqueue work hand you a queueId (or queueIds for Search). Read the results back with list and status, or skip polling entirely and let a webhook push them to you.
#List results
GET /open-refresh/list returns a queue's items, paginated.
| Field | Type | Notes |
|---|---|---|
queueId |
string | Required |
page |
string | Required, 0-indexed |
limit |
string | Required, 1 to 25 |
failed |
boolean | Optional, defaults to false. Set true to see items whose webhook delivery failed |
curl -X GET "https://api.up2data.ai/api/open-refresh/list?queueId=507f1f77bcf86cd799439011&page=0&limit=10" \
-H "Authorization: YOUR_ACCESS_TOKEN"The shape of each item is decided by the queue itself: an enrichment queue returns Profile or Company documents, an activity queue returns Activity documents.
{
"items": "Profile[] | Company[] | Activity[]",
"total": "number",
"totalResults": "number (Sales Navigator queues only)"
}totalResults is how many results the Sales Navigator search itself reported, so it is usually larger than total, since scraping is capped by the link's limit. Only queues created by /open-refresh/search carry it, and only once the first page has been scraped.
#Check status
GET /open-refresh/status reports how far a queue has gotten.
curl -X GET "https://api.up2data.ai/api/open-refresh/status?queueId=507f1f77bcf86cd799439011" \
-H "Authorization: YOUR_ACCESS_TOKEN"{
"queueId": "string",
"status": "string (\"pending\" | \"completed\")",
"processed": "number",
"total": "number"
}{
"queueId": "507f1f77bcf86cd799439011",
"status": "pending",
"processed": 35,
"total": 50
}#Polling
Poll status until it reports completed, then fetch the results:
# Poll every 30 seconds until done
while true; do
STATUS=$(curl -s -H "Authorization: $TOKEN" \
"https://api.up2data.ai/api/open-refresh/status?queueId=$QUEUE_ID")
if echo "$STATUS" | grep -q '"completed"'; then
# Now fetch the results
curl -H "Authorization: $TOKEN" \
"https://api.up2data.ai/api/open-refresh/list?queueId=$QUEUE_ID&page=0&limit=25"
break
fi
sleep 30
donePolling costs requests and adds latency for no benefit once nothing has changed, and it counts toward your rate limits. Configure a webhook instead and skip this loop entirely. See the Webhooks guide.