Developer

CLI commands, JSON, and exit codes

Every registered Apex CLI command, the stable JSON envelope, exit-code meanings, and headless agent usage rules.

Use this page as the command map before scripting the CLI. The source of truth is the live apex schema --json command.

Global behavior

  • apex is the canonical binary. drip is a compatibility alias.
  • --json is available globally and on every registered command.
  • Piped stdout automatically uses JSON mode even when --json is omitted.
  • Human progress, prompts, diagnostics, and update notices go to stderr.

CLI version floor

Every v1 API response includes X-Apex-Cli-Minimum and, when known at build time, X-Apex-Cli-Latest. The minimum is advisory until server-side enforcement is enabled. When enforcement is enabled, a write from an older Apex CLI returns HTTP 426 with code cli_upgrade_required and the exact upgrade command. Read commands continue to work so agents can inspect state and recover safely.

  • apex push and apex experiments apply write one hosted asset upload line to stderr for each inline image above 4,096 characters and each referenced local image file. Pass --no-asset-upload to keep inline and local image references unchanged.
  • Do not parse human tables. Use apex schema --json to discover commands and flags.
  • apex --version --json returns the standard envelope with the package name and version in data; apex --version remains a bare version string for compatibility, including in pipes.

JSON output uses this stable top-level envelope:

json
{
  "ok": true,
  "version": "0.1.1",
  "command": "apex experiments list",
  "data": {}
}

Errors use the same envelope shape with ok: false and an error object:

json
{
  "ok": false,
  "version": "0.1.1",
  "command": "apex experiments apply",
  "error": {
    "message": "Applying these changes revokes the QA approval from 2026-10-01T12:00:00.000Z; pass --accept-qa-invalidation to confirm.",
    "code": 4,
    "details": {
      "reason": "qa_approval_present",
      "qa_approved_at": "2026-10-01T12:00:00.000Z",
      "required_acknowledgment": "accept-qa-invalidation",
      "retry": "apex experiments apply ./my-test --accept-qa-invalidation"
    }
  }
}

When filesystem apply would replace authored URL rules with a Page attachment, it returns exit 4; review the change and retry with --confirm-targeting-replace.

With --json, stdout carries exactly one JSON document and nothing else.

For commands backed by one API request, data is the API response body exactly as the API returned it: lists keep { "data": [...], "pagination": {...} }, so rows are at .data.data[], and single resources are at .data. apex experiments get adds only dashboard_url. Commands that combine several requests or local files, such as experiments create, pull, plan and apply, print a documented CLI-composed object. When an API response caused a failure, error.api carries { "status", "body" } with the API error body verbatim; error.code stays the CLI exit code. CLI 0.13.0 introduced this mirroring; earlier releases nested bodies under keys such as .data.experiment.

Headless and agent usage

bash
DRIP_API_KEY=apx_your_key_here apex schema --json
apex experiments plan ./my-test --json
apex experiments apply ./my-test --json

In headless mode:

  • Do not wait for prompts.

  • Prefer explicit --json.

  • If a command returns exit code 4, inspect error.details.retry and rerun with the exact flag only after checking the planned destructive or QA-invalidating action.

  • Never commit ~/.drip/credentials.json, API keys, or preview tokens.

  • Note: CLI experiment readback for the v1 experiment format now guarantees the presence of lifecycle timestamp fields (started_at, scheduled_start_at, and qa_approved_at) in apex experiments get / apex experiments list --full --json outputs when those fields are applicable. Integrations should read those fields from the JSON envelope to determine scheduling and QA state.

Exit codes

CodeMeaningTypical recovery
0Success.Continue.
1General failure.Read error.message and command-specific details.
2Auth or permission failure.Run apex login, set DRIP_API_KEY, or check API-key permissions.
3Validation failure.Fix arguments, JSON, config, or unsupported file content.
4Confirmation required.Inspect error.details.retry; rerun with the named flag only when intended.
5Conflict, including stale filesystem state where detected.Pull fresh state, reapply edits, and plan again.
6A check command reported a failing verdict (apex install check, apex install steps, apex shops doctor).Read error.details.failed_checks (install check), error.details.steps (install steps) or the FAIL checks; fix the storefront or configuration, then rerun.

Login and context

