Skip to main content
Version: v1 · Plan Required: Enterprise
Base URLhttps://api.bitscale.ai/api/v1
AuthenticationX-API-KEY: <your-api-key>
Content-Typeapplication/json
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

MethodPathDescription
GET/workspaceGet workspace details (plan, credits, members)
GET/gridsList all grids in the workspace (paginated)
GET/grids/:gridIdGet full metadata for a specific grid
GET/grids/:gridId/curlGet a ready-to-use curl command and API contract for running a grid
POST/grids/:gridId/runTrigger a grid run (sync or async)
GET/run/status/:requestIdPoll run status and retrieve outputs
POST/api-key/rotateGenerate a new workspace API key

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

HeaderValue
X-API-KEYYour workspace API key (required)

Example

curl -X POST "https://api.bitscale.ai/api/v1/grids/GRID_ID/run" \
  -H "X-API-KEY: sk-live-abc123xyz" \
  -H "Content-Type: application/json" \
  -d '{ "mode": "sync", "inputs": { "company_name": "Acme Corp" } }'

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

HTTPCodeDescription
401INVALID_API_KEYMissing X-API-KEY header, or the key is invalid / expired.

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.
LimitDefaultScope
Requests/sec5Per workspace
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:
HeaderDescription
X-RateLimit-LimitMaximum number of requests allowed per second for your workspace.
X-RateLimit-RemainingNumber of requests remaining in the current 1-second window.
Retry-AfterSeconds to wait before retrying. Present only on 429 responses (1).

Example — Rate Limit Exceeded

HTTP/1.1 429 Too Many Requests
X-RateLimit-Limit: 5
X-RateLimit-Remaining: 0
Retry-After: 1

{
  "error": {
    "code":    "RATE_LIMIT_EXCEEDED",
    "message": "Bitscale external API rate limit exceeded (5 requests/second per workspace)."
  }
}

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.
{
  "error": {
    "code":    "ERROR_CODE_STRING",
    "message": "Human readable description of the error."
  }
}

Example — Missing API Key

HTTP/1.1 401 Unauthorized

{
  "error": {
    "code":    "INVALID_API_KEY",
    "message": "Missing or invalid X-API-KEY header"
  }
}

5. Endpoints


5.1 Get Workspace Details

GET /api/v1/workspace
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.
GET /api/v1/workspace
X-API-KEY: sk-live-abc123xyz

Response — 200 OK

{
  "id": "ws-a1b2c3d4",
  "name": "Acme Corp Workspace",
  "created_at": "2024-06-01T10:00:00Z",
  "created_by": {
    "id": "user-uuid-here",
    "name": "Jane Smith",
    "email": "jane@acme.com"
  },
  "plan": {
    "name": "Enterprise",
    "credits_included": 50000,
    "billing_interval": "monthly",
    "next_billing_date": "2026-04-01T00:00:00Z",
    "price": 499.00,
    "currency": "USD"
  },
  "credits": {
    "total": 52000,
    "used": 12400,
    "remaining": 39600,
    "plan_credits": 50000,
    "rollover": 2000,
    "topup": 0
  },
  "people_company_searches": {
    "limit": 1000,
    "used": 230,
    "remaining": 770,
    "next_renewal_date": "2026-04-11T00:00:00Z"
  },
  "members": {
    "total": 8,
    "owners": 1,
    "admins": 2,
    "editors": 5
  }
}

Response Fields

