Skip to main content
Generating a pattern, refining it and building a product run in the background. These calls return a job right away:

Wait for a job

Call jobs/get with the jobId until status changes. Poll every 10 seconds. Polling faster counts against the rate limit and doesn’t make the job finish sooner. To skip polling, get a webhook when the job finishes. A download job sends no webhook.

Read the result

kind says what the job makes, and so what result holds. A product job succeeds once the product is built and ready to order. patterns/refine/recolorClusters returns its result directly, not a job. A job that patterns/create started with a categoryId, before that field was removed, is a product job. A refine makes a new pattern. The pattern you refined stays as it was.

A succeeded job with no result

result can be null on a succeeded job in two cases:
  • A fixDeformity job found nothing to repair.
  • The pattern the job made has since been deleted.
Check for null before you read an ID from result.

Handle a failure

When a job fails, error.message says why. If the account ran out of credits, error.reason is insufficient_credits. Add credits or choose a plan in Arcade Studio, then send the request again with a new requestId.