apex login authenticates your account once: the browser flow mints an expiring, account-scoped user key that covers every organization and shop your account can access, then lets you pick an org/shop context. Inspect the credential and everything it can reach with apex whoami; switch the stored context with apex use <org>[/<shop>] or apex use --org <org> --shop <shop>; override per invocation with --org/--shop or the DRIP_ORG/DRIP_SHOP environment variables. An environment-key run cannot persist apex use; it returns context_not_persistable with the exact DRIP_ORG/DRIP_SHOP values to export. Every JSON envelope echoes the effective context (org, shop, credential kind). Automation keeps injecting a narrow shop key per process with DRIP_API_KEY; shop and user credentials can coexist. apex login --user is a deprecated alias. Use apex logout --user to remove only the user credential; plain apex logout removes both.

Command index

The command names in this index are checked against apex schema --json by the CLI CI lane.

CommandPurpose
apex loginAuthenticate your account and pick an org/shop context.
apex logoutRemove stored credentials.
apex whoamiShow your identity, credential, and available org/shop context.
apex useSet the current Apex organization and shop context.
apex accountManage your Apex account.
apex account profileShow the current account profile.
apex account profile setUpdate the current account profile.
apex keysManage shop API keys with a user credential.
apex keys listList API-key metadata for a shop.
apex keys createCreate a shop API key and print its secret once.
apex keys revokeRevoke a shop API key.
apex webhooksManage shop webhooks.
apex webhooks listList webhooks.
apex webhooks createCreate a webhook.
apex webhooks updateUpdate a webhook URL, events, or active state.
apex webhooks deleteDelete a webhook.
apex webhooks deliveriesList webhook deliveries including failure and disabled state.
apex webhooks testSend a signed test event to a webhook.
apex simulateSimulate data-layer triggers without emitting events.
apex formsForm and checkout analytics: tracked forms, field drop-off, errors and sessions. Needs the shop's form analytics switch.
apex forms listList tracked forms with status and coverage; the Shopify checkout is listed first and tracked automatically.
apex forms addTrack a storefront form: <key> --url <page> --selector <css> and exactly one of --complete-on-goal, --complete-on-page or --complete-on-call.
apex forms removeStop tracking a storefront form; its history stays readable for 30 days. The checkout cannot be removed.
apex forms summaryViews, starters, completions, abandons, checkout steps and lost revenue with its basis; filter with --range, --split, --device, --country.
apex forms fieldsPer-field time, returns, error share and drop-off; --format takes csv, json or table.
apex forms errorsValidation errors by field and type with sessions and the share abandoned after; text shows only once seen in 20 sessions.
apex forms sessionsRecent form sessions as field paths (never typed values); filter with --outcome, --with-replay, page with --cursor.
apex forms fieldOne field's daily trend, time histogram, devices and errors.
apex forms labelGive a field identity a readable label, or --clear it.
apex forms mergeReport a retired field identity under the field that replaced it.
apex forms unmergeUndo a field merge.
apex forms detectFind the forms on one of the shop's pages (field metadata only) to pick a selector for apex forms add.
apex surveysManage surveys.
apex surveys listList surveys; filter with --status <s>.
apex surveys getGet a survey by ID.
apex surveys createCreate a survey from inline JSON, @file, a file path, or --file <path>; use one input form. See the survey body example below.
apex surveys updateUpdate a survey by ID from inline JSON, @file, a file path, or --file <path>; use one input form. See the survey body example below.
apex surveys startStart a survey; publication warnings print to stderr.
apex surveys pausePause a survey.
apex surveys completeComplete a survey.
apex surveys duplicateDuplicate a survey.
apex surveys deleteDelete a draft or completed survey; live and paused surveys return conflict exit code 5.
apex experimentsManage experiments.
apex experiments listList code-free summaries by default; filter effective targeting server-side with --url <absolute-url>, use --fields <list> for selected columns, or --full for full details.
apex experiments getGet experiment details by ID or slug. JSON readback always carries started_at, scheduled_start_at and qa_approved_at as ISO-8601 UTC timestamps or null (all null on a fresh draft).
apex experiments resultsRead experiment results and timeseries by ID or slug.
apex experiments updateUpdate an experiment
apex experiments createCreate a complete experiment with page targeting, audiences, goals, and an optional QA preview URL. JSON readback always carries started_at, scheduled_start_at and qa_approved_at as ISO-8601 UTC timestamps or null (all null on a fresh draft).
apex experiments attach-ideaAttach an experiment to an idea.
apex experiments detach-ideaDetach an experiment from its idea.
apex experiments pausePause a running experiment.
apex experiments completeComplete or stop an experiment.
apex experiments deleteDelete an experiment.
apex experiments pullPull the complete versioned experiment filesystem and its local receipt.
apex experiments statusRead context, versions, QA, and handover next steps without writing.
apex experiments planPlan experiment filesystem changes.
apex experiments applyApply experiment filesystem changes to Apex; receipt files include submitted and stored digests and the named normalisation list.
apex experiments screenshotsForce-assign every capture, including control, to its variation server-side, attach before/after QA evidence, and download files with before- / after- prefixes. Use --no-label-pairs for legacy filenames.
apex experiments qaManage experiment QA runs from the CLI.
apex experiments qa statusShow the latest experiment QA run (creates one only when none exists; reads never change updatedAt).
apex experiments qa probeRun saved commerce QA probes, or read evidence with --saved.
apex experiments qa eventsList QA-tagged goal and custom events for a QA session.
apex experiments qa checkUpdate one QA checklist item with status, notes, and evidence.
apex experiments qa notesUpdate QA run notes or acceptance criteria summary.
apex experiments qa approveApprove QA and move to ready_to_launch; qa reopen returns it to QA.
apex experiments qa reopenReopen QA and clear scheduled launch state.
apex experiments qa evidenceAttach screenshot jobs or upload typed QA evidence.
apex resultsImport and read past test results.
apex results importInspect, preview, and import CSV or JSON result files.
apex results listList imported and native past results, with source filters and pagination.
apex results getRead one past result by legacy ID or UUID.
apex results deletePermanently remove one imported past result after confirmation.
apex commerceCommerce catalog and price tools.
apex commerce catalogLook up products for commerce drafts.
apex commerce catalog searchSearch the commerce product catalog.
apex commerce catalog getGet one product and its variants.
apex commerce priceRead and bulk-edit selection prices.
apex commerce price exportExport effective prices as CSV.
apex commerce price importImport price overrides with revision checks.
apex commerce definitionRead and save the canonical commerce definition.
apex commerce definition getRead a commerce.json definition envelope.
apex commerce definition putSave a commerce.json definition with revision checking.
apex pushPush experiment definitions from config to the API.
apex previewOpen a QA preview URL for an experiment variation; proxy previews return a QA run receipt.
apex roadmapWork with approved roadmap ideas and build handoffs.
apex roadmap approvedList approved roadmap ideas ready to build in Apex.
apex roadmap handoffGet apex.roadmap_handoff.v1 JSON: contract, schema_version, item, experiment, instructions, goals, mockups, acceptance_criteria, harness, scoring, source, metadata.
apex harnessDevelop AB Test Harness projects through Apex live QA sessions.
apex harness initCreate apex.harness.json for a harness folder.
apex harness devBuild, upload, preview, and watch a harness folder.
apex harness publishVerify, build, upload, and publish a harness artifact.
apex workspaceCheck out, preview, and publish Apex draft workspace files.
apex workspace checkoutCheck out an Operator workspace for one variation.
apex workspace statusShow changed local workspace files.
apex workspace devUpload one preview version or watch workspace files.
apex workspace publishBuild and publish changed workspace files back to Apex.
apex trackingCreate tracking ingestion manifests and QA handoffs.
apex tracking healthRead the shop's tracking-health checks (install, events, orders linked, currency, exposure, SRM by device, selectors, snippet size, settings changes); exits 0 for pass, 1 for warn or fail, 3 for unknown.
apex tracking inspectCreate a local tracking manifest from funnel URLs; its output path is relative to the current directory.
apex tracking planPrint the implementation plan from a tracking manifest path relative to the current directory.
apex tracking qaPrint the QA checklist for a tracking manifest path relative to the current directory.
apex tracking verifyVerify live tracking events, filter by --event-type, and preview event properties.
apex tracking latencyCompare forced-preview and natural page-load decision latency before launch (init events only, excluding route changes); accepts an experiment ID or key, --days (1–30), and --qa-session.
apex tracking manifestPrint the shop's tracking manifest, including its tracked forms (key, type, selector, completion rule).
apex eventsExport raw tracking events.
apex events exportExport every raw event in a window of at most 31 days that does not end in the future, with automatic pagination.
apex goalsManage conversion and revenue goals.
apex goals listList goals.
apex goals createCreate a goal.
apex goals updateUpdate a goal.
apex goals testDry run a goal URL pattern against traffic.
apex goals suggestSuggest goals and funnels from analytics.
apex funnelsManage analytics funnels.
apex funnels listList funnels.
apex funnels createCreate a funnel.
apex funnels updateReplace a funnel's steps.
apex funnels deleteDelete a funnel.
apex funnels runRun funnel analysis.
apex funnels validateValidate funnel steps without writing.
apex environmentsManage runtime environments and domain mappings.
apex environments listList runtime environments and mapped domains.
apex environments set-domainMap a domain to a runtime environment.
apex environments remove-domainRemove a domain mapping.
apex consentManage consent gating.
apex consent getShow consent settings.
apex consent setEnable and configure consent gating.
apex consent offDisable consent gating.
apex triggersManage data-layer triggers and temporary setup capture.
apex triggers getRead the shop's runtime triggers.
apex triggers setReplace the shop's runtime triggers from a JSON file.
apex triggers proposePropose candidate triggers from a discovery report.
apex triggers apply-recipeApply a server-owned trigger recipe.
apex triggers enable-captureEnable temporary setup capture.
apex triggers disable-captureDisable setup capture and clear its expiry.
apex project-codeInspect and safely change shop project code.
apex project-code getRead complete code and its opaque version.
apex project-code diffPreview a partial JSON change without writing.
apex project-code setCreate a backup before a version-checked write.
apex domainsManage install domains and landing-page domains.
apex domains listList install domains.
apex domains addAdd install domains.
apex domains removeRemove install domains.
apex domains setReplace install domains.
apex domains claimClaim a client hostname for landing pages; prints the CNAME to the Apex edge (--wait checks for up to two minutes).
apex domains registerRegister a new domain on the Drip Cloudflare account after a price confirmation (--confirm-price without a terminal).
apex domains statusList landing-page domains, or check one hostname now.
apex domains unclaimRemove a landing-page domain from Apex; a registered domain stays on the Drip account.
apex handoverManage cross-domain identity handover.
apex handover getShow cross-domain handover settings.
apex handover setEnable cross-domain identity handover.
apex handover offDisable cross-domain handover.
apex handover qaCheck static link/form handover parameter carriage.
apex analyticsRead shop analytics with a secret API key.
apex analytics order-journeyInspect bounded, read-only order evidence and attributed-goal eligibility.
apex analytics statsShow dashboard analytics stats.
apex analytics timeseriesShow analytics timeseries.
apex analytics trafficShow traffic sources.
apex analytics pagesShow page analytics.
apex analytics geoShow geography and device analytics.
apex analytics sessionsShow session analytics.
apex analytics realtimeShow realtime analytics.
apex analytics entry-exitShow entry and exit page analytics.
apex analytics consent-rateEstimate analytics consent acceptance from visitor series.
apex analytics urlsShow storefront URL inventory from pageview analytics.
apex installCheck Apex storefront installation.
apex install assessAssess a public storefront URL and draft an installation assessment and client guide. --shop <id> fills the snippet shop ID; --format selects text, Markdown or JSON.
apex install kitGenerate a ready-to-send installation guide as Markdown or JSON.
apex install checkVerify snippet, served config (including purchase triggers), and recent tracking. --shop-id also selects the shop for API requests; otherwise the selected shop or DRIP_SHOP_ID is used.
apex install stepsShow each installation step (script, consent, test environments, orders, firewall access) with when Apex first and last saw it; exits 6 while a step is waiting. --live also checks the storefront page and firewall access.
apex flagsManage flags.
apex flags listList flags.
apex flags getGet a flag.
apex flags statusCheck whether a flag publication is live at the edge.
apex flags createCreate a flag.
apex flags updateUpdate a flag.
apex flags update-codeEdit On variant JS/CSS from files with an optimistic version check.
apex flags rulesReplace or reorder audiences.
apex flags rules setReplace the live audience list and archive omissions.
apex flags rules reorderReorder all live audiences with a parent version check.
apex flags experiencesManage rule experiences.
apex flags experiences createCreate a rule experience from JSON.
apex flags experiences updateUpdate a rule experience from JSON.
apex flags experiences deleteDelete an experience when no active or historical rule references it.
apex flags activateActivate a flag.
apex flags pausePause a flag.
apex flags archiveArchive a flag.
apex backlogManage backlog.
apex backlog listList backlog items identified as apex.backlog_item.v1.
apex backlog getGet a backlog item identified as apex.backlog_item.v1.
apex backlog createCreate a backlog item.
apex backlog updateUpdate a backlog item.
apex backlog archiveArchive a backlog item with a decline reason.
apex backlog restoreRestore an archived backlog item.
apex backlog deletePermanently delete a backlog item after confirmation.
apex backlog fieldsManage the shop's own idea fields.
apex backlog fields listList the shop's idea fields.
apex backlog fields createAdd an idea field.
apex backlog fields updateUpdate an idea field.
apex backlog fields archiveArchive an idea field; values already on ideas are kept.
apex signalsManage signals.
apex signals listList signals; pass --include-archived to include archived signals.
apex signals getGet a signal.
apex signals createCreate a signal.
apex signals updateUpdate a signal.
apex signals deleteDelete or archive a signal.
apex personalizationsManage personalizations.
apex personalizations listList personalizations.
apex personalizations getGet a personalization.
apex personalizations createCreate a personalization.
apex personalizations updateUpdate a personalization.
apex personalizations activateActivate a personalization.
apex personalizations pausePause a personalization.
apex personalizations archiveArchive a personalization.
apex external-pixelsManage external pixel integrations.
apex external-pixels snippetGenerate an external purchase pixel snippet.
apex assetsManage assets.
apex assets listList assets.
apex assets getGet an asset.
apex assets uploadUpload an asset file.
apex assets deleteDelete an asset.
apex landing-pagesBuild landing pages with your own tools, then deploy, track and test them with Apex.
apex landing-pages listList landing pages.
apex landing-pages getGet a landing page.
apex landing-pages createCreate a landing page to build outside Apex.
apex landing-pages pullPull a landing page into a checkout folder.
apex landing-pages planShow what applying a checkout would change.
apex landing-pages applyApply a checkout as a new version.
apex landing-pages previewPrint a signed preview link (valid 24 hours).
apex landing-pages deployDeploy a version to the shop's apex-page.com address or a domain it holds.
apex landing-pages versionsList versions.
apex landing-pages rollbackDeploy an earlier version to the page's current address.
apex landing-pages experimentCreate a draft experiment that splits the live page between two versions.
apex landing-pages openPrint the page's dashboard URL.
apex pagesManage pages.
apex pages listList pages.
apex pages createCreate a page; --help lists body keys, pattern shapes contradicting match_type fail with match_type_mismatch unless --literal is passed, and apex schema --json carries the body schema.
apex pages updateUpdate a page; --help lists body keys, pattern shapes contradicting match_type fail with match_type_mismatch unless --literal is passed, and apex schema --json carries the body schema.
apex pages deleteDelete a page.
apex segmentsManage segments.
apex segments listList segments.
apex segments createCreate a segment.
apex segments updateUpdate a segment.
apex segments deleteDelete a segment.
apex exclusion-groupsManage exclusion groups.
apex exclusion-groups listList exclusion groups.
apex exclusion-groups getGet an exclusion group.
apex exclusion-groups createCreate an exclusion group; --help shows the request body and apex schema --json exposes it under the command's body key.
apex exclusion-groups updateUpdate an exclusion group with the same documented body shapes.
apex exclusion-groups deleteDelete an exclusion group after confirmation; use --force in non-interactive environments.
apex exclusion-groups replace-membersReplace exclusion group members.
apex brandPrint shop brand context for external agents.
apex targetingTest experiment targeting.
apex targeting testEvaluate experiment URL targeting for a page.
apex audit-logInspect sensitive audit logs.
apex audit-log listList audit logs with entity filters and offset pagination.
apex inboxRead and send inbox messages.
apex inbox listList account or experiment inbox messages.
apex inbox sendSend an account or experiment inbox message.
apex inbox mark-readMark one inbox channel, or all channels, read.
apex shopsManage organization shops.
apex shops listList organization shops.
apex shops getGet a shop.
apex shops createCreate a shop.
apex shops updateUpdate a shop.
apex shops doctorCheck shop configuration and the three-state purchase-capture battery against observed analytics.
apex shops auto-stopRead or update auto-stop defaults.
apex shops testing-defaultsRead or update testing defaults.
apex shops guardianRead or update guardian defaults.
apex shops store-profileRead and review a store profile.
apex shops store-profile getRead the store profile.
apex shops store-profile review-factReview a store-profile fact.
apex shops store-profile review-findingReview a semantic finding.
apex shops store-profile start-learning-runStart a store-profile learning run.
apex shops shopwareManage Shopware bindings.
apex shops shopware prebindBind a Shopware store URL before installation.
apex discoverRead observed tracking shapes and optionally mine a public GTM container.
apex schemaPrint the CLI command, flag, and mandatory-option schema and the bundled experiment filesystem file contract.
apex skillsPrint or install Apex CLI agent skill files.
apex orgManage the organization bound to the user credential (apex orgs is an alias).
apex org getGet organization details.
apex org updateUpdate organization settings.
apex org membersList organization members.
apex org inviteInvite an organization member; the default shop role is editor (workspace defaults are internal roles).
apex org revoke-inviteRevoke an organization invitation.
apex org set-roleChange an organization member role.
apex org suspend-memberSuspend an organization member immediately; accepts --reason and requires confirmation unless --force is passed.
apex org reinstate-memberReinstate a suspended organization member; requires confirmation unless --force is passed.
apex org remove-memberRemove an organization member after confirmation.
apex teamManage shop-scoped team membership (apex teams is an alias).
apex team membersList members for --shop or the selected shop.
apex team inviteInvite a member to --shop or the selected shop as editor or client_viewer (Viewer). --design-approver also lets them sign off designs once they accept (a Viewer with it is a Client approver); it needs store owner or admin rights.
apex team revoke-inviteRevoke a shop invitation.
apex team set-roleChange a shop member role to editor or client_viewer (Viewer).
apex team removeRemove a shop member after confirmation.
apex notificationsManage notification settings.
apex notifications readyConfigure Ready to launch email recipients and the existing Slack event switch.
apex notifications ready getRead email and Slack settings for --shop or the selected shop.
apex notifications ready emailChoose current shop members to receive ready emails.
apex notifications ready email setReplace recipients using --recipients a@example.com,b@example.com.
apex notifications ready email addAdd current shop members by email.
apex notifications ready email removeRemove current shop members by email.
apex notifications ready email offClear the email recipient list.
apex notifications ready slackSelect the ready event on an existing Slack destination.
apex notifications ready slack onEnable the ready event; preserve other events and the destination pause state.
apex notifications ready slack offDisable only the ready event.
apex upgradeInstall the latest Apex CLI (--dry-run prints the command).

