Skip to main content
Version: v1 · Plan Required: Enterprise
Enterprise Only — BitScale APIs is an Enterprise feature. Your workspace plan must be upgraded before any of these endpoints will respond successfully.

Table of Contents

  1. Overview
  2. Authentication
  3. Rate Limits
  4. Error Format
  5. Endpoints
  6. Sync vs Async Modes
  7. Error Code Reference

1. Overview

The BitScale External API lets you programmatically query workspace and grid metadata, trigger grid runs, poll for results, and manage your workspace API key. It is designed for use with MCP integrations, CI/CD pipelines, and any external system that needs to interact with BitScale grids automatically.

Endpoints at a Glance


2. Authentication

All requests must include a workspace-level API key in the X-API-KEY header. The key uniquely identifies your workspace — no separate workspace ID header is required.

Request Header

Example

Obtaining Your API Key

  1. Log into your BitScale workspace.
  2. Navigate to Settings → Accounts → API Keys.
  3. Copy the displayed workspace API key.
  4. To generate a new key, use POST /api/v1/api-key/rotate or rotate it from the dashboard.
⚠ Important — Your API key identifies your entire workspace. Keep it secret and never expose it in client-side code or public repositories. If compromised, rotate it immediately.

Authentication Errors


3. Rate Limits

The BitScale External API enforces a default rate limit of 5 requests per second per workspace. Rate limiting is applied globally across all endpoints — including read-only endpoints like GET /workspace and GET /grids. Exceeding this limit will result in a 429 Too Many Requests response. If your integration requires a higher (or lower) limit, reach out to your account manager or contact support at team@bitscale.ai to have it adjusted.
ℹ Note — Rate limits apply across all endpoints within a workspace. Polling GET /run/status/:requestId counts toward your limit, so poll at a reasonable interval (every 2–5 seconds) rather than as fast as possible.

Rate Limit Response Headers

Every API response includes the following headers so you can track your usage:

Example — Rate Limit Exceeded


4. Error Format

When a request fails, the API returns a JSON object with a top-level error key containing a machine-readable code and a human-readable message.

Example — Missing API Key


5. Endpoints


5.1 Get Workspace Details

Returns details about the workspace associated with the provided X-API-KEY, including plan information, credit balances, and member counts.

Request

No request body or path parameters required. The workspace is identified from the X-API-KEY header.

Response — 200 OK

Response Fields

Response Status Codes


5.2 List Grids in Workspace

Returns a paginated list of grids in the workspace identified by the X-API-KEY, along with their column definitions (runnable columns only). Supports filtering by name.

Query Parameters

Example Request

Response — 200 OK

Response Fields

Grid Object Fields

Column Object Fields (columns array)

Response Status Codes


5.3 Get Grid Details

Returns full metadata for a single grid, including all column definitions, data sources, and grid settings.

Path Parameters

Example Request

Response — 200 OK

Response Fields

Settings Object

Column Object

Source Object

Schedule Object (when is_scheduled: true)

Response Status Codes


5.4 Get Grid Curl Command

Returns a ready-to-use curl command and a structured API contract for running a specific grid. This endpoint is designed for AI agents and integrations that need to understand what inputs a grid requires and how to call the run endpoint — without any trial and error. The response includes the derived required inputs (traced from the grid’s column dependencies), the full run URL, request body shape, and a copy-paste-ready curl command.
💡 Tip for AI agents — Call this endpoint first to discover the exact input fields needed for a grid, then use POST /grids/:gridId/run with the returned request_body.inputs shape.

Path Parameters

Query Parameters

Example Request — All Columns

Example Request — Specific Output Columns

Response — 200 OK

Response Fields

request_body Object

output_columns Array Item

Response Status Codes


5.5 Run a Grid

Appends a new row to the specified grid using the provided inputs and triggers all column enrichments. Supports two execution modes:
  • sync (default) — waits up to 120 seconds for completion and returns outputs directly. If still processing at the deadline, returns a request_id to poll.
  • async — returns a request_id immediately. Poll GET /run/status/:requestId for results.
💡 Get your curl instantly — Use GET /grids/:gridId/curl to retrieve a pre-built curl command and the exact input fields required for any grid. You can also open any grid in app.bitscale.ai, click on the Data source column, select the BitScale API source, and find a ready-to-use curl command pre-filled with your grid ID, API key, and input fields. Use the output column toggles to include or exclude specific columns — the curl updates live to reflect your selection.

Path Parameters

Request Headers

Request Body

Example — Sync Mode

Example — Async Mode

Responses

200 OK — Sync Completed (run finished within 120 seconds)
200 OK — Async Started / Sync Timeout (poll request_id for results)

Output Object Shape

Each key in outputs is a column UUID. The value is an object with:

Response Status Codes


5.6 Get Run Status

Returns the current status of a run identified by its request_id. Call this after receiving a request_id from POST /grids/:gridId/run — either in async mode or when sync mode times out.
ℹ Note — Poll every 2–5 seconds until status is "completed" or "failed". Avoid polling more frequently as requests count toward your rate limit.

Path Parameters

Example Request

Responses

200 OK — Still Running
200 OK — Completed

Response Fields

Response Status Codes


5.7 Rotate API Key

Generates a new workspace API key and immediately invalidates the current key used to make the request.
⚠ Important — This action is irreversible. The moment this endpoint responds successfully, the key used to call it stops working. Update all integrations with the new key immediately.

Request

No request body is required. The workspace is identified from the X-API-KEY header.

Response — 200 OK

Response Fields

Response Status Codes


6. Sync vs Async Modes

When calling POST /grids/:gridId/run, you choose how to handle the response using the mode field.

Sync Mode (default)

Set mode: "sync" or omit the field entirely.
  • Server waits up to 120 seconds for the run to complete.
  • On success: outputs are returned inline in the response.
  • On timeout: a request_id is returned; poll GET /run/status/:requestId.
  • Best for: fast grids, interactive use cases, MCP tool integrations.

Async Mode

Set mode: "async".
  • Server returns a request_id immediately (no waiting).
  • Poll GET /run/status/:requestId every 2–5 seconds for results.
  • Suitable for long-running grids (> 120 seconds).
  • Best for: pipelines, batch jobs, background processing.

Sync Flow

Async Flow


7. Error Code Reference


© BitScale · api.bitscale.ai