REST API
Overview
The Carbon API is a REST interface over your manufacturing data — every table and view is an endpoint, with full read and write access.
There are three ways to call it: directly over HTTP, through the JavaScript SDK, or from the MCP server. Start by creating an API key.
Client libraries
Carbon's API is standard REST, so it works from any language. The recommended client is the JavaScript SDK, built on supabase-js.
The recommended client — supabase-js. Read and write Carbon with carbon.from('…').
QuickstartThe official supabase-flutter SDK for Dart and Flutter apps.
Supabase DartThe official supabase-swift SDK for iOS, macOS, and server-side Swift.
Supabase SwiftThe official supabase-py client, or call the REST API directly with requests.
Supabase PythonTables & views
The API exposes both tables (read/write) and views (read-only, computed). Some resources appear twice — for example salesInvoice (a table) and salesInvoices (a view). These are not interchangeable.
Always read from the view
Tables like salesInvoice and purchaseInvoice have stored total and status columns that are set at creation and not updated when line items change. The corresponding views (salesInvoices, purchaseInvoices) compute totals, tax, balance, and status live from line items and settlements. If you read from the table, you will get stale data.
The rule is simple:
In the sidebar, views are marked with an eye icon and tables with a grid icon. Affected resource pages also show a banner linking to the correct counterpart.
Quickstart
Save your key and the API URL as environment variables:
# .env
CARBON_API_URL=https://rest.carbon.ms
CARBON_API_KEY=<your-api-key>Then initialize the client:
import { createClient } from '@supabase/supabase-js'
const apiUrl = process.env.CARBON_API_URL
const apiKey = process.env.CARBON_API_KEY
export const carbon = createClient(apiUrl, apiKey)You can now query any resource with carbon.from('…'). Pick a resource from the sidebar for its endpoints and ready-to-copy samples — pointed at your configured instance.