FieldTypeDescription
idstringUnique workspace identifier.
namestringDisplay name of the workspace.
created_atstringISO 8601 timestamp of workspace creation.
created_byobjectDetails of the user who created the workspace.
plan.namestringCurrent plan name (e.g. "Enterprise").
plan.credits_includedintegerCredits included in the current billing cycle.
plan.billing_intervalstring"monthly", "yearly", or "quarterly".
plan.next_billing_datestringISO 8601 timestamp of the next billing date. null if not applicable.
plan.pricenumberPlan price. null if not applicable.
plan.currencystringCurrency code (e.g. "USD"). null if not applicable.
credits.totalintegerTotal credits available (plan + rollover + topup).
credits.usedintegerCredits consumed in the current period.
credits.remainingintegerCredits still available.
credits.plan_creditsintegerCredits from the base plan.
credits.rolloverintegerRollover credits carried over from the previous period.
credits.topupintegerCredits added via top-up purchases.
people_company_searches.limitintegerMonthly limit for People/Company search enrichments.
people_company_searches.usedintegerSearches used in the current month.
people_company_searches.remainingintegerSearches remaining this month.
people_company_searches.next_renewal_datestringISO 8601 date when the monthly search limit resets.
members.totalintegerTotal number of workspace members.
members.ownersintegerNumber of members with the Owner role.
members.adminsintegerNumber of members with the Admin role.
members.editorsintegerNumber of members with the Editor role.

Response Status Codes

HTTPCodeDescription
200Workspace details returned successfully.
401INVALID_API_KEYX-API-KEY header is missing or invalid.
404WORKSPACE_NOT_FOUNDWorkspace not found for the provided API key.
429RATE_LIMIT_EXCEEDEDToo many requests. Default limit is 5 req/sec.

5.2 List Grids in Workspace

GET /api/v1/grids
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

ParameterTypeRequiredDefaultDescription
searchstringNoFilter grids by name (case-insensitive substring match).
pageintegerNo1Page number (1-based).
limitintegerNo20Number of results per page. Maximum 100.

Example Request

GET /api/v1/grids?search=leads&page=1&limit=20
X-API-KEY: sk-live-abc123xyz

Response — 200 OK

{
  "grids": [
    {
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "name": "Lead Enrichment Grid",
      "description": "Enriches inbound leads with firmographic data.",
      "row_count": 1540,
      "column_count": 8,
      "created_at": "2025-11-01T09:00:00Z",
      "updated_at": "2026-03-12T14:22:00Z",
      "columns": [
        {
          "id": "col-key-abc",
          "name": "Company Description",
          "type": "enrichment",
          "dependencies": []
        },
        {
          "id": "col-key-def",
          "name": "Funding Summary",
          "type": "formula",
          "dependencies": ["col-key-abc"]
        }
      ]
    }
  ],
  "total": 42,
  "page": 1,
  "limit": 20,
  "total_pages": 3
}

Response Fields

FieldTypeDescription
gridsarrayList of grid objects for the current page.
totalintegerTotal number of grids matching the query.
pageintegerCurrent page number.
limitintegerNumber of results per page.
total_pagesintegerTotal number of pages.

Grid Object Fields

FieldTypeDescription
idstringUUID of the grid.
namestringDisplay name of the grid.
descriptionstringGrid description. May be empty.
row_countintegerNumber of rows currently in the grid.
column_countintegerTotal number of columns.
created_atstringISO 8601 creation timestamp.
updated_atstringISO 8601 last-updated timestamp.
columnsarrayRunnable columns only (type: enrichment, formula, or merge). See below.

Column Object Fields (columns array)

FieldTypeDescription
idstringColumn key used as the identifier when triggering runs.
namestringHuman-readable display name of the column.
typestringColumn type: "enrichment", "formula", or "merge".
dependenciesstring[]Array of column key IDs that this column depends on. Empty array if no dependencies.

Response Status Codes

HTTPCodeDescription
200Grid list returned successfully.
401INVALID_API_KEYX-API-KEY header is missing or invalid.
429RATE_LIMIT_EXCEEDEDToo many requests. Default limit is 5 req/sec.
500INTERNAL_ERRORUnexpected server error.

5.3 Get Grid Details

GET /api/v1/grids/:gridId
Returns full metadata for a single grid, including all column definitions, data sources, and grid settings.

Path Parameters

ParameterDescription
gridIdUUID of the grid. Found in the grid URL: app.bitscale.ai/grid/{gridId}

Example Request

GET /api/v1/grids/a1b2c3d4-e5f6-7890-abcd-ef1234567890
X-API-KEY: sk-live-abc123xyz

