Skip to main content

REST API

Erdo’s REST API lets you integrate your data platform into any application. Query datasets, write data, manage conversations, create automations, and more — all via standard HTTP requests. Base URL: https://api.erdo.ai OpenAPI spec: the API Reference section in the sidebar is generated from the full machine-readable OpenAPI spec — every /v1 endpoint with its request and response schemas. Point a code generator or a coding agent at the spec to build a typed client. Authentication: All requests require a Bearer token in the Authorization header.

Getting an API Key

Click your profile in the bottom-left corner of Erdo and go to API Keys. Create a new key and copy the token — it’s shown only once. An API key is an account-level credential: it acts as you, and works in any organization you’re a member of. The organization stored on the key is only its default org — the one used when a request doesn’t name one. It is not a hard scope. To act in a specific organization, send the X-Organization-ID header with the org’s id or slug. The backend validates on every request that you’re a member of that org, so a key can never reach an org you don’t belong to:
Manage keys from the CLI too: erdo token create --name ci, erdo token list, erdo token revoke <id>. Set a command’s org with erdo --org acme <command> or change the active default with erdo org use acme.

Project context

Projects are optional work context inside an organization. To run a request in one, send its UUID as X-Project-ID together with the organization header:
The project must belong to the active organization. Erdo rejects an invalid, inaccessible, or cross-organization project on authenticated API and MCP requests rather than silently falling back to organization-wide scope. Project-aware list endpoints such as datasets and conversations narrow to resources attached to the project; new conversations, datasets, and workflow outputs are attached when the caller has contributor access. Endpoints that are explicitly organization-wide remain organization-wide. List IDs with GET /v1/projects (or erdo project list) and pass the same context to the CLI with erdo --org acme --project <uuid> <command>.

Scoped API Keys

A server that only needs part of the API should not hold a key that can do everything. Mint a scoped API key with a capability allowlist (e.g. datasets:query) and optional dataset/workstream slugs — every endpoint outside its grants is denied, and no capability can mint keys, touch managed organizations, or connect/delete integrations.

Scoped Tokens

For building apps where your end-users interact with Erdo, use scoped tokens to restrict access to specific datasets and threads.

API Surface

API keys and scoped tokens work on the documented API surface: every /v1 endpoint, the /mcp endpoint, and the endpoints used by the published SDKs (scoped-token minting, thread messaging, agent invocation, dataset reads). Requests to any other path return 403 permission_denied — other routes are internal to the Erdo app and not a stable contract to build against. If you need a capability that isn’t on /v1 yet, tell us rather than coupling to an internal route.

Datasets

List Datasets

Returns all datasets in your organization. Each thread includes its canonical title, creator ID, creator name and email when that user is still in the organization, and its creation source. New threads without an explicit name are titled from their first user message.

Configure an Integration Dataset

Update an existing integration dataset using the same generic segments returned by Discover Tables. Setting enable_sync materializes sync-capable integrations through Erdo’s canonical data platform; it does not create a snapshot dataset.

Create Dataset

Create a new empty dataset. Uses your organization’s default storage backend. After creation, use Write Rows to add data.

Upload a File as a Dataset

Upload a file and create a dataset from it in one call. The file’s schema is extracted before the response returns, so the dataset is immediately queryable. Prefer this over Create Dataset + Write Rows when your data already exists as a file.
ready reports whether schema extraction succeeded; when false, the file stored but is not yet queryable (a warning explains why).

Delete Dataset

Permanently delete a dataset and all its data. Requires admin permission on the dataset.

Search Datasets

Search datasets by name.

Get Dataset Schema

Get detailed schema for a dataset including column names, types, statistics, and sample data. Call this before writing data to understand the column structure.

Query Dataset (SQL)

Run a SQL query against a dataset. The SQL dialect depends on the storage backend (PostgreSQL, ClickHouse, or DuckDB for file datasets).
For file datasets (CSV/Excel), the table is always named data regardless of the resource key. For database, warehouse, and synchronized API integration datasets, use the actual resource or table name from the schema — passing resource_key selects which resource to query, and that resource’s name is the SQL table name.

