cargo-storage
getcargohq/cargo-skills
Inspect and modify Cargo workspace data models, columns, relationships, and run SQL queries.
What is cargo-storage?
Manage the data layer of a Cargo workspace: create and update models (Companies, Contacts, Deals, etc.), define columns and relationships, merge duplicate records, and execute SQL queries against workspace storage. Use this when you need to work with business data structure and content—not workflow orchestration or audience segmentation.
- List, inspect, and create models, datasets, columns, and relationships
- Query workspace storage with SQL (SELECT, JOIN, aggregations, pagination)
- Add, update, and remove columns with typed schemas (string, number, date, object, vector, etc.)
- Set up webhook-fed ingest models to receive records from external systems
- Merge duplicate accounts and link records across models
- Export query results to files
How to install cargo-storage
npx skills add https://github.com/getcargohq/cargo-skills --skill cargo-storage- @cargo-ai/cli installed globally or via npx
- Cargo account (sign in with `cargo-ai login --email`, `--oauth`, or API token)
- Active workspace (verify with `cargo-ai whoami`)
How to use cargo-storage
- 1.Run `cargo-ai storage model list` to see all models in your workspace
- 2.Run `cargo-ai storage model get <model-uuid>` to inspect a model's columns and schema
- 3.Run `cargo-ai storage query execute "SELECT * FROM default.companies LIMIT 10"` to query data
- 4.To add a column, run `cargo-ai storage column create --model-uuid <uuid> --column '{...}'` with the column definition
- 5.To set up a webhook-fed model, retrieve the webhook URL from the model settings or assemble it from `baseUrl` and API token, then POST records to it
Use cases
- Discover what models and columns exist in your workspace schema
- Add a new column to track additional contact information
- Query how many active deals are in your pipeline with SQL
- Join contacts to companies to see relationships
- Set up a webhook to ingest records from an external tool like Calendly or Smartlead
- Data analysts querying workspace data
- Workspace admins managing schema and data structure
- Developers integrating external data sources via webhooks
- Anyone building workflows that depend on understanding data relationships
cargo-storage FAQ
The webhook URL is shown in the app's model settings screen. Via CLI, assemble it as `<baseUrl>/v1/models/<model-uuid>/records/ingest?token=<api-token>` using values from `cargo-ai whoami` and `cargo-ai workspaceManagement token list`.
cargo-storage manages business data (models, columns, records, queries). cargo-orchestration handles workflow runs and batch telemetry. Use cargo-storage for data structure and content; use cargo-orchestration for run/batch monitoring.
No. Use cargo-segmentation to define reusable filtered audiences. cargo-storage is for raw data queries and schema management.
The underlying storage can be BigQuery or Snowflake. Check the model's DDL with `cargo-ai storage model get-ddl <model-uuid>` to see which dialect is in use before writing queries.
Use `cargo-ai storage query download --query "SELECT ..."` to export full result sets. For smaller previews, use `cargo-ai storage query execute` which prints JSON to stdout.
Full instructions (SKILL.md)
Source of truth, from getcargohq/cargo-skills.
name: cargo-storage
description: "Work with the data inside a Cargo workspace — models (Companies, Contacts, Deals…), datasets, columns, relationships, records, and SQL over workspace storage. Triggers: "what models do I have", "show me the schema", "add a column for", "how many contacts do I have", "SELECT … FROM", "query my companies table", "join contacts to companies", "what is the DDL", "set up a webhook-fed model", "where does this field live", "import this into a model", "unify these models", "merge duplicate accounts", "link contacts to companies", "set up a relationship between". Skip when: querying run or batch telemetry rather than business data — use cargo-orchestration; naming a reusable filtered audience — use cargo-segmentation."
version: "1.2.3"
compatibility: Requires @cargo-ai/cli (npm). Sign in or create an account with cargo-ai login --email (emailed code, no browser), --oauth, or an API token
homepage: https://github.com/getcargohq/cargo-skills
metadata:
author: getcargo
openclaw:
requires:
bins:
- cargo-ai
install:
- kind: node
package: "@cargo-ai/cli@latest"
bins:
- cargo-ai
homepage: https://github.com/getcargohq/cargo-skills
Cargo CLI — Storage
Data layer management: inspecting and modifying models, datasets, columns, relationships, unification, and records, and running SQL queries against workspace storage.
See
references/response-shapes.mdfor full JSON response structures. Seereferences/troubleshooting.mdfor common errors and how to fix them. Seereferences/examples/models.mdfor model CRUD, DDL inspection, and schema discovery examples. Seereferences/examples/datasets.mdfor dataset listing and navigation examples. Seereferences/examples/columns.mdfor column creation and management examples. Seereferences/examples/queries.mdforstorage query execute/storage query downloadSQL examples (WHERE, aggregations, joins, pagination, exports). Seereferences/examples/ingest-webhook.mdfor ingest (webhook-fed) models — deriving the webhook URL and POSTing records.
Bootstrap
Already signed in (cargo-ai whoami returns a workspace)? Skip to the next section.
npm install -g @cargo-ai/cli # no global install? prefix every command with `npx @cargo-ai/cli`
cargo-ai login --email you@company.com # emailed code, no browser; creates the account on first use
# alternatives: --oauth (browser) · --token <api-token> (CI)
cargo-ai whoami # confirm the active workspace before any write
Every command prints JSON to stdout; failures exit non-zero with {"errorMessage": "..."}. Anything that creates a run or a batch is async — pass --wait-until-finished or poll the matching get. When the full skill bundle is installed, ../cargo/references/prerequisites.md adds the CLI version pin, token scopes, and the admin-only surface.
Discover resources first
Always list before inspecting or modifying.
cargo-ai storage dataset list # all datasets (uuid, slug)
cargo-ai storage model list # all models (uuid, name, slug, columns, datasetUuid)
# `model list` takes no flags — filter its output instead:
cargo-ai storage model list | jq '[.models[] | select(.datasetUuid == "<uuid>")]'
Retrieve in the UI: models live at app.getcargo.io/workspaces/<WORKSPACE_UUID>/models/<MODEL_UUID>. Get <WORKSPACE_UUID> from cargo-ai whoami under workspace.uuid.
Quick reference
cargo-ai storage model list
cargo-ai storage model get <model-uuid>
cargo-ai storage model get-ddl <model-uuid>
cargo-ai storage dataset list
cargo-ai storage column list --model-uuid <uuid>
cargo-ai storage relationship list
cargo-ai storage record list --model-uuid <uuid>
cargo-ai storage query execute "SELECT * FROM default.companies LIMIT 10"
cargo-ai storage query download --query "SELECT * FROM default.companies"
Models
Models are structured tables in your workspace (e.g. Companies, Contacts).
# List all models
cargo-ai storage model list
# List models in a dataset — every model carries `datasetUuid`, and
# `model list` has no flags of its own, so filter client-side
cargo-ai storage model list | jq '[.models[] | select(.datasetUuid == "<uuid>")]'
# Get a single model (includes columns)
cargo-ai storage model get <model-uuid>
# Get the DDL (full schema, table name and SQL dialect)
cargo-ai storage model get-ddl <model-uuid>
# → Useful for column discovery and SQL dialect (BigQuery vs Snowflake) before writing queries
# Create a model
cargo-ai storage model create \
--slug contacts \
--name "Contacts" \
--dataset-uuid <uuid> \
--extractor-slug <extractor-slug> \
--config '{}'
# Update a model
cargo-ai storage model update --uuid <model-uuid> --name "New Name"
# Remove a model
cargo-ai storage model remove <model-uuid>
Querying: Use cargo-ai storage query execute "<sql>" (or storage query download --query "<sql>" for full exports) to run SQL against storage. Tables are referenced as <datasetSlug>.<modelSlug> (e.g. default.companies) and rewritten to the underlying storage table under the hood. See Query with SQL below.
Ingest models (webhook-fed)
A model whose extractor has mode.kind === "ingest" — http.listenHook and
friends — is filled by pushing records to Cargo. The app shows a "Webhook URL"
on the model settings screen; no CLI command or API field returns it, but it's
assembled from values the CLI already exposes:
<baseUrl>/v1/models/<model-uuid>/records/ingest?token=<api-token>
MODEL_UUID=<model-uuid>
BASE=$(cargo-ai whoami | jq -r '.baseUrl')
TOKEN=$(cargo-ai workspaceManagement token list | jq -r '.tokens[0].token')
echo "$BASE/v1/models/$MODEL_UUID/records/ingest?token=$TOKEN"
Not for workflows. A Cargo workflow writes to a model with the native
modelUpsert / modelInsert action (see cargo-orchestration →
references/nodes.md → "Storage"). An HTTP node calling this URL costs an extra node,
a payload script, and an API token pasted into the node config. The webhook is for
systems outside Cargo.
Check the extractor's mode first — when it reports "autoIngest": true (calendly,
smartlead, instantlyV2, heyReach, cargo signals) Cargo registers the
hook with the provider itself and the URL must not be handed out. Full flow,
payload shapes, and limits: references/examples/ingest-webhook.md.
Datasets
Datasets are logical groupings of models.
# List all datasets
cargo-ai storage dataset list
# Get a single dataset
cargo-ai storage dataset get <dataset-uuid>
Columns
Columns define the schema of a model.
# List columns for a model
cargo-ai storage column list --model-uuid <uuid>
# Create a column
cargo-ai storage column create \
--model-uuid <uuid> \
--column '{"slug":"my_column","type":"string","label":"My Column","kind":"custom"}'
# Update a column (pass the full column object — columns are identified by slug, not UUID)
cargo-ai storage column update \
--model-uuid <uuid> \
--column '{"slug":"my_column","type":"string","label":"Updated Label","kind":"custom"}'
# Remove a column
cargo-ai storage column remove --model-uuid <uuid> --column-slug <slug>
# Reorder a column (move to a specific index)
cargo-ai storage column reorder --model-uuid <uuid> --column-slug <slug> --to-index 2
Column types: string, number, boolean, date, object, array, vector, any.
Column kinds: custom (user-defined), computed (expression over other columns), metric (aggregated from a related model), lookup (single field pulled from a related model via a join).
Preview what you built
A column list doesn't tell the user whether the model is right — rows do. Two checkpoints (the pack-wide convention lives in ../cargo/references/interaction.md §4):
1. Right after model create / column create — show the schema, not rows. A new model is empty; a LIMIT 10 here returns nothing and reads as failure. Echo the columns as a compact table instead (column, type, what will fill it).
2. As soon as data lands — show the rows. After a batch, play, or import writes into the model, preview it:
cargo-ai storage query execute \
"SELECT * FROM <dataset-slug>.<model-slug> LIMIT 10"
Show ~10 rows and only the columns that carry meaning. Storage queries are free, so this costs nothing but a few lines of output — and it's the first moment the user can actually see what they built. When a play fills a new column, preview that column next to the record's identifying fields (name, domain) so filled vs. empty is obvious.
If the preview comes back empty or all-null when it shouldn't, that's a finding — surface it rather than reporting the write as a success. See cargo-diagnostics to trace why.
Relationships
Relationships link models together (e.g. Contacts belong to Companies). They are authored from the CLI, not just the UI.
relationship list takes no flags — it returns every relationship in the
workspace. Filter client-side on fromModelUuid / toModelUuid.
cargo-ai storage relationship list
relationship set replaces the dataset's whole relationship set. It takes a
dataset and the complete list that should exist within it: entries carrying a
uuid are updated, entries without one are created, and any existing
relationship whose uuid is absent from the payload is deleted. Sending one
relationship to a dataset that has five removes the other four. Always list
first, then send back the full array with your addition:
cargo-ai storage relationship set \
--dataset-uuid <dataset-uuid> \
--relationships '[
{"uuid":"<existing-uuid>","fromModelUuid":"<contacts-uuid>","fromColumnSlug":"account_id","toModelUuid":"<companies-uuid>","toColumnSlug":"id","relation":"manyToOne"},
{"fromModelUuid":"<deals-uuid>","fromColumnSlug":"company_id","toModelUuid":"<companies-uuid>","toColumnSlug":"id","relation":"manyToOne"}
]'
relation is oneToOne, manyToOne, or oneToMany. Both models must live in
the dataset you pass — relationships never span datasets, so fromDatasetUuid
and toDatasetUuid on the response always equal --dataset-uuid.
Failure reasons: datasetNotFound; invalidRelationships (a column slug or
model UUID that doesn't resolve, or a duplicate — including the same pair stated
in reverse); modelNotCompatible (see below).
Unify models refuse manual relationships. In the native dataset, a unify
model's relationships are generated during sync, so naming one as fromModelUuid
or toModelUuid returns modelNotCompatible. Those auto-generated rows are also
excluded from the replace above, so a set call cannot delete them.
Unification
Unification is what merges records from several source models into one canonical
account/contact — and it is configurable from the CLI, via --unification on
model update. Pass null to clear it.
# Connector-driven: the integration decides how records unify
cargo-ai storage model update --uuid <model-uuid> --unification '{"source":"integration"}'
# Custom: you name the type, the matching keys, and optionally a parent
cargo-ai storage model update --uuid <model-uuid> --unification '{
"source": "custom",
"type": "account",
"uniqueColumns": [{"slug":"domain","reference":"domain"}],
"selectedColumnSlugs": ["name","industry","employee_count"],
"parent": {"kind":"model","columnSlug":"account_id","parentModelUuid":"<accounts-uuid>"}
}'
| Field | Applies to | Meaning |
|---|---|---|
source | both | integration (connector-defined) or custom |
type | custom | account, contact, accountEvent, contactEvent |
uniqueColumns | custom | Match keys — {slug, reference} per column. This is what decides which rows are the same entity |
selectedColumnSlugs | custom | Columns carried into the unified model. Omit for all |
timeColumnSlug | custom | Event timestamp — for the two *Event types |
parent | custom | Links contacts/events to their account: {"kind":"model","columnSlug":…,"parentModelUuid":…} or {"kind":"reference","columnSlug":…,"reference":…} |
filter | custom | Segmentation filter restricting which rows unify — same conjonction shape as segments |
Writing the config does not recompute anything. The unified rows are rebuilt by the model's sync run, so follow the update with a run and poll it:
cargo-ai storage run create --model-uuid <model-uuid>
cargo-ai storage run list --model-uuid <model-uuid>
Get the current config from storage model get <uuid> → unification (null
when the model doesn't unify). Once the run finishes, check the row count with
storage query execute before treating the change as done — a too-narrow
uniqueColumns under-merges and a too-broad one collapses distinct entities, and
both look like a successful run.
Records
# List records in a model
cargo-ai storage record list --model-uuid <uuid>
For advanced record queries (filtering, sorting, pagination), use segmentation segment fetch from the cargo-orchestration skill.
Query with SQL
Run SQL against workspace storage with storage query execute. Tables are referenced as <datasetSlug>.<modelSlug> (e.g. default.companies) and rewritten to the underlying storage table under the hood — no DDL lookup is needed for the table name.
cargo-ai storage query execute \
"SELECT name, domain FROM default.companies LIMIT 10"
# → { "rows": [...] } on success; non-zero exit with { "errorMessage": "..." } on error
For full exports, use storage query download — it returns a signed URL to a CSV (default) or Parquet file:
cargo-ai storage query download \
--query "SELECT name, domain, revenue FROM default.companies ORDER BY revenue DESC"
cargo-ai storage query download \
--query "SELECT * FROM default.companies" --format parquet
Get column slugs from storage column list --model-uuid <uuid> (or run storage model get-ddl <model-uuid> for the full schema and SQL dialect). Page through large result sets with LIMIT / OFFSET directly in the SQL.
See references/examples/queries.md for WHERE clauses, aggregations, joins, date queries, pagination, and the failure shapes returned on error.
Help
Every command supports --help:
cargo-ai storage model list --help
cargo-ai storage column create --help
cargo-ai storage relationship set --help
cargo-ai storage query execute --help
cargo-ai storage query download --help
Related skills
More from getcargohq/cargo-skills and the wider catalog.

cargo-workspace-management
Administer Cargo workspaces: manage members, API tokens, folders, and send feedback to the Cargo team.

cargo
Router and entry point for the Cargo CLI skill bundle — load first for multi-domain tasks or when unsure which skill to use.

cargo-ai
Build and configure AI agents in Cargo with prompts, RAG knowledge, MCP servers, and memory management.

cargo-analytics
Download run outputs, export data to CSV/JSON, and measure workflow success rates and error counts.

paseo
Manage coding agents, workspaces, and scheduled tasks through a remote daemon.

paseo-advisor
Spin up a single agent as an advisor for a second opinion on your current task.