Job Lifecycle
| Status | Description |
|---|---|
queued | Job is waiting to be processed |
running | Agent is actively collecting data |
completed | Finished, results are available |
failed | Error occurred, check the error field |
cancelled | Cancelled by you, nothing charged |
Job results expire after 7 days. Download your data before the
expires_at timestamp.Quick Example
# Start a job
curl -X POST https://api.mindcase.co/api/v1/agents/instagram/profiles/run \
-H "Authorization: Bearer mk_live_abc123def456" \
-H "Content-Type: application/json" \
-d '{"params": {"usernames": ["nike"]}}'
# → {"job_id": "abc123", "status": "queued"}
# Poll status
curl https://api.mindcase.co/api/v1/jobs/abc123 \
-H "Authorization: Bearer mk_live_abc123def456"
# Get results when completed
curl https://api.mindcase.co/api/v1/jobs/abc123/results \
-H "Authorization: Bearer mk_live_abc123def456"
# Cancel if needed
curl -X DELETE https://api.mindcase.co/api/v1/jobs/abc123 \
-H "Authorization: Bearer mk_live_abc123def456"
import requests, time
API_KEY = "mk_live_abc123def456"
HEADERS = {"Authorization": f"Bearer {API_KEY}"}
# 1. Start a job
job = requests.post(
"https://api.mindcase.co/api/v1/agents/instagram/profiles/run",
headers=HEADERS,
json={"params": {"usernames": ["nike"]}},
).json()
# 2. Poll until done
while True:
status = requests.get(
f"https://api.mindcase.co/api/v1/jobs/{job['job_id']}",
headers=HEADERS,
).json()
if status["status"] in ("completed", "failed", "cancelled"):
break
time.sleep(2)
# 3. Get results
results = requests.get(
f"https://api.mindcase.co/api/v1/jobs/{job['job_id']}/results",
headers=HEADERS,
).json()