Query Dataset (Natural Language)

Query a dataset using natural language. Erdo generates and executes the correct SQL for you.
The response carries both the SQL Erdo wrote and what it returned:
rows holds the values in columns order — the same tabular shape /v1/datasets/:slug/fetch returns, so both dataset reads are consumed the same way — and output is that result rendered to read. row_count is how many rows the query matched and can exceed the number of rows returned, which is capped at 1000; compare the two to tell whether you have the whole result. When the dataset’s saved filters shaped the read, applied_filters names them, so a count is never reported as the whole truth when it excludes something. On failure, success is false and error says why.

Fetch Dataset Contents

Fetch raw contents of a dataset without writing SQL.

Get Dataset Context

Get detailed context for multiple datasets at once — schemas, column types, statistics, and sample data.

Writing Data

Write data into your datasets from any application. Rows are written to whatever storage backend the dataset uses (Postgres, ClickHouse, or CSV file storage).

Write Rows

Write or upsert rows to a dataset. Append rows (no key column):
Upsert rows (with key column):
rows_inserted and rows_updated split rows_affected into the rows that created a row in the dataset and the rows that replaced one. A keyed write is an upsert, so this is the only way to tell a new record from a correction to one you already had — an arrival timestamp cannot say, because an upsert rewrites the row it matched and the timestamp moves with it. Rows also carry erdo_created_at, set when a write creates the row and left alone by every write after, for when you come back to the dataset later rather than reading the response. Storage-specific behavior:

Delete Rows

Delete rows from a dataset. Works for both file (CSV) and database-backed datasets.

Update Schema

Update a dataset’s schema: add, remove, rename columns, or change column types. Operations are applied atomically — if any fails, none are applied. Supported for CSV file datasets only. After changes, column analysis is automatically refreshed. Each operation object:

Ask Questions

Ask a Data Question

Ask a natural language question about your data. Invokes an AI agent that analyzes datasets, writes code, and returns a text answer.
Can take 30 seconds to 2 minutes for complex questions.

Integrations

Connect third-party apps and data sources so Erdo can use them — in agent runs, data questions, and datasets. What decides the flow is whether you already hold the credential: databases, API keys, and service accounts connect in a single call, and so do SaaS apps whose auth type is keys. OAuth apps are the exception, because the provider mints their credentials during the authorization itself — they return a connect_url for the user to authorize in a browser, and polling the status endpoint completes the connection. Connecting integrations covers both flows end to end.

List Integrations

Returns the integrations connected in your organization.

Search Connectable Apps

Search apps that can be connected: native integrations (databases, warehouses, APIs) and thousands of SaaS apps. The auth_types field tells you how connection works — database, api_key, service_account, basic, and aws_iam on a native integration, plus keys on a SaaS app, all connect directly with credentials, while oauth/oauth2/oauth1 apps go through a browser authorization step.

Connect an Integration

Connecting a database — created, verified, and activated in one call:
Connecting an OAuth app — the response carries a connect_url to open in a browser. Pass return_url when you embed the flow in your own product so the user’s browser lands back on your page (not Erdo’s) after authorizing:
If verification fails for a native credential integration (wrong password, unreachable host), the call returns an error and nothing is left behind — fix the credentials and retry. A SaaS keys app connects the same way but is not verified: its credentials go to the connector platform, which stores what it is given without calling the vendor. The response says so in next_step, and the first action run is what confirms the key.

Check Connection Status

Reports whether an app is connected. For browser-authorized apps this also completes any connection the user finished since the connect call — poll it after the user opens the connect_url. An app you have never connected answers {"app": "...", "connected": false, "integrations": []}. That is an ordinary answer about your account, not an error, so a caller starting from zero can poll it safely; a genuine provider failure still comes back as an error.

Delete an Integration

