Examples
Use these end-to-end recipes to verify a new environment, instrument an application, or connect an agent. Replace placeholder credentials and catalog names before running a command.
Upload a CSV and query it
You need: lakehouse credentials, a writable catalog, and a local users.csv file.
1. Upload the file
curl "https://api.altertable.ai/upload?catalog=my_catalog&schema=main&table=users&mode=create" \-H "Authorization: Basic $ALTERTABLE_BASIC_AUTH_TOKEN" \--data-binary @users.csv
2. Verify the rows
curl https://api.altertable.ai/query \-H "Authorization: Basic $ALTERTABLE_BASIC_AUTH_TOKEN" \-d '{"statement":"SELECT count(*) AS row_count FROM my_catalog.main.users"}'
The JSONL response should contain a row_count value matching the CSV. See the upload guide for overwrite and append modes.
Track and verify a product event
You need: Product Analytics enabled and a public API key.
1. Send an event
curl https://api.altertable.ai/track \-H "X-API-Key: $ALTERTABLE_API_KEY" \-H "Content-Type: application/json" \-d '{"environment":"production","event":"Purchase Completed","distinct_id":"user_123","properties":{"amount":99.99,"currency":"USD"}}'
2. Verify ingestion
SELECT event, distinct_id, propertiesFROM product_analytics.main.eventsWHERE event = 'Purchase Completed'ORDER BY timestamp DESCLIMIT 10;
The newest row should contain user_123 and the purchase properties. Continue with the funnel guide when the event is flowing.
Run a first CLI query
You need: a browser for sign-in and access to an Altertable environment.
1. Install and authenticate
curl -fsSL https://install.altertable.ai | shaltertable login
2. Verify the profile
altertable query "SELECT 42 AS answer"
The result should contain one answer column with the value 42. Next, list available catalogs and run a query against your own data:
altertable catalogs listaltertable query "SELECT * FROM my_catalog.main.my_table LIMIT 10"
See the CLI guide for profiles, structured output, and file ingestion.
Connect Codex through MCP
You need: Codex with MCP support and access to an Altertable organization.
1. Add the hosted server
Follow the Codex setup guide and use this endpoint:
https://mcp.altertable.ai/mcp
2. Verify tools and access
Ask Codex:
Use Altertable to list my available catalogs, then describe the tables in the catalog I select.
Codex should request authorization, discover the Altertable tools, and return catalogs from the environment selected during sign-in. See the MCP tools reference for every available operation.
Need a different path?
Browse ingestion guides, query clients, or agent setup for a workflow that matches your stack.