Response — 200 OK

{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "name": "Lead Enrichment Grid",
  "description": "Enriches inbound leads with firmographic data.",
  "row_count": 1540,
  "created_at": "2025-11-01T09:00:00Z",
  "updated_at": "2026-03-12T14:22:00Z",
  "settings": {
    "auto_run": false,
    "auto_dedupe": true,
    "visibility": "workspace",
    "dedupe_column_id": "col-key-abc"
  },
  "columns": [
    {
      "id": "col-key-abc",
      "name": "Company Name",
      "type": "text"
    },
    {
      "id": "col-key-def",
      "name": "Company Description",
      "type": "enrichment"
    }
  ],
  "sources": [
    {
      "id": "src-uuid-123",
      "display_name": "BitScale API",
      "type": "api",
      "is_scheduled": false,
      "status": "active",
      "last_run_at": "2026-03-12T14:20:00Z",
      "next_run_at": null,
      "schedule": null
    }
  ]
}

Response Fields

FieldTypeDescription
idstringUUID of the grid.
namestringDisplay name of the grid.
descriptionstringGrid description. May be empty.
row_countintegerNumber of rows in the grid.
created_atstringISO 8601 creation timestamp.
updated_atstringISO 8601 last-updated timestamp.
settingsobjectGrid-level settings (see below).
columnsarrayAll column definitions (see below).
sourcesarrayData sources attached to the grid (see below).

Settings Object

FieldTypeDescription
auto_runbooleanWhether new rows trigger automatic enrichment.
auto_dedupebooleanWhether duplicate rows are automatically removed.
visibilitystringGrid visibility: "workspace" or "private".
dedupe_column_idstringColumn key used for deduplication. Present only when auto_dedupe is true.

Column Object

FieldTypeDescription
idstringColumn key identifier.
namestringHuman-readable display name.
typestringColumn type: "text", "enrichment", "formula", or "merge".

Source Object

FieldTypeDescription
idstringUUID of the data source.
display_namestringDisplay name of the source.
typestringSource type (e.g. "api", "csv", etc.).
is_scheduledbooleanWhether the source runs on a schedule.
statusstringCurrent source status (e.g. "active", "paused").
last_run_atstringISO 8601 timestamp of last run. null if never run.
next_run_atstringISO 8601 timestamp of next scheduled run. null if not scheduled.
scheduleobjectSchedule details. Present only when is_scheduled is true (see below).

Schedule Object (when is_scheduled: true)

FieldTypeDescription
cron_schedulestringCron expression for the schedule.
next_run_atstringISO 8601 timestamp of the next scheduled run.

Response Status Codes

HTTPCodeDescription
200Grid details returned successfully.
401INVALID_API_KEYX-API-KEY header is missing or invalid.
403GRID_NOT_FOUNDGrid exists but does not belong to your workspace.
404GRID_NOT_FOUNDNo grid found for the provided gridId.
429RATE_LIMIT_EXCEEDEDToo many requests. Default limit is 5 req/sec.
500INTERNAL_ERRORUnexpected server error.

5.4 Get Grid Curl Command

GET /api/v1/grids/:gridId/curl
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

ParameterDescription
gridIdUUID of the grid. Found in the grid URL: app.bitscale.ai/grid/{gridId}

Query Parameters

ParameterTypeRequiredDescription
output_columnsstringNoComma-separated list of column key IDs to include in the run. When provided, required inputs are derived only from the dependencies of the specified columns. When omitted, inputs are derived from all runnable columns in the grid.

Example Request — All Columns

GET /api/v1/grids/a1b2c3d4-e5f6-7890-abcd-ef1234567890/curl
X-API-KEY: sk-live-abc123xyz

Example Request — Specific Output Columns

GET /api/v1/grids/a1b2c3d4-e5f6-7890-abcd-ef1234567890/curl?output_columns=col-key-def,col-key-ghi
X-API-KEY: sk-live-abc123xyz

