ByteChef LogoByteChef
Coming soon

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

This capability is not available in the latest released version of ByteChef.

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:

CategoryModels
CRMaccount, contact, lead, opportunity, engagement, note, task, user
Accountingaccount, 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:

MethodPathOperationSuccess
POST/accountsCreate an account200 with { "id": "..." }
GET/accounts/{account_id}Get a single account200 with the account object
GET/accountsList accounts (paginated)200 with a page slice
PATCH/accounts/{account_id}Update an account204 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

HeaderRequiredDescription
AuthorizationYesBearer <connected-user-token> - identifies the connected user.
X-EnvironmentNoTarget environment: DEVELOPMENT, STAGING or PRODUCTION (case-insensitive). Defaults to PRODUCTION. An unknown name is rejected.
x-instance-idNoThe 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

ParameterApplies toDescription
include_raw_dataGET account, GET accountsAccepted, but the server does not read it yet.
sizeGET accountsEchoed in the response size. The provider's own page size decides how many items a page holds.
sortGET accountsAccepted and bound to the continuation token. Providers do not sort by it yet.
directionGET accountsAccepted and bound to the continuation token. Providers do not sort by it yet.
continuationTokenGET accountsOpaque cursor for the next page (see Pagination).

Pagination

List endpoints use cursor-based pagination. A list response is a page slice:

FieldTypeDescription
contentarrayThe list of unified objects for this page.
hasNextbooleantrue when continuationToken is set.
sizeintegerThe requested page size.
continuationTokenstring / nullCursor 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: PRODUCTION

Response:

{
  "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:

FieldTypeDescription
idstringThe unified account ID.
namestringThe account (company) name.
descriptionstringFree-text description.
industrystringIndustry classification.
numberOfEmployeesintegerEmployee count.
websitestringCompany website URL.
addressesarrayPostal addresses.
emailsarrayEmail addresses.
phonesarrayPhone numbers.
lifecycleStageobjectLifecycle stage of the account.
ownerIdstringID of the owning user.
lastActivityDatedate-timeTimestamp of the last activity.
customFieldsobjectProvider-specific custom fields passed through unchanged.
remoteIdstringThe record's ID in the third-party provider.
remoteDataobjectThe raw provider payload, when the provider's mapping supplies it.
createdDatedate-timeWhen the record was created.
lastModifiedDatedate-timeWhen 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

On this page