Run a data command
One unified surface over the brand’s data: runs a sandboxed bash command with the db verbs (db ls / db schema <table> / db find / db agg / db get / db insert / db set / db del) plus jq/grep/sort/head pipes. find and agg take --since/--until time ranges (epoch ms, ISO, or relative like 7d) on every table; agg aggregates server-side (—fn count|sum:f|avg:f|min:f|max:f, —group-by, —bucket hour|day|week|month) — the same engine behind the MCP run_data_command tool and the in-app agent. Start with db ls (tables your credential may touch) and db schema <table>. find prints NDJSON on stdout; counts and the next-page cursor arrive on stderr. Tables are permission-scoped per credential; writes are policy-gated, and a refusal names the endpoint that owns the operation. A failed COMMAND is still HTTP 200 with exitCode != 0 and the message in output — read the output, adjust, retry.
Authorizations
Send your Brew API key as Authorization: Bearer brew_xxx.
Headers
The brand this request acts on. REQUIRED for organization-scoped credentials (otherwise 400 BRAND_ID_REQUIRED — there is no default brand); list ids with GET /v1/brands. Brand-scoped credentials may omit it, and sending a different brand returns 403 BRAND_SCOPE_MISMATCH. A brand outside your organization returns 404 BRAND_NOT_FOUND.
1 - 64Body
Bash command line, e.g.: db find audiences name=vip --fields name | jq -r '.name'
1 - 4000Response
Command result. exitCode 0 = success; non-zero = the command failed (message in output).