Unified API
A normalized REST API with one schema per category (CRM, Accounting) that ByteChef translates to the provider each connected user connected.
Coming soon
The Unified API is a normalized REST layer with one schema per category of third-party provider. You write against one ByteChef account shape, and ByteChef translates each request and response to the provider (for example HubSpot, Pipedrive or Xero) that the calling connected user connected. It is meant for developers who want one code path for a whole category instead of one per provider.
- One model per category. You build against the unified model. A new provider in the same category needs no change on your side once its component implements the mapping.
- Connected-user scoped. Every call runs against the calling connected user's own connection, so you never handle provider credentials.
The Unified API is built on the same components as the rest of Embedded. Each supporting provider component ships a mapping between its native model and the unified model, and the Unified API calls that component with the connected user's connection.
Enterprise Edition
The Unified API endpoints are part of the Enterprise Edition. The Unified API category filter on the Integrations list is behind a feature flag and does not filter the list yet.
Categories and models
The Unified API is organized into categories (a domain such as CRM or Accounting) and, within each category, a catalog of normalized models (common objects). The category model catalogs are:
| Category | Models |
|---|---|
| CRM | account, contact, lead, opportunity, engagement, note, task, user |
| Accounting | account, contact, address, attachment, company_info, credit_note, expense, balance_sheet, cash_flow_statement, and more |
Currently exposed endpoints
The model catalogs above define the normalized schema. The only REST endpoints wired today are the Account resource in the CRM and Accounting categories. Other models have no endpoint yet.
Providers that implement the mapping today: HubSpot and Pipedrive (CRM) and Xero (Accounting). Coverage grows as more components implement the unified mapping.
Base path and endpoint shape
All Unified API endpoints live under the embedded API, namespaced by category:
/api/embedded/v1/unified/{category}{category} is crm or accounting. Each resource exposes standard REST operations. For the Account resource:
| Method | Path | Operation | Success |
|---|---|---|---|
POST | /accounts | Create an account | 200 with { "id": "..." } |
GET | /accounts/{account_id} | Get a single account | 200 with the account object |
GET | /accounts | List accounts (paginated) | 200 with a page slice |
PATCH | /accounts/{account_id} | Update an account | 204 No Content |
Full example paths:
GET /api/embedded/v1/unified/crm/accounts
POST /api/embedded/v1/unified/crm/accounts
GET /api/embedded/v1/unified/accounting/accounts/{account_id}Authentication
Every request is authenticated with the connected user's signed JWT (the same token the frontend embedded API uses):
Authorization: Bearer <connected-user-token>API keys are not accepted on these endpoints, because the path carries no externalUserId. The token's sub claim identifies the connected user. ByteChef selects that user's integration instance and connection for the target category and runs the operation against the provider they connected. A caller cannot reach another connected user's connection: an x-instance-id that does not belong to the connected user is rejected, and a connection created in a different environment than X-Environment fails with an invalid-connection error. See connected users and tenant-isolated security.
Request headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer <connected-user-token> - identifies the connected user. |
X-Environment | No | Target environment: DEVELOPMENT, STAGING or PRODUCTION (case-insensitive). Defaults to PRODUCTION. An unknown name is rejected. |
x-instance-id | No | The ID of the connected user's integration instance to use. When omitted, ByteChef picks the connected user's integration instance whose component supports the requested category. |
Common query parameters
| Parameter | Applies to | Description |
|---|---|---|
include_raw_data | GET account, GET accounts | Accepted, but the server does not read it yet. |
size | GET accounts | Echoed in the response size. The provider's own page size decides how many items a page holds. |
sort | GET accounts | Accepted and bound to the continuation token. Providers do not sort by it yet. |
direction | GET accounts | Accepted and bound to the continuation token. Providers do not sort by it yet. |
continuationToken | GET accounts | Opaque cursor for the next page (see Pagination). |
Pagination
List endpoints use cursor-based pagination. A list response is a page slice:
| Field | Type | Description |
|---|---|---|
content | array | The list of unified objects for this page. |
hasNext | boolean | true when continuationToken is set. |
size | integer | The requested page size. |
continuationToken | string / null | Cursor to fetch the next page. null when there is no next page. |
To page forward, pass the continuationToken from one response as the continuationToken query parameter of the next request:
GET /api/embedded/v1/unified/crm/accounts?size=50
GET /api/embedded/v1/unified/crm/accounts?size=50&continuationToken=<token-from-previous-response>The continuation token encodes the sort and direction it was issued for. A request that changes either while sending a token is rejected. Drop the token to start again from the first page.
Example: create an account
Request:
POST /api/embedded/v1/unified/crm/accounts HTTP/1.1
Authorization: Bearer <connected-user-token>
X-Environment: PRODUCTION
Content-Type: application/json
{
"name": "ByteChef",
"description": "Integration API",
"industry": "Software",
"numberOfEmployees": 120,
"website": "https://bytechef.io/"
}Response:
{ "id": "1234" }Example: list accounts
Request:
GET /api/embedded/v1/unified/crm/accounts?size=2 HTTP/1.1
Authorization: Bearer <connected-user-token>
X-Environment: PRODUCTIONResponse:
{
"content": [
{
"id": "1234",
"name": "ByteChef",
"industry": "Software",
"website": "https://bytechef.io/",
"remoteId": "account_1234",
"createdDate": "2023-02-27T00:00:00Z",
"lastModifiedDate": "2023-02-27T00:00:00Z"
}
],
"hasNext": true,
"size": 2,
"continuationToken": "cD0yMDIxLTAxLTA2KzAzJTNBMjQ..."
}Unified account fields
A subset of the normalized CRM account model:
| Field | Type | Description |
|---|---|---|
id | string | The unified account ID. |
name | string | The account (company) name. |
description | string | Free-text description. |
industry | string | Industry classification. |
numberOfEmployees | integer | Employee count. |
website | string | Company website URL. |
addresses | array | Postal addresses. |
emails | array | Email addresses. |
phones | array | Phone numbers. |
lifecycleStage | object | Lifecycle stage of the account. |
ownerId | string | ID of the owning user. |
lastActivityDate | date-time | Timestamp of the last activity. |
customFields | object | Provider-specific custom fields passed through unchanged. |
remoteId | string | The record's ID in the third-party provider. |
remoteData | object | The raw provider payload, when the provider's mapping supplies it. |
createdDate | date-time | When the record was created. |
lastModifiedDate | date-time | When the record was last modified. |
The Accounting account model is different. It carries fields such as accountNumber, classification, currency, currentBalance, status, type and parentAccountId. Each category defines its own normalized schema; authentication, pagination, remoteData and customFields work the same way in both.
How it relates to components
The Unified API does not replace components. It uses them:
- A connected user still connects a specific provider (HubSpot, Pipedrive, Xero) through the normal connection flow.
- Each supporting provider component declares how its native objects map to the unified model.
- When you call the Unified API, ByteChef looks up the connected user's connection for the category, invokes the matching component action, and translates between the unified schema and the provider's schema in both directions.
How is this guide?
Last updated on