Response — 200 OK

{
  "grid_id":   "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "grid_name": "Lead Enrichment Grid",
  "run_url":   "https://api.bitscale.ai/api/v1/grids/a1b2c3d4-e5f6-7890-abcd-ef1234567890/run",
  "method":    "POST",
  "headers": {
    "Content-Type": "application/json",
    "X-API-KEY":    "YOUR_WORKSPACE_API_KEY"
  },
  "request_body": {
    "mode": "sync",
    "inputs": {
      "company_name": "value",
      "website":      "value"
    },
    "output_columns": [
      "col-key-def",
      "col-key-ghi"
    ]
  },
  "output_columns": [
    {
      "id":   "col-key-def",
      "name": "Company Description",
      "type": "enrichment"
    },
    {
      "id":   "col-key-ghi",
      "name": "Funding Stage",
      "type": "enrichment"
    }
  ],
  "curl": "curl -X POST 'https://api.bitscale.ai/api/v1/grids/a1b2c3d4-e5f6-7890-abcd-ef1234567890/run' \\\n  -H 'X-API-KEY: YOUR_WORKSPACE_API_KEY' \\\n  -H 'Content-Type: application/json' \\\n  -d '{\n  \"inputs\": {\n    \"company_name\": \"value\",\n    \"website\": \"value\"\n  },\n  \"mode\": \"sync\",\n  \"output_columns\": [\n    \"col-key-def\",\n    \"col-key-ghi\"\n  ]\n}'"
}

Response Fields

FieldTypeDescription
grid_idstringUUID of the grid.
grid_namestringDisplay name of the grid.
run_urlstringFull URL for the POST /run endpoint for this grid.
methodstringHTTP method to use — always "POST".
headersobjectRequired request headers. Replace YOUR_WORKSPACE_API_KEY with your actual key.
request_bodyobjectThe full request body to send to the run endpoint. The inputs keys are derived from the grid’s column dependencies.
output_columnsarrayDetails of the output columns explicitly requested via output_columns. Omitted if no output_columns param was given.
curlstringA ready-to-use shell curl command. Replace YOUR_WORKSPACE_API_KEY before executing.

request_body Object

FieldTypeDescription
modestringAlways "sync" in the generated contract. Change to "async" for long-running grids if needed.
inputsobjectKey-value map of required input fields with placeholder "value" strings. Replace with real data.
output_columnsstring[]Column key IDs to return. Present only when output_columns was specified in the query param.

output_columns Array Item

FieldTypeDescription
idstringColumn key ID.
namestringHuman-readable display name.
typestringColumn type: "enrichment", "formula", or "merge".

Response Status Codes

HTTPCodeDescription
200Curl command and API contract returned successfully.
400MISSING_SOURCEGrid has no BitScale API source. Add one in grid settings first.
400INVALID_OUTPUT_COLUMNOne of the specified output_columns keys does not exist in the grid.
401INVALID_API_KEYX-API-KEY header is missing or invalid.
403GRID_NOT_FOUNDGrid exists but does not belong to your workspace.
404GRID_NOT_FOUNDNo grid found for the provided gridId.
429RATE_LIMIT_EXCEEDEDToo many requests. Default limit is 5 req/sec.

5.5 Run a Grid

POST /api/v1/grids/:gridId/run
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

ParameterDescription
gridIdUUID of the grid to run. Found in the grid URL: app.bitscale.ai/grid/{gridId}

Request Headers

HeaderValue
X-API-KEYYour workspace API key (required)
Content-Typeapplication/json (required)

Request Body

FieldTypeRequiredDescription
modestringNo"sync" or "async". Defaults to "sync" if omitted.
inputsobjectYesKey-value map of column keys (e.g. "company_name") to their input values. Use the column key shown in the API Datasource panel — not a UUID.
output_columnsstring[]NoArray of column UUID keys to include in the response. If omitted, all enriched columns are returned.
source_idstringNoUUID of the BitScale API source on the grid. If omitted, the first available source is used automatically.
webhook_urlstringNo(async only) HTTPS callback URL for when the run completes. Reserved for future use.