Removes a connected integration by its id (from List Integrations). The credential is deleted and any datasets built on the integration are cleaned up — the same behaviour as removing the connection in the Erdo web app. This is how you correct a connection made in the wrong organization without a trip to the UI. An id that does not exist in your organization — including one already deleted — answers 404 Not Found.

Discover Tables

Discover what a connected database integration exposes. :integration is the app key (e.g. postgres) or, when several instances of the same app are connected, the integration id. Without schema_name it lists the selectable schemas (all SQL databases and warehouses). With schema_name it lists that schema’s tables with columns, types, and row estimates — supported for SQL databases (Postgres, MySQL, and compatible); warehouses (BigQuery, Snowflake, ClickHouse) list schemas but not per-table columns here.

Create a Dataset from an Integration

Create a dataset backed by any connected integration that exposes queryable data. Database and warehouse integrations can query live against the source; sync-capable API integrations automatically materialize their provider resources through Erdo’s data platform. Pick selectable scopes with Discover Tables first when the integration exposes them (some allow only one). Integrations with neither a direct query path nor dataset sync are rejected. Resource and column discovery runs in the background and the dataset schema appears after the first discovery/sync, after which Query Dataset works against the returned slug.

Threads & Conversations

List Threads

Get Thread Messages

Get all messages from a conversation thread. User-authored messages include the author’s canonical ID, name, and email when that user is still in the organization. Each content item includes its persisted content_type and, when present, ui_content_type. Use ui_content_type to select the presentation component for structured content such as tool results and generated UI. UI-generation items also include created_by_invocation_id when the renderer needs the originating invocation to load referenced data.

Create Thread

Send Message

Send a message to a thread and get an AI-generated response. The optional context is available to the agent for this turn without becoming part of the visible user message in the thread. This lets an application supply the current page, selection, or other structured state while preserving an honest transcript. The persisted message is attributed to the authenticated user, including when the request comes through an application using the REST or MCP surface.
Can take 30 seconds to 2 minutes.

Memories & Skills

Memories store reusable knowledge and instructions that Erdo’s AI uses in future conversations.

Create Memory

Search Memories

List Memories

Delete Memory

Soft delete — can be recovered.

Artifacts

Artifacts are AI-generated outputs from agent runs — insights, metrics, alerts, and tables.

List Artifacts

Get Artifact


Screenshots

Capture a public web page to a PNG and get a signed, time-limited download URL. Only works on URLs reachable without login (a marketing site, a published Erdo page at https://pages.erdo.ai/p/{id}, etc.).
Response: signed_url, bucket_key, media_type, width, height, expires_at.

Pages

Deploy authenticated, data-wired HTML apps to Erdo over HTTP — the same surface as the erdo_deploy_page MCP tools, for CI and scripts. See the Build Apps on Erdo guide for the page runtime, the window.erdo client, and the read/write model.

Deploy Page

Returns the page id, editor url, optional public_url, and structured validation results. A deploy with validation errors still saves — fix them and iterate.

Update Page

Provided fields are merged — send only js to fix a script without resending html/css. Omit any field to keep its current value. dataset_slugs replaces the current grants; public toggles visibility. Returns fresh validation results.

Validate Page

Dry-run validation without deploying: HTML structure, JS/JSX syntax and runtime smoke checks, window.erdo usage, and dataset-slug references. Accepts html (required), css, js, runtime, and dataset_slugs.

Automations (Heartbeats)

Heartbeats are recurring agents that analyze your data on a schedule.

List Heartbeats

Create Heartbeat

Run Heartbeat

Trigger a heartbeat immediately, outside its schedule.

Enable or Disable Heartbeat

Pause a misbehaving automation so it stops running, or resume a paused one.

List Heartbeat Executions


Rendering

Render Chart

Render a data visualization. Supports bar, line, pie, histogram, and scatter charts. See MCP docs for full schema.

Render Table

Render a data table. See MCP docs for full schema.