Docs / Core

Bulk

client.bulk.submit(projectKey, endpoint, items) POSTs to /v1/{projectKey}/{endpoint}/bulk and returns a BulkJob handle. The SDK attaches an automatic Idempotency-Key (crypto.randomUUID) so retries never double-submit. client.bulk.status(jobId) does a single poll.

bulk.ts
const job = await client.bulk.submit("social:instagram", "profile", [  { url: "https://instagram.com/a" },  { url: "https://instagram.com/b" },]); const result = await job.wait({  onProgress: (j) => console.log(j.succeeded, "/", j.total),});for (const item of result.items ?? []) {  console.log(item.status, item.data ?? item.error);}
const job = await client.bulk.submit("social:instagram", "profile", [  { url: "https://instagram.com/a" },  { url: "https://instagram.com/b" },]); const result = await job.wait({  onProgress: (j) => console.log(j.succeeded, "/", j.total),});for (const item of result.items ?? []) {  console.log(item.status, item.data ?? item.error);}

job.wait({ signal?, timeoutMs?, pollIntervalMs?, onProgress? }) polls with backoff (base 500 ms, capped at 5 s) until the job is terminal. Job statuses: QUEUED | RUNNING | COMPLETED | FAILED | CANCELLED; per-item statuses: QUEUED | RUNNING | SUCCEEDED | FAILED.

Edit this page on GitHubWas this page helpful? ·