Async jobs & polling
Some endpoints kick off long-running on-chain work and return
202 Accepted immediately. Poll the matching status endpoint until the
job reaches a terminal state.
We don't send webhooks today — polling is the only option.
Fire-and-forget endpoints
| Start | Status poller |
|---|---|
POST /token/create | GET /token/creation-status/:botId |
POST /holders/initialize | GET /holders/status/:holdersId |
POST /flexi/initialize | GET /flexi/getgroup/:sGroupId |
POST /classic/initialize | GET /classic/group/:sGroupId |
Status values (eStatus)
| Value | Meaning |
|---|---|
'1' | Awaiting payment or first step |
'2' | Running |
'3' | Completed |
'4' | Cancelled / expired |
'9' | Failed — check sErrorMessage |
Status endpoints also return a statusLabel field with a
human-readable name (PENDING_PAYMENT, RUNNING, COMPLETED,
CANCELLED, FAILED) for convenience.
Retry guidance
Don't retry fire-and-forget HTTP calls on timeout — the job may already be running on our side. Call the status endpoint to see where it is. Our jobs resume automatically after internal restarts; you'll see the final state through the normal poll.
Example polling loop
BOT_ID="66a9ff…"
while true; do
BODY=$(curl -s "$BASE_URL/token/creation-status/$BOT_ID" \
-H "Authorization: Bearer $ACCESS" \
-H "x-user-id: $USER_ID")
STATUS=$(echo "$BODY" | jq -r '.eStatus')
case "$STATUS" in
3) echo "done"; echo "$BODY" | jq; break ;;
9) echo "failed: $(echo "$BODY" | jq -r '.sErrorMessage')"; exit 1 ;;
*) sleep 5 ;;
esac
done
Lost ids — disaster recovery
If your client forgets a job id mid-flow:
- Tokens:
GET /token/alllists every token the user has created. - Holders:
GET /holders/all?eStatus=1lists pending orders withholdersId,paymentAddressandnRequiredSol— enough to cancel and restart. - Flexi / Classic:
GET /flexi/getallgroupsandGET /classic/allgroupslist all groups with current status.