Teams
Run (Async)
POST /api/v1/teams/:teamId/run-async — queue a team run and poll for the result.
Queues a team run and returns immediately with a job ID, instead of blocking for up to 30 seconds
like /run-sync. Use this for anything that might run long — plan-execute
teams especially, since they can iterate several times before finishing — or when you'd rather not
hold a connection open.
POST /api/v1/teams/{teamId}/run-asyncPath parameters
| Parameter | Type | Description |
|---|---|---|
teamId | string (UUID) | The team to run. |
Request body
Identical to /run-sync: message (required), session_id,
user_id.
Response
202 Accepted
{
"jobId": "9c4e2a1b-...",
"teamId": "3f9c...",
"status": "queued",
"createdAt": 1732550123
}Lifecycle
POST /teams/:teamId/run-async→ receive ajobId, statusqueued.GET /team-jobs/:jobId(poll) → status moves throughqueued→running→ a terminal state.- A terminal state is reached:
completed,failed,timeout, orcancelled. - Optionally,
POST /team-jobs/:jobId/cancelat any point before it reaches a terminal state.
See Team jobs for the full job response shape and cancellation.
Recommended polling interval
- Poll every 2 seconds for the first 30 seconds — most jobs finish inside that window.
- After 30 seconds, back off to every 5 seconds until you see a terminal state.
- Don't poll more than once per second — it burns your rate limit budget for no benefit.
Python example
import asyncio
import httpx
async def run_and_poll(team_id: str, message: str, api_key: str) -> dict:
base = "https://api.elizon.com/api/v1"
headers = {"X-API-Key": api_key, "Content-Type": "application/json"}
async with httpx.AsyncClient() as client:
# Submit async job
r = await client.post(f"{base}/teams/{team_id}/run-async",
headers=headers, json={"message": message})
job_id = r.json()["jobId"]
# Poll until terminal
interval, elapsed = 2, 0
while True:
await asyncio.sleep(interval)
elapsed += interval
if elapsed > 30:
interval = 5
r = await client.get(f"{base}/team-jobs/{job_id}", headers=headers)
job = r.json()
if job["status"] in ("completed", "failed", "timeout", "cancelled"):
return jobErrors
| Status | error | When |
|---|---|---|
400 | validation error ({ "errors": [...] }) | message missing/empty, or another field fails validation |
403 | forbidden | The team belongs to a different project than your project-scoped key |
404 | team_not_found | No team with that ID exists in your organization |
502 | enqueue_failed | The job couldn't be queued (transient infrastructure error) — safe to retry |
Example
curl -X POST https://api.elizon.com/api/v1/teams/{teamId}/run-async \
-H "X-API-Key: elz_your_key_here" \
-H "Content-Type: application/json" \
-d '{"message": "A customer is asking about a refund on order #4821"}'