Quickstart
This guide walks you through creating a dataset, adding a table, inserting data, and running your first query.
Prerequisites
Section titled “Prerequisites”- A Catalyzed account (sign up here)
- An API token (see API Tokens)
Quick Start
Section titled “Quick Start”-
Set up your API token
Export your token as an environment variable:
Terminal window export API_TOKEN="cat_tok_..." -
Get your team ID
Get your teams
Terminal window curl https://api.catalyzed.ai/teams \-H "Authorization: Bearer $API_TOKEN"const response = await fetch("https://api.catalyzed.ai/teams", {headers: { Authorization: `Bearer ${process.env.API_TOKEN}` },});const { teams } = await response.json();const teamId = teams[0].teamId;import osimport requestsresponse = requests.get("https://api.catalyzed.ai/teams",headers={"Authorization": f"Bearer {os.environ['API_TOKEN']}"})teams = response.json()["teams"]team_id = teams[0]["teamId"]Note the
teamIdfrom the response. -
Create a dataset
Create dataset
Terminal window curl -X POST https://api.catalyzed.ai/datasets \-H "Authorization: Bearer $API_TOKEN" \-H "Content-Type: application/json" \-d '{"teamId": "YOUR_TEAM_ID","name": "My First Dataset"}'const response = await fetch("https://api.catalyzed.ai/datasets", {method: "POST",headers: {Authorization: `Bearer ${process.env.API_TOKEN}`,"Content-Type": "application/json",},body: JSON.stringify({teamId: teamId,name: "My First Dataset",}),});const dataset = await response.json();response = requests.post("https://api.catalyzed.ai/datasets",headers={"Authorization": f"Bearer {os.environ['API_TOKEN']}"},json={"teamId": team_id, "name": "My First Dataset"})dataset = response.json()Note the
datasetIdfrom the response. -
Create a table
Create table
Terminal window curl -X POST https://api.catalyzed.ai/dataset-tables \-H "Authorization: Bearer $API_TOKEN" \-H "Content-Type: application/json" \-d '{"datasetId": "YOUR_DATASET_ID","tableName": "users","fields": [{"name": "id", "arrowType": "utf8", "nullable": false},{"name": "name", "arrowType": "utf8", "nullable": false},{"name": "email", "arrowType": "utf8", "nullable": false},{"name": "created_at", "arrowType": "timestamp", "nullable": false}],"primaryKeyColumns": ["id"]}'const response = await fetch("https://api.catalyzed.ai/dataset-tables", {method: "POST",headers: {Authorization: `Bearer ${process.env.API_TOKEN}`,"Content-Type": "application/json",},body: JSON.stringify({datasetId: dataset.datasetId,tableName: "users",fields: [{ name: "id", arrowType: "utf8", nullable: false },{ name: "name", arrowType: "utf8", nullable: false },{ name: "email", arrowType: "utf8", nullable: false },{ name: "created_at", arrowType: "timestamp", nullable: false },],primaryKeyColumns: ["id"],}),});const table = await response.json();response = requests.post("https://api.catalyzed.ai/dataset-tables",headers={"Authorization": f"Bearer {os.environ['API_TOKEN']}"},json={"datasetId": dataset["datasetId"],"tableName": "users","fields": [{"name": "id", "arrowType": "utf8", "nullable": False},{"name": "name", "arrowType": "utf8", "nullable": False},{"name": "email", "arrowType": "utf8", "nullable": False},{"name": "created_at", "arrowType": "timestamp", "nullable": False}],"primaryKeyColumns": ["id"]})table = response.json()Note the
tableIdfrom the response. -
Insert data
Insert rows
Terminal window curl -X POST "https://api.catalyzed.ai/dataset-tables/YOUR_TABLE_ID/rows?mode=append" \-H "Authorization: Bearer $API_TOKEN" \-H "Content-Type: application/json" \-d '[{"id": "1", "name": "Alice", "email": "[email protected]", "created_at": "2024-01-15T10:00:00Z"},{"id": "2", "name": "Bob", "email": "[email protected]", "created_at": "2024-01-15T11:00:00Z"},{"id": "3", "name": "Charlie", "email": "[email protected]", "created_at": "2024-01-15T12:00:00Z"}]'await fetch(`https://api.catalyzed.ai/dataset-tables/${table.tableId}/rows?mode=append`, {method: "POST",headers: {Authorization: `Bearer ${process.env.API_TOKEN}`,"Content-Type": "application/json",},body: JSON.stringify([]),});requests.post(f"https://api.catalyzed.ai/dataset-tables/{table['tableId']}/rows?mode=append",headers={"Authorization": f"Bearer {os.environ['API_TOKEN']}"},json=[]) -
Query your data
Query the table
Terminal window curl -X POST https://api.catalyzed.ai/queries \-H "Authorization: Bearer $API_TOKEN" \-H "Content-Type: application/json" \-d '{"sql": "SELECT * FROM users ORDER BY created_at DESC","tables": {"users": "YOUR_TABLE_ID"}}'const response = await fetch("https://api.catalyzed.ai/queries", {method: "POST",headers: {Authorization: `Bearer ${process.env.API_TOKEN}`,"Content-Type": "application/json",},body: JSON.stringify({sql: "SELECT * FROM users ORDER BY created_at DESC",tables: { users: table.tableId },}),});const results = await response.json();console.log(results.rows);response = requests.post("https://api.catalyzed.ai/queries",headers={"Authorization": f"Bearer {os.environ['API_TOKEN']}"},json={"sql": "SELECT * FROM users ORDER BY created_at DESC","tables": {"users": table["tableId"]}})results = response.json()print(results["rows"])
What’s Next?
Section titled “What’s Next?”You’ve created a dataset, table, and run your first query! Here’s what to explore next:
- Tables - Learn about schemas, indexes, and advanced querying
- Files - Upload CSV, JSON, or PDF files for processing
- Pipelines - Automate workflows with AI-powered pipelines
- API Reference - Explore all available endpoints