runId immediately, and the long-running work (research, drafting, humanization, scoring) happens in the background. There are three recommended patterns for consuming it.
1. Queue and poll
Best for scripts, cron jobs, and simple backends.- Start a run:
POST /api/stealthify/runs(humanize-only) orPOST /api/stealthify/agent/runs(full pipeline) →202withrunId+statusUrl. - Poll
GET .../runs/{runId}every 5–15 seconds untilstatusiscompleted,failed, orcancelled. - Read the final
resultand billing metadata from the completed response.
idempotency-key header on create so retries never enqueue duplicate runs or double-charge.
→ Humanizer async runs · Stealth Agent async runs
2. Fire and webhook
Best for no-code tools (n8n, Make, WordPress) and event-driven backends that don’t want to poll.- Start a run and include
webhookUrl(and optionallywebhookSecret). - When the run reaches a terminal state, StealthGPT
POSTs the result (or terminal failure) to yourwebhookUrl. - Verify the
x-stealthgpt-signatureHMAC (whenwebhookSecretis set) and reconcile byx-stealthgpt-run-id.
429/5xx; treat delivery as at-least-once and dedupe by run id + status.
→ See the Webhook callbacks section on the async runs page.