Skip to main content

Safe Bulk API reference

Base URL

The API is served from the Worker’s application origin under the /api prefix. All authenticated endpoints require a Shopify App Bridge bearer token in the Authorization header.

Health check

Returns app identity, build SHA, and billing configuration status. Response: {"ok":true,"app":"safe-bulk","commit":"...","billingConfigured":true}

Onboarding

Returns workspace and subscription status.
Seeds the workspace and claims the first administrator. Accepts {}. Returns admin status and next route.

Setup

Returns the Dashboard follow-up checklist (Create a product change set, Run a change with undo protection, and Enable a recurring playbook), each step’s completion and blocked state, and the next unblocked step key. This checklist is separate from the Setup page, which covers the workspace and first administrator, subscription access, and an initial reviewed change set. Administrators also receive a canManageSetup flag.
Administrators only. Accepts {}. Dismisses setup for the current installation.

UI context

Returns the authenticated shop domain and, when available, the primary custom domain. Used for presentation metadata.

Dashboard

Returns aggregate metrics: change set count, awaiting-approval count, active job count, and average risk over the last 30 days.

Projects

Lists all projects for the authenticated shop, ordered by creation date descending.
Creates a new project. Requires project:create action. Body:
entityType accepts: products, customers, companies, metafields, metaobjects.
Archives an active project. Requires project:archive action.

CSV imports

Enqueues a durable CSV import job. Requires csv:import action. Body:
Returns HTTP 202 with jobId, changeSetId, and status: "queued". Supports Idempotency-Key header. Limits enforced: plan byte and row ceilings.

Change sets

Lists the 100 most recent change sets.
Returns change-set details, paginated change items, approvals, import status, and item count. limit max 5,000.
Records an approval or rejection. Requires change-set:approve action. Body:
decision is approved or rejected. Returns updated change set and all approvals.
Executes an approved change set. Requires change-set:execute action. Supports Idempotency-Key.
Rolls back an executed change set. Requires change-set:rollback action. Supports Idempotency-Key.
Generates an AI review draft. Requires change-set:ai-review action. Samples up to 200 items.

Playbooks

Lists all playbooks for the authenticated shop.
Creates a vendor price adjustment playbook. Requires playbook:vendor-price-adjustment:create action.
percent range: -90 to 500.
Creates a metafield backfill playbook. Requires playbook:metafield-backfill:create action.
Creates a tag governance playbook. Requires playbook:tag-governance:create action.
action is add or remove.
Runs a playbook immediately. Requires playbook:run action. Returns a new change set.

Jobs

Lists the 100 most recent execution jobs.

Staff roles

Lists all staff role assignments. Requires staff-role:manage action.
Sets a staff role. Requires staff-role:manage action.
Roles: operator, approver, executor, admin.
Removes a staff role. Cannot remove your own admin role.

Privacy exports

Lists customer data exports. Requires privacy-export:read action.
Downloads a customer data export. Requires privacy-export:read action.

Billing

Billing routes are under the /billing prefix:
POST /billing/change and POST /billing/subscribe accept {"plan": "standard"} or {"plan": "growth"}. These redirect to Shopify’s billing confirmation page.

Webhooks

The app registers these Shopify webhook topics:
  • app/uninstalled — clears credentials for the matching install generation
  • app_subscriptions/update — projects subscription state into shops
  • customers/data_request — creates an encrypted customer data export
  • customers/redact — purges customer-linked data
  • shop/redact — deletes shop data after uninstall
Privacy webhooks are registered via Shopify’s [webhooks.privacy_compliance] configuration. Pcnaid Documentation › Shopify Ecosystem › Pcnaid Safe Bulk