Survey body example

Save this body as survey.json, then use apex surveys create --file survey.json or apex surveys update <id> --file survey.json. Both commands also accept the body as inline JSON, @survey.json, or a positional file path. Providing a positional body together with --file is an error.

json
{
  "name": "Product feedback",
  "questions": [{
    "type": "single_choice",
    "prompt": "What would help you decide?",
    "options": [{"label": "More details"}, {"label": "Reviews"}, {"label": "Delivery info"}]
  }],
  "targeting": {"url": [{"type": "simple", "pattern": "/products/", "matchType": "contains"}]},
  "sampling_rate": 0.5,
  "frequency_cap": "once_per_visitor",
  "card_style": "quiet",
  "answer_goal": 100
}

On create, name is required. Server defaults: questions: [] (each question's required: true), targeting: null (all pages/visitors), sampling_rate: 1, frequency_cap: "once_per_visitor", card_style: "quiet", answer_goal: null, environment_key: "production", placement: "sdk_page", active_from: null, and active_to: null. Update accepts a partial body and keeps omitted fields unchanged. Run apex surveys create --help or apex surveys update --help for field limits and supported values.

Platform administrator commands

These commands require a platform user API key and are intentionally excluded from the public command index.

CommandPurpose
apex admin shops archive <shopId>Archive a shop and disable Apex delivery; use --force in non-interactive environments.
apex admin shops restore <shopId>Restore an archived shop while leaving its runtime kill switch unchanged.
apex admin shops settings list --shop <uuid-or-domain>Read every registered per-shop setting, value, override and group with a platform user API key.
apex admin shops settings get --shop <uuid-or-domain> --key <key>Read one setting; unknown keys list the available registry keys.
apex admin shops settings set --shop <uuid-or-domain> --key <key> --value <value>Resolve and pin the shop, then make an audited write. Booleans accept on/off/true/false; numbers must be finite; null clears nullable settings. Sensitive writes require --confirm; optional --reason and --expected-version preserve audit context and concurrency.

Analytics reads

apex analytics requires a secret API key with analytics:read (or analytics:*). Publishable keys cannot access shop analytics. Windowed commands accept --days; pages also accepts --limit. All commands support the standard --json envelope.

Project code

sh
apex project-code get --shop example.com --json
apex project-code diff --file project-code.json --shop example.com --json
apex project-code set --file project-code.json --shop example.com --backup previous-code.json --json

The input is a partial projectCode object, for example { "css": "body { color: red; }" }. Supported fields are enabled (boolean) and css, helperJs, and js (strings or null). Each code field permits at most 20,000 characters. Omitted fields remain unchanged. Null or blank code clears that field. Unknown fields and empty objects are rejected.

GET returns complete code, shop identity, and an opaque version. DIFF returns effective before/after values and changed fields without writing. SET creates a new backup file with complete previous code, identity, capture time, and the exact version before PATCH. It never replaces an existing backup. Backup failures prevent the write. An effective no-op returns unchanged, without a PATCH or backup file.

The backed-up version becomes expectedVersion unchanged. A conflict returns exit 5, keeps the backup, and does not retry. Read the latest state and preview it before a new attempt with a new backup path. Authentication uses exit 2; invalid input uses exit 3. A successful write returns saved, its diff, backup path, current version, writtenVersion, and precompile result. A failed precompile is a saved-write warning. All warnings remain in JSON and are also written to stderr. User keys resolve domains or pin UUID context; shop keys must match the requested identity before any backup or write.

Order journey diagnostics

apex analytics order-journey --platform shopware --order-id <id> --environment production --from <iso> --to <iso> requires a secret or authorized user key with analytics:read. Use --order-number instead of --order-id, never both. The interval is at most 31 days. --include-qa includes QA in eligibility; bots remain excluded.

--json retains the sanitized report, every represented assignment, source availability, coverage and the integration verdict. Exit 0 means the diagnostic was fetched, even when its verdict is fail or inconclusive. Eligibility means only eligible_for_attributed_goal_read, with basis attributed_goal_counts. Final statistical contribution is not_evaluated. Unknown consent, freshness, missing evidence and failed reads never mean zero or healthy. No proof file is saved.

Order journey diagnostics report current, stale, or unknown freshness for each retained receipt and assignment. Present attributed-goal reads identify their evaluated snapshot; they do not establish historical contribution or repair missing producer evidence.

Error recovery and update notices

JSON errors keep the numeric error.code exit code and add error.reason, error.next_steps (an array of { command, why }), and optional error.request_id. The request ID comes from x-request-id, falling back to x-vercel-id (the Apex app) and then cf-ray; include it when reporting an API failure. API-provided reason codes are preserved verbatim. Otherwise reasons are auth_required, auth_forbidden, shop_context_required, shop_context_mismatch, install_check_failed, validation_failed, feature_disabled, confirmation_required, conflict, not_found, rate_limited, network_timeout, network_connect_timeout, network_dns, network_refused, network_reset, network_tls, network_unknown, local_file_error, or internal_error.

Inspect next_steps for login, key permissions, shop selection, network settings, folder validation, disabled-feature contacts, request-field issues, or rate-limit recovery. Body validation failures carry per-field issues in error.details.issues; disabled features name their shop setting. Steps are suggestions, never automatic approval to retry a write. Confirmation errors retain error.details.retry. Human output prints recovery steps as Next: lines on stderr and request IDs on the error line. Trigger commands now follow the same exit codes as every other command: authentication failures exit 2 (previously 4), invalid local input exits 3 (previously 2), and other API failures follow their HTTP status (validation 3, conflict 5, anything else 1). The TRIGGERS_AUTH, TRIGGERS_CONFIG_ABSENT and TRIGGERS_NO_DATA verdict prefixes are unchanged, so scripts can key on them instead of exit codes.

Every JSON envelope may carry update and warnings. The update object includes current, latest, optional minimum, required, breaking, command, and notes_url; warnings use { code, message }. The exact install command is npm install -g @drip-apex/apex-cli@latest, and apex upgrade runs it (--dry-run only prints it). Set APEX_NPM_BIN to choose the npm binary.

The npm latest version is cached for 24 hours (failed lookups for one hour). Server latest/minimum policy is cached for seven days, so offline commands still enforce a known floor. APEX_NO_UPDATE_CHECK=1 disables the npm lookup and optional update notice, but never hides a required server-floor upgrade.

Tracking verification limits

apex tracking verify reads at most 200 of the newest events from a window of at most 7 days. When the limit is reached, truncated is true and totals describe that sample only. The response includes the exact from, to, minutes, and limit window.

Commerce catalog

  • apex commerce catalog search [query] [--cursor <cursor>] [--limit <1-10>]
  • apex commerce catalog get <handle> [--cursor <cursor>]
  • apex commerce catalog get --product-id <id> [--cursor <cursor>]

Use --json for the complete API envelope. Human output lists variant GID, title, SKU, price, cost (unknown when absent), and price-test exclusion.

Commerce results output

Human-readable experiment results show a Profit per visitor (CM1) section for commerce tests and checkout-owned tests with attributed orders. Null money prints as -; degraded reads print their reason and never imply measured zeroes. JSON output preserves the API's commerce_results field unchanged, including pending_days, plane, decision_grade, and confidence_visible.

Checkout-owned tests measure orders from visitors who saw the checkout message and receive the supplementary CM1 section when they have attributed orders. Other non-commerce tests return commerce_results: null. An unavailable supplementary section on a checkout-owned test does not mark the analytics as degraded.

Import past test results

apex results import --file <path> uploads one or more CSV or JSON files, inspects their columns, and prints a deterministic preview before confirmation. Use --dry-run to stop after preview and --yes for non-interactive confirmation. --json preserves full learning text and returns the preview envelope for dry runs or merged { imported, skipped, test_results } totals after import.

Read past test results

apex results list [--source import|native|all] [--limit <n>] [--all] [--json] lists past results for the selected shop (default source all, page size 50, maximum 200). Use --all to follow every page. The table shows legacy ID (or UUID), title, outcome, metric, lift, sample size, dates, and source. Empty lists print No test results.

apex results get <legacy-id-or-id> [--json] opens a result by legacy ID, test key, or UUID, including its full learning, confidence, dates, page, and device. Missing results exit with code 1 through the existing API failure path. Both commands use shop or user keys with experiments:read and verify each row belongs to the selected shop. Imports show their source name and original date range, falling back to import time; native results show source apex and creation time.

apex results delete <legacy-id-or-id> [--yes] [--json] permanently removes one imported result with experiments:write. It first reads and previews the title, outcome, dates, source, and legacy ID. Native results are refused locally (exit 3). Confirm the prompt or pass --yes; non-TTY callers without --yes receive exit 4 with the exact rerun hint. Removed results cannot be restored in Apex; the full record remains in the audit log. JSON output wraps the API { data } response and verifies the echoed shop.

JSON uses the standard CLI envelope: its data contains { data, pagination } for lists (merged rows and final pagination with --all) or { data: result } for a single result. Invalid --source or --limit exits 3 before an HTTP request.

Asset delivery URLs

apex assets upload <file> returns delivery_url; embed that permanent URL in variation code. The public_url is a signed read URL for the API caller and expires after 300 seconds. Never embed it. Delivery is anonymous once the referencing experiment or snippet is published, and resolves through the owning shop's dashboard session or a QA preview before that. Only the absolute https form is recognized as an owned reference; protocol-relative or http forms are not granted at publication.

See Commerce prices for CSV export, import, and revision semantics.