Example — Sync Mode

POST /api/v1/grids/a1b2c3d4-e5f6-7890-abcd-ef1234567890/run
X-API-KEY: sk-live-abc123xyz
Content-Type: application/json

{
  "mode": "sync",
  "inputs": {
    "company_name": "Acme Corp",
    "website":      "acme.com"
  },
  "output_columns": [
    "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
    "6ba7b811-9dad-11d1-80b4-00c04fd430c8"
  ]
}

Example — Async Mode

POST /api/v1/grids/a1b2c3d4-e5f6-7890-abcd-ef1234567890/run
X-API-KEY: sk-live-abc123xyz
Content-Type: application/json

{
  "mode": "async",
  "inputs": {
    "company_name": "Acme Corp"
  }
}

Responses

200 OK — Sync Completed (run finished within 120 seconds)
{
  "mode":   "sync",
  "status": "completed",
  "outputs": {
    "6ba7b810-9dad-11d1-80b4-00c04fd430c8": {
      "value": "AI-powered data enrichment platform",
      "name":  "Company Description"
    },
    "6ba7b811-9dad-11d1-80b4-00c04fd430c8": {
      "value": "Series B",
      "name":  "Funding Stage"
    }
  }
}
200 OK — Async Started / Sync Timeout (poll request_id for results)
{
  "mode":       "async",
  "status":     "running",
  "request_id": "550e8400-e29b-41d4-a716-446655440000",
  "poll_url":   "https://api.bitscale.ai/api/v1/run/status/550e8400-e29b-41d4-a716-446655440000",
  "message":    "Row is still running. Poll the poll_url for results."
}

Output Object Shape

Each key in outputs is a column UUID. The value is an object with:
FieldDescription
valueThe enriched output (string, number, array, or object depending on column type)
nameHuman-readable display name of the column as set in the grid

Response Status Codes

HTTPCodeDescription
200Request accepted. Check status field in body.
400MISSING_REQUIRED_FIELDinputs is missing or request body is malformed JSON.
400MISSING_SOURCEGrid has no BitScale API source. Add one in grid settings.
400INVALID_SOURCEThe source_id provided does not exist for this grid.
400INVALID_REQUESTmode is not "sync" or "async".
401INVALID_API_KEYX-API-KEY header is missing or invalid.
403FEATURE_DISABLEDBitScale APIs not enabled on your plan. Upgrade to Enterprise.
403GRID_NOT_FOUNDGrid exists but does not belong to your workspace.
404GRID_NOT_FOUNDNo grid found for the provided gridId.
429RATE_LIMIT_EXCEEDEDToo many requests. Default limit is 5 req/sec per workspace.
500RUN_FAILEDRow run encountered an error. Check message for details.
500INTERNAL_ERRORUnexpected server error. Contact support if this persists.

5.6 Get Run Status

GET /api/v1/run/status/:requestId
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

ParameterDescription
requestIdUUID returned as request_id from POST /grids/:gridId/run

Example Request

GET /api/v1/run/status/550e8400-e29b-41d4-a716-446655440000
X-API-KEY: sk-live-abc123xyz

Responses

200 OK — Still Running
{
  "mode":    "async",
  "status":  "running",
  "grid_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
200 OK — Completed
{
  "mode":    "async",
  "status":  "completed",
  "grid_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "outputs": {
    "6ba7b810-9dad-11d1-80b4-00c04fd430c8": {
      "value": "AI-powered data enrichment platform",
      "name":  "Company Description"
    }
  }
}

Response Fields

FieldTypeDescription
modestring"sync" or "async" — matches the mode used when the run was started.
statusstring"running", "completed", or "failed".
grid_idstringUUID of the grid that was run.
outputsobjectPresent only when status is "completed". Same shape as POST run outputs.

Response Status Codes

HTTPCodeDescription
200Status returned successfully. Check status field.
401INVALID_API_KEYX-API-KEY header is missing or invalid.
404REQUEST_NOT_FOUNDNo run request found for requestId, or it belongs to a different workspace.
429RATE_LIMIT_EXCEEDEDToo many requests. Default limit is 5 req/sec per workspace.
500RUN_FAILEDThe run encountered an error. Message contains details.

5.7 Rotate API Key

POST /api/v1/api-key/rotate
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.
POST /api/v1/api-key/rotate
X-API-KEY: sk-live-abc123xyz

Response — 200 OK

{
  "api_key": "sk-live-newkey9876xyz"
}

Response Fields

FieldDescription
api_keyThe newly generated workspace API key. Replace your old key with this value immediately.

Response Status Codes

HTTPCodeDescription
200New API key generated. Old key is now invalid.
401INVALID_API_KEYX-API-KEY header is missing or invalid.
500ROTATE_FAILEDKey rotation failed. Retry or contact support.

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

Client                              BitScale API
  │                                     │
  │── POST /grids/:gridId/run ──────────▶│
  │   { mode: 'sync', inputs: {...} }    │
  │                                     │── Runs row enrichments
  │                                     │   (waits up to 120s)
  │                                     │
  │◀── 200 OK { status: 'completed', ───│  (success within 120s)
  │            outputs: {...} }          │
  │                                     │
  │◀── 200 OK { status: 'running',  ────│  (timeout after 120s)
  │            request_id: '...',        │
  │            poll_url: '...' }         │
  │                                     │
  │── GET /run/status/:requestId ───────▶│  (poll every 2-5s)
  │◀── 200 OK { status: 'completed' } ──│

Async Flow

Client                              BitScale API
  │                                     │
  │── POST /grids/:gridId/run ──────────▶│
  │   { mode: 'async', inputs: {...} }   │
  │                                     │
  │◀── 200 OK { status: 'running', ─────│  (immediate response)
  │            request_id: '...',        │
  │            poll_url: '...' }         │── Runs row enrichments
  │                                     │   in background
  │── GET /run/status/:requestId ───────▶│  (poll every 2-5s)
  │◀── 200 OK { status: 'running' } ────│
  │                                     │
  │── GET /run/status/:requestId ───────▶│
  │◀── 200 OK { status: 'completed', ───│
  │            outputs: {...} }          │

7. Error Code Reference

CodeHTTPDescription
INVALID_API_KEY401The X-API-KEY header is missing, empty, or does not match any workspace.
MISSING_REQUIRED_FIELD400A required field is absent — most commonly inputs was not provided or JSON is malformed.
INVALID_REQUEST400A field value is invalid — e.g. mode is neither "sync" nor "async".
MISSING_SOURCE400The grid has no BitScale API source configured. Add one in grid settings.
INVALID_SOURCE400The source_id provided does not match any BitScale API source on this grid.
MISSING_SOURCE_COLUMN400The grid has no source (DataSource) column — unexpected grid configuration error.
INVALID_INPUTS400The inputs object could not be serialized. Ensure all values are JSON-serializable.
INVALID_OUTPUT_COLUMN400One of the output_columns keys specified in GET /grids/:gridId/curl does not exist in the grid.
GRID_NOT_FOUND404No grid exists for the given gridId, or it belongs to a different workspace.
WORKSPACE_NOT_FOUND404No workspace found for the provided API key.
REQUEST_NOT_FOUND404No run request found for the given requestId, or it belongs to a different workspace.
FEATURE_DISABLED403BitScale APIs is an Enterprise-only feature. Upgrade your workspace plan.
RATE_LIMIT_EXCEEDED429Too many requests. Default is 5 req/sec per workspace. Contact team@bitscale.ai or your account manager to adjust.
RUN_FAILED500The row run failed during execution. Check the error message for details.
ROTATE_FAILED500API key rotation failed unexpectedly. Retry or contact BitScale support.
INTERNAL_ERROR500An unexpected server error occurred. Contact support if this persists.

© BitScale · api.